[FFmpeg-devel] Bugreport: mpegts-demuxer gives wrong pts/dts with avchd files

Thorsten Jordan tjordan
Thu Feb 14 11:19:50 CET 2008

Thorsten Jordan schrieb:
> M?ns Rullg?rd schrieb:
>> Thorsten Jordan <tjordan at macrosystem.de> writes:
>>> Hello,
>>> i just stumbled over misbehvaiour of the mpegts-demuxer of ffmpeg. I
>> [...]
>>> Who maintains the mpegts demuxer?
>> That would be me.  Please upload a sample to mphq.
> another idea: maybe the h264-parser splits the elementary stream in
> fields (each field has own AUD) and the mpegts demuxer just associates
> the timestamps wrongly, giving per-frame stamps to fields?

ok here is some more information.
I enabled FF_DEBUG_PTS for that stream.

Here is a shortened log of the output, i left out the thousands of
av_read_packet lines with pts=dts=invalid

line  text
3     av_read_packet stream=0, pts=54171, dts=43371, size=165
1015  av_read_frame_internal stream=0, pts=54171, dts=43371, size=186221
1238  av_read_packet stream=0, pts=46971, dts=<INVALID>, size=170
1239  av_read_frame_internal stream=0, pts=46971, dts=46971, size=40974

It is obvious that after the end of the first field, at position 186221,
a frame is handled as done, and the pts 54171 is associated.
The bottom field of that frame, size 40974, gets the next pts, which is
wrong, because that pts=46971 is for the top field of the second frame
following right afterwards.
I don't know the utils.c code well enough ...

Greetings, Thorsten

More information about the ffmpeg-devel mailing list