[MPlayer-dev-eng] [PATCH] mencoder vobsub out patch

Michael Krasnicki kraz_subscribe at yahoo.com
Tue Sep 6 07:40:36 CEST 2005


Hi,

Attached please find a patch for the vobsub output
code used by mencoder.
Below is the changlog:

1) Added support for "-forcedsubsonly" when creating a
vobsub files. When
the -forcedsubsonly flag is used in conjuction with
the -vobsubout flag, 
the resulting vobsub file will only contain forced
subtitles. If the
-forcedsubsonly is NOT specified, all subtitles are
written into the 
vobsub output file.

2) Added code that caches SPU packet chunks and writes
whole packets to
the vobsub file. I use mkvmerge to store the audio,
video, and subtitles
in a single container. mkvmerge used to give me the
following warnings:

Warning: spu_extract_duration: Encountered broken SPU
packet (next_off < start_off) at timecode
01:58:51.547. This packet might be displayed
incorrectly or not at all.
Warning: spu_extract_duration: Encountered broken SPU
packet (next_off < start_off) at timecode
02:02:33.269. This packet might be displayed
incorrectly or not at all.

When I got these warnings, the subtitles would not
diplay correctly.
This patch eliminates these types of warnings. The
broken subtitles
now work.

3) Changed code for determining the timestamp of the
SPU. I'm not sure
this change is 100% correct. But, for the films that I
have tested, it
works very well. My primary objective was to eliminate
the following
types of warning form mkvmerge:

'<movie>.idx', line 746: The current timestamp
(00:02:02.547) is smaller 
than the last one (00:50:40.465). mkvmerge will sort
the entries 
according to their timestamps. This might result in
the wrong order
for some subtitle entries. If this is the case then
you have to fix 
the .idx file manually.

This incorrect timestamps would cause the subtitles to
appear an 
incorrect points in the movies. Sometimes the
difference between
the expected location of the subtitle and the actual
location was
very large (e.g. 20 min).


I tried to follow the coding style used in vobsub.c
when making
these changes. Also, I tested this patch on ~20 movies
over the 
last two weeks and did not find any problems.  

So, hopefully, you will find this patch useful. Let me
know if you
have any questions.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-vobsub.patch
Type: application/octet-stream
Size: 24386 bytes
Desc: 1408557395-mplayer-vobsub.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050905/1f9c2ca4/attachment.obj>


More information about the MPlayer-dev-eng mailing list