[Ffmpeg-devel] [Ffmpeg-user] restricting mdhd version to 0

Baptiste Coudurier baptiste.coudurier
Fri Apr 27 14:32:46 CEST 2007


Ctk wrote:
> Hi,
> 
> On 4/27/07, Baptiste Coudurier <baptiste.coudurier at smartjog.com> wrote:
>> Hi
>>
>> Ctk wrote:
>>> The only difference I've found between encoded videos which work and
>>> those that don't have an mdhd version of 1.
>>>
>>> mp4dump file_not_recognized.MP4 | grep -B2 version | grep -A1 -B1 mdhd
>>>    type mdia
>>>     type mdhd
>>>      version = 1 (0x01)
>> You cannot force it, code will use mdhd version 1 only if track duration
>> does not fit into 32 bit. If that is the case it will use mdhd version
>> 1, which conforms to the standard.
>>
>> Can you supply ffmpeg output with latest svn please ?
>>
> 
> I am still struggling with the svn version (aac support doesn't work
> yet) so I haven't managed to encode the videos I'm struggling with but
> I found what may be causing the problems.
> 
> This is the output for a video not working:
> 
> FFmpeg version SVN-r8849, Copyright (c) 2000-2007 Fabrice Bellard, et al.
>   configuration: --enable-xvid --enable-x264 --enable-gpl --enable-pp
> --disable-strip --prefix=/home/mserrano/ffmpeg --enable-libfaad
> --enable-libfaac
>   libavutil version: 49.4.0
>   libavcodec version: 51.40.4
>   libavformat version: 51.12.1
>   built on Apr 27 2007 12:13:28, gcc: 4.1.2 (Gentoo 4.1.2)
> 
> Seems stream 0 codec frame rate differs from container frame rate:
> 23.98 (65535/2733) -> 23.98 (23976024/1000000)
> Input #0, avi, from 'test.avi':
>   Duration: 00:19:49.8, start: 0.000000, bitrate: 1234 kb/s
>   Stream #0.0: Video: mpeg4, yuv420p, 512x384, 23.98 fps(r)
>   Stream #0.1: Audio: mp3, 48000 Hz, stereo, 128 kb/s
> Unknown codec 'aac'
> 
> The interesting line is:
> Seems stream 0 codec frame rate differs from container frame rate:
> 23.98 (65535/2733) -> 23.98 (23976024/1000000)
> 
> Out of 8 files (all 20 minutes long), all those (2) that have given an
> mdhd version of 1 had this exact line. Those (6) that have given an
> mdhd version of 0 has this line:
> Seems stream 0 codec frame rate differs from container frame rate:
> 23.98 (65535/2733) -> 23.98 (24000/1001)
> 
> I am guessing that when the frame rate difference gives a "simple"
> fraction, I get an mdhd version of 0 but if the fraction is
> "complicated", then I get an mdhd version of 1. Could this be the
> case? If that is the case, is it possible to fix the input file to
> avoid the version 1 mdhd?

Yes this the case, and that is why mdhd will use version 1, timescale
is high and duration will not fit in 32bit.

You can manually override output frame rate with -r <framerate> and it
should be ok.

Switching thread to ffmpeg-devel since it is a recurrent issue
(r_frame_rate problem).

Can you still share your file, so that someone interested to work on
r_frame_rate would have access to a problematic file ?

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312




More information about the ffmpeg-devel mailing list