[Ffmpeg-devel] Re: mpeg samples with first pkt dts -1 and motion estimation weirdness

Michael Niedermayer michaelni
Tue Aug 8 22:12:28 CEST 2006


On Tue, Aug 08, 2006 at 08:28:52PM +0200, Baptiste COUDURIER wrote:
> Hi Michael
> Sorry to bother you with that issue again.

no problem but i post the reply to ffmpeg-dev where it belongs i guess
you wont mind ...

> Here is a sample with first pkt with dts as -1. That is problematic for
> other formats (mov, gxf)

the -1 is not a real bug, you can add some (scaled) constant to all
timestamps to avoid the problem if you like, if you have some other
suggestion on how to solve it dont hesitate to tell me ...
but strictly speaking it is correct, the thing is that if you want
some frame displayed at time= 0 then you must have a dts<0 if you
use b frames

> PubMatrix.mpg
> Now, I also got something interesting for you:
> Here is another sample, of 30secs, if you encode it to mp4 with ffmpeg,
> in mpeg-4 or in h264 you will see that two frames are exactly the same
> around 27 secs no matter what you do, while mpg is fine.
> I upload both mpeg-2 and mpeg-2:
> charcot22_cut.mpg
> charcot22_cut.mp4
> I was wondering if that problem was caused by the motion estimation
> method or something, maybe you know a way to fix that.

yes, its trivial, the input file is totally broken, the timestamps are all
random and invalid, just extract the video
ffmpeg -i charcot22_cut.mpg -vcodec copy -f mpeg2video video.m2v
does not work, the file is too broken (ill try to fix ffmpeg so it can
extract the video) until then please use mplayer -dumpvideo

and after striping the broken layers off the file can be encoded
to mp4 without issues, just try it ...

have we solved the lavf feeds bad timestamps to gxf issue?


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