subtitles

Samuel Hocevar sam at zoy.org
Mon Jul 1 02:22:45 CEST 2002


On Sun, Jun 30, 2002, Andrew Flintham wrote:

> I've thus written a "subtitler" module for vlc, which takes a timed subtitle
> script, and in theory, displays the right text at the right time. It renders
> the text as a subpicture using a run-length encoded proportional font; you
> can see an example screenshot at http://cus.org.uk/~amf/subtitler.jpg
> although it's difficult to convey the impression of changing text in a single
> still frame.

   Wow. This looks really, really great.

> a) how should I start the "subtitler" module?

   This is a good question. We have been talking a bit about this with
Christophe, and the global idea was that the stuff in src/input/* would
have to be changed to accept multiple inputs. He is still in vacation
for a whole week so I won't have his opinion right now, but maybe we can
work out something in the meantime.

> When I started writing the subtitler, I thought the best place to begin would
> be to take the existing "spudec" module, as it already used subpictures to
> overlay subtitles on screen (albeit from the DVD, not from text). So my
> "subtitler" module is essentially a decoder module, which waits for a DVD_SPU
> elementary stream to start itself off. Once started, it ignores any data on
> that ES, and uses its own loop to display the subtitles.

   This is indeed the only way to do it right now: force vlc to run
another decoder, and replace its data with what we have to display. Not
very elegant nor reliable, I agree.

> I don't like this approach; it feels like an inelegant hack, but I wasn't
> sure where my "subtitler" module should fit in vlc's architecture. It isn't
> really a video output module, nor is it really a decoder module, and I don't
> know where else to put it.

   Are you using the current CVS? Its architecture is very different
from the 0.4.x releases, so if you are using 0.4.x you may consider
porting your code to the CVS head. This leaves us time for Christophe to
come back and give us precious advice :-)

> b) how should I get the "current time" of the DVD?
> 
> I've been using a similar method as input_OffsetToTime does, working on the
> basis that "i_seconds = i_offset / 50 / p_input->stream.i_mux_rate", but this
> doesn't give me the right times.

   This is because we assume that the DVD's mux rate is constant. To
work around this, changes to the input layer are again needed, since we
do not use the time information provided by the DVD.

> Any suggestions you could give me on this would be most appreciated. If I can
> get this working properly, you're welcome to the code if it's of any interest.

   This is definitely interesting to see. Actually your subtitle
renderer could serve other purposes (like display the current time on
the video window, or the current filename) until the input issues are
solved.

-- 
Sam.

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc-devel mailing list