[MPlayer-dev-eng] [PATCH] VOBSUB/DVDSUB bytecode handling

Christof Buergi christof at buergi.lugs.ch
Sun Dec 8 21:19:35 CET 2002


Am Donnerstag, 5. Dezember 2002 09.18 schrieb Kim Minh Kaplan:
> Can you extract these subtitles and upload to mphq ? (using
> -vobsubout in mencoder) I have never seen subtitles with different
> timestamps, that's why they are currently handled like that in
> MPlayer.

Sorry. This affects only one of my DVDs, and exactly that one is out of 
my reach at the moment. :-( I will send you a sample, as soon as I get 
it back.

However, it seems that I haven't made myself quite clear. Secont try:

Each subtitle packet contains a data part (the run length encoded 
subtitle) and a bytecode part. The bytecode part has one or more 
bytecode chains. Each chain has a time offset at the begining. This 
offset is calculated to the pts of the packet (there is only one pts, 
as you correctly noted).

Normally you have two chains. The first one has time offset zero, and 
the commands 1 (start subtitle), 3 (set palette), 4 (set alpha), 5 (set 
coords) and 6 (set graphic lines). The time offset of the second one is 
the time, the subtitle should be shown.  There is only one command: 2 
(stop subtitle).

Now, MPlayer handles this as follows: All of the bytecode is handled at 
once. Command 1 and 2 have the effect to set start_pts and end_pts 
respectivly. This works perfect for the mentioned normal case. The 
problem is, that I have a anominal DVD. This one has two chains of 
bytecode as well. Unfortunatly, the second chain hasn't got only the 
command 2, but another command 3 and 4 as well. Those are set so, that 
they turn the subtitle to "all transparent". Since MPlayer deocdes this 
second chain at the beginning of the subtitle, it displays the subtitle 
all transparent. And, honestly, as much as I tried, I couldn't read it 
;-). The patch changes the handling so, that each chain is decoded as 
soon as it's time offset has been reached. This solves the problem 
radically.

PS: Please don't be cross at me to put you before a "fait accompli" by 
sending this patch. It's just that I have seen a problem for me, solved 
it (radically, I'm a bit of a perfectionist ;-), thought, that it might 
be of use for someone else, and, thus, submitted it.

-- 
                     _ ___      http://www.p2501.ch/             / \
|/  /\   /\   /\  | \   |  |    christof at buergi.lugs.ch          \ /
|\ /--\ /  \ /  \ | /_  |  |    Master of unrealistic idealism    x
                                Say NO to HTML in mail and news  / \



More information about the MPlayer-dev-eng mailing list