[FFmpeg-devel] MJPEG format and framerate

Baptiste Coudurier baptiste.coudurier
Sun Jul 5 20:54:37 CEST 2009

On 07/05/2009 03:51 AM, Reimar D?ffinger wrote:
> On Sun, Jul 05, 2009 at 12:21:18PM +0200, Stefano Sabatini wrote:
>> For example it could fail with something like this:
>> stefano at geppetto ~/s/ffmpeg>  ffmpeg -i tmp.avi -y out.mjpeg
>> [...]
>> Input #0, avi, from 'tmp.avi':
>>    Duration: 00:00:03.70, start: 0.000000, bitrate: 304 kb/s
>>      Stream #0.0: Video: h263, yuv420p, 176x144, 10 tbr, 10 tbn, 10 tbc
>> Output #0, mjpeg, to 'out.mjpeg':
>>      Stream #0.0: Video: mjpeg, yuvj420p, 176x144, q=2-31, 200 kb/s, 90k tbn, 10 tbc
>> ...
>> [mjpeg @ 0x9e72920]Only a framerate value of 25 is valid.
>> Or maybe this is just wrong, and the playback application should be
>> able to define which is the assumed framerate to use (so not
>> necessarily 25).
> Yes, the 25 is an arbitrary default chosen by FFmpeg, raw MJPEG does not
> store any timing information nor is there any reason to assume any
> specific one (25 fps is just the default that FFmpeg uses for almost
> everything).
> This is why AVFMT_NOTIMESTAMPS is set for this muxer. You might make
> ffmpeg.c print a warning whenever transcoding into such a format that
> all timing information might be lost or something like that.

Well, only if codec does not have time base in the bitstream.

AVFMT_NOTIMESTAMPS has been introduced a lot after and is used mainly to 
avoid failing because of non monotone timestamps (rawvideo) to be able 
to extract all frames anyway.

Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org

More information about the ffmpeg-devel mailing list