[MPlayer-dev-eng] libmpeg2 and lavc don't agree on PTS values

Trent Piepho xyzzy at speakeasy.org
Sun Nov 26 21:40:17 CET 2006


I've spent hours trying to get a 2-pass filter working correctly until I
finally figured out it's not my fault.  It's either lavc's fault or
libmpeg2's fault!

This is the first few frames of an ATSC ts stream as decoded with -vc
mpeg12, listing pts value, frame type, and mean qscale value:

85354.2812 B 3.976389     # -2
85354.3047 B 4.143333     # -1
85354.3203 I 2.543056	  # 0
85354.3359 B 4.448056     # 1
85354.3516 B 4.578333     # 2
85354.3672 P 3.290556     # 3

This is the same file with -vc ffmpeg2:
85354.3047 I 2.543056     # 0
85354.3203 B 4.448056     # 1
85354.3359 B 4.578333     # 2
85354.3516 P 3.290556     # 3
85354.3672 B 4.040556     # 4

You see the frame type and mean qscale match exactly, but the pts values
have been shifted down by one.

If you look at frame #0, the I frame, the qscale is the same for both
decoders (and visually, the same frame is displayed), but ffmpeg2 has the
pts value that libmpeg2 has given to frame -1.  It's the same for the whole
file.  For any frame mpeg12 will assign it the pts value that ffmpeg2
assigned to the following frame.  Or you could say ffmpeg2 assigns a frame
the pts value that that mpeg12 has given to the previous frame.

So... which one is right?  And which one has audio sync off by one frame?



More information about the MPlayer-dev-eng mailing list