[Ffmpeg-devel] [PATCH] mov muxer vfr

Michael Niedermayer michaelni
Tue Jul 4 22:45:14 CEST 2006


On Tue, Jul 04, 2006 at 06:20:46PM +0200, Baptiste Coudurier wrote:
> Hi
> Here is a patch that make mov muxer being able to create vfr streams.
> Packet duration is computed from dts difference.
> I think it is a bit ugly so if anyone see a cleaner way to do it..

hmm no its not so bad, stts stores the dts if iam not misstaken not the 
real durations so AVPacket.duration wouldnt help as its relative to the pts 

that also means that the track duration is maybe calculated slightly wrong
correct is the duration = the largest pts (this may or may not be the last
packet) - the lowest pts (this is likely but not neccesarily the first packet)
 + the duration of the packet with the largest pts
that should of course be equal to the sum of the durations of all packets
if the durations are known
but i dont know if this is what QT expects so maybe the last dts - first
is less troubblesome for mov ...

furthermore it would be nice if the duration calculation would be done in
lavf and not in an individual muxer, so that after all packets have been 
passed into av_*write_frame() the AVStream.duration is based on their
timestamps instead of some loosy guess

and why are some specific audio codecs handled differently? is this needed?


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is

More information about the ffmpeg-devel mailing list