[FFmpeg-devel] [PATCH] '-longest' command-line argument realization

Baptiste Coudurier baptiste.coudurier
Fri Feb 6 21:06:55 CET 2009

On 2/6/2009 10:20 AM, Michael Niedermayer wrote:
> On Fri, Feb 06, 2009 at 10:13:51AM -0800, David DeHaven wrote:
>> On Feb 6, 2009, at 10:03 AM, Michael Niedermayer wrote:
>>> On Tue, Feb 03, 2009 at 03:01:58PM +0300, Michael N. Pritula wrote:
>>>> Hello.
>>>> I suggest patch to realize '-longest' key with following semantics:
>>>> All video and audio streams with needed encoding in output file  
>>>> will be
>>>> same time length and this length will be equal to longest stream in  
>>>> output
>>>> file. For every shorter audio stream it will be continued with  
>>>> silence, and
>>>> for every shorter video stream it will be continued with last  
>>>> picture,
>>>> encoded to this stream.
>>>> Waiting for your comments.
>>> for what is it good to lengthen streams to a common point?
>> Some players (<cough>QuickTime</cough>) show white video when audio  
>> runs longer or preceeds video. It's quite annoying, especially in  
>> fullscreen mode. QT's solution is to tell users (and developers) to  
>> trim the file so the tracks are equal length.
>> I can't think of any other arguments...
> either way it should be enough to inject a single audio/video frame
> for each stream with the last timestamp, ffmpeg should generate the
> stuff in between when needed ...

I confirm, if you set last video packet duration correctly, duration
will be correct and quicktime will display it.

Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
checking for life_signs in -lkenny... no
FFmpeg maintainer                                  http://www.ffmpeg.org

More information about the ffmpeg-devel mailing list