[MPlayer-dev-eng] PGS subtitles vanish/disappear immediately in m2ts

Nicolas George nicolas.george at normalesup.org
Sat Sep 15 17:43:32 CEST 2012


Comment (by reimar):
>  However I don't really understand why MPlayer happened to work without
>  those changes, it too just uses the packet PTS values directly...

What I observed was that avcodec_decode_subtitle2 and subsequent code were
only called when the video has already reached the proper time. Adding a few
debug, I get this:

A: 611.1 V: 611.1 A-V: -0.004 ct: -0.029   0/  0 62% 18%  1.3% 1 0 
start at 611.106700-631.106700
A: 613.7 V: 613.7 A-V:  0.000 ct: -0.033   0/  0 53% 17%  1.2% 1 0 
clear at 611.170022--9223372036854775808.000000
A: 613.9 V: 613.9 A-V:  0.000 ct: -0.033   0/  0 53% 17%  1.2% 1 0 

As you can see, MPlayer sees the incorrect 611.17 clear time, but at this
point, the subtitle has already been displayed long enough.

My guess to explain the phenomenon is this (please correct me if I am
wrong):

Most applications do their synchronization after decoding: they decode a
packet, determine the timestamp for the resulting decoded frame, and queue
the frame to be displayed at the appropriate time.

MPlayer does its synchronization before decoding, at least for subtitles: it
looks at the packet's PTS and waits that video has reached that point to
decode it.

The PGS "clear" subtitle is made of three packets:

stream_index=2|pts_time=613.714244|dts_time=611.170022|size=14
stream_index=2|pts_time=613.712767|dts_time=611.170022|size=13
stream_index=2|pts_time=611.170022|dts_time=611.170022|size=3

Therefore, MPlayer waits until 613.714 before decoding the first packet,
even though the last packet is already late.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20120915/8f22387a/attachment.asc>


More information about the MPlayer-dev-eng mailing list