[MPlayer-users] why do subtitles disappear when using -vo png ? [dup?]

Matthias Lang matthias at fastmail.fm
Mon Nov 16 07:15:46 CET 2009


Hi,

this is a mostly complete answer to my own question. Last week, I wrote:

> mplayer displays subtitles from a .srt file just fine when I watch a
> film, however when I use the 'png' output, the subtitles disappear.

> Is that expected? (why?)

Short answer: It's expected. The 'png' and 'jpeg' output drivers
              specifically disable (don't implement) on-screen-display
              (osd).

Long answer: In the source tree, there's a directory of '-vo'
             drivers, libvo/. Each driver has a function called
             'draw_osd()'.

             In some drivers, such as vo_x11.c and vo_svga.c, the
             function has a non-empty body which draws the subtitles.
             Viewing the video with -vo x11 lets me see subtitles.
             Hacking vo_x11.c to remove the draw_osd() body makes the
             subtitles disappear. Enough evidence for my purposes.

             In other drivers, such as vo_png.c and vo_jpeg.c, the
             function is empty. So it looks like they were never
             intended to show subtitles. Slightly unexpected design
             decision, but it looks deliberate.

             If this is documented somewhere, then I missed it.
             Section 8 ("Video output devices") of the manual doesn't
             mention the png video output device at all.

> (Originally, I was trying to 'burn' subtitles into the video stream,
> using
>
>   mencoder -sub subtitle.srt -o with_subtitles.avi -oac copy -ovc lavc film.avi

Retrospectively, I realise it's not clear from my first post that the
above mencoder command line actually produces the intended
results. For the record: it doesn't work on older versions of
mencoder, such as 1.0rc2-4.2.4, but it does work on, e.g., MEncoder
SVN-r29857-4.3.4.

Matt


More information about the MPlayer-users mailing list