[FFmpeg-devel] [PATCH] fail before printing output format

Baptiste Coudurier baptiste.coudurier
Wed Dec 2 01:54:31 CET 2009


On 12/01/2009 04:49 PM, M?ns Rullg?rd wrote:
> Baptiste Coudurier<baptiste.coudurier at gmail.com>  writes:
>
>> On 12/01/2009 04:38 PM, M?ns Rullg?rd wrote:
>>> Baptiste Coudurier<baptiste.coudurier at gmail.com>   writes:
>>>
>>>> On 12/01/2009 04:31 PM, M?ns Rullg?rd wrote:
>>>>> Baptiste Coudurier<baptiste.coudurier at gmail.com>    writes:
>>>>>
>>>>>> Guys,
>>>>>>
>>>>>> Patch makes ffmpeg print error and fail before printing output format
>>>>>> so the error is the last line printed on terminal, this should greatly
>>>>>> help users who cannot find the error message in between.
>>>>>>
>>>>>> With patch:
>>>>>> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
>>>>>> '[Taka]_Naruto_Shippuuden_134_[480p][BCB62A7B].mp4':
>>>>>>      Duration: 00:23:24.77, start: 0.000000, bitrate: 1213 kb/s
>>>>>>        Stream #0.0(und): Video: h264, yuv420p, 848x480, 1081 kb/s, 119.88
>>>>>> tbr, 360k tbn, 48 tbc
>>>>>>        Stream #0.1(und): Audio: libfaad, 48000 Hz, 2 channels, s16, 128 kb/s
>>>>>>      Metadata
>>>>>>        major_brand     : isom
>>>>>>        minor_version   : 1
>>>>>>        compatible_brands: isom
>>>>>> [mxf @ 0x13e34a0]unsupported video frame rate
>>>>>> Could not write header for output file #0 (incorrect codec parameters ?)
>>>>>
>>>>> With that patch it's impossible to see what the invalid format was.
>>>>
>>>> What do you mean by invalid format ?
>>>
>>> The one that was rejected by the muxer, the one you removed the
>>> printing of.
>>
>> I'd say it doesn't matter because it's the muxer duty to explain why
>> it failed and to provide a clear and descriptive error message.
>
> Well, they don't do that.  Would it be possible to print the output
> format before the muxer error instead?  That way the error message
> would be the last thing printed, and all the information would still
> be there.
>

Well the order must be: open encoder, write header, dump format.
dump_format after write header because write header will update the 
stream timebases and that information is useful.

Or the output format could be printed conditionnally, with verbose > 1 
for example.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list