From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id BDD2440DC0 for ; Sat, 1 Jan 2022 00:17:53 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 553FA687EBB; Sat, 1 Jan 2022 02:17:50 +0200 (EET) Received: from mail.personalprojects.net (mail.personalprojects.net [51.79.67.80]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B688A687EBB for ; Sat, 1 Jan 2022 02:17:44 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=personalprojects.net; s=20211201; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:To:Subject:MIME-Version:Date:Message-ID:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1S5MMMg6Ej0iGz6aZArEZ8nNf8fA+dp+xh81mJSzG/Q=; b=SWZm+SEn9j8xXHlJk8EaqImQYV i0QTJjULoLKyJ6DcJ0wFWIFalsB8hemhFTN4aKV0bnte4IjnZafnxK0niajF2T95Ox/x5PUlBI/km 7taYmxHkGwmC1aMLFAznbLwKphoyWJrnf+nL4wpPrO3X98tBzJbpK183kWhckt+LPCUk=; Received: from bras-base-simcon3012w-grc-05-64-231-188-105.dsl.bell.ca ([64.231.188.105] helo=[192.168.10.2]) by mail.personalprojects.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n3S5f-0006gn-5s for ffmpeg-devel@ffmpeg.org; Fri, 31 Dec 2021 19:17:43 -0500 Message-ID: <80d511a7-846b-6803-171e-98e07eccb227@personalprojects.net> Date: Fri, 31 Dec 2021 19:17:42 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Content-Language: en-CA To: ffmpeg-devel@ffmpeg.org References: <20211231195019.16191-1-jpstewart@personalprojects.net> From: John-Paul Stewart In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 0/2] avformat/mvdec: make audio stream conditional X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 2021-12-31 17:19, Andreas Rheinhardt wrote: > John-Paul Stewart: >> Recent discussion on the list led me to realize that libavformat was >> unconditionally creating an audio stream for all SGI movie format >> (version 2) files, even when no audio is present in the file. >> >> A sample of a movie file with no audio can be found at >> http://www.personalprojects.net/ffmpeg/silent.movie >> >> Unpatched ffmpeg will report an audio stream even though no audio is >> present. After the following patch no audio stream is reported. >> >> SGI movie files with audio are slightly affected by the fact that the >> audio stream is now allocated after the video stream, changing the order >> they are listed in the output of ffprobe or ffmpeg. I don't think this >> materially affects anything. All existing FATE tests pass. >> > > If I am not mistaken, it actually changes it a bit more: The audio data > (if present) is stored before the video data in the file and > mv_read_packet returns the data in the order of the stream numbers. Now Thanks for that info. I hadn't realized that mv_read_packet relied on the order of the stream numbers. > that you have reversed the order in which the streams are created, there > will be seeks; in particular, the file needs to be seekable. > This can be fixed by inverting the order in which packets are read in > mv_read_packet and by also creating the video streams for the > non-version-two files before the audio streams. Actually, I think it can be simpler than that. The framerate is the only piece of metadata for the video stream that is stored before the audio/silent flag. Since that's read into a local variable anyway, I can just hold onto that one value until after creating the audio stream. Then create the video stream in the same order as the original code and minimize the changes. I'll get to work on a v2 of the patch. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".