[FFmpeg-devel] movenc produces improper QuickTime files

Michael Niedermayer michaelni
Wed May 30 02:19:06 CEST 2007


On Wed, May 30, 2007 at 01:38:33AM +0200, Michael Niedermayer wrote:
> > 
> > FFmpeg produces files with a timebase too big (10000000), which easily
> > requires mdhd to move to version 1 and then be QuickTime-incompatible.
> > 
> > [note: mp4creator from mpeg4ip also has this option:
> > 
> >   -use64bitstime          Use for 64 Bit times (not QT player
> > compatible)
> > 
> > which seems again to point to QT not being able to cope with mdhd
> > version 1.]
> > 
> > Now that I exposed the problem, let met try to suggest a possible
> > solution: as I said my patch was incomplete and broken; probably a
> > better patch would have a check that the selected output mode is
> > QuickTime rather than other ISO media format, and then try to reduce
> > the timebase to a value that can fit 32-bit unsigned integers.
> first the timebase DOES fit in 32bit unsigned integers its the
> duration of the movie in timebase units which does not ...
> second a muxer CANNOT CHANGE THE TIMEBASE!!!!!
> not only is it not its job it simply does not work, it will lead to
> wrong timestamps and AV desync
> now if you try to be smart and rescale timestamps you will in some
> case break their strict monotonicity and thus generate completely
> invalid files, you could as well have just left the invalid mdhd ver=1
> there

to elaborate on the problem a little
to change the timebase so that the duration in timebase denominator units
would fit in a 32bit integer you need to know the duration, but the
duration is NOT known before you finished encoding the file (think of
stdin as input)
now changing the timebase after you encoded and muxed the file is a huge
hack which will not work (see flames above)

what can be done though its a huge hack too, is to select some max duration
like 24h and then choose a simpler timebase for quicktime before encoding


i can implement the 24h duration timebase simplification for mov if there
are no objections ...

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070530/9841a8c8/attachment.pgp>

More information about the ffmpeg-devel mailing list