[mythtv-users] Saving subtitle when ripping DVD

Joseph A. Caputo jcaputo1 at comcast.net
Wed Jan 7 09:23:06 EST 2004


On Wednesday 07 January 2004 01:59, thor wrote:
> On Wednesday 07 January 2004 01:46, argus wrote:
> > I'm unclear on the expected outcome of the DVD ripping with
> > subtitle process in MythTV. Will it be:
>
> 	If you are ripping as "perfect" (VOB file), then all the subtitles
> are (should?) be in there, but you need to set your player command to
> show them.
>
> 	If you are transcoding, then the subtitles are actually written onto
> the video frames of the output file.

This is something I've been meaning to take a look at, but I wanted to 
wait until the new media server architecture had stabilized first (I 
assume this involves mythdvd/mtd in some way, yes?) Basically, I think 
it would make more sense to rip the subtitles to a vobsub file rather 
than rendering them on the encoded movie.  This is what I do with my 
rips, when I rip with dvd::rip.  Of course, you could have a selectable 
option (render/don't render subtitles).  dvd::rip uses tcextract to rip 
the subtitles out of the VOB file and into a set of .ifo, .idx & .sub 
files; I think mencoder may also do it.

I have a Perl script (mythmplayer) that I wrote to handle subtitles.  It 
works like this:

- movie files are in /mnt/mmedia/Movies
- subtitle files are in /mnt/mmedia/Movies.subtitles/<movie name>.
{idx,ifo,sub}
- dimensions of the movie are calculated, and the output is scaled to 
fill the screen horizontally.  If after scaling the movie does not fill 
the screen vertically, the movie is offset closer to the top of the 
screen (why in a moment...)
- if subtitles for the movie exist, they're displayed near the bottom of 
the screen (so for 16:9 movies on a 4:3 screen, the subtitles should be 
in the bottom black band)

I wrote this script because the default behavior for mplayer is to place 
the subtitles at the bottom of the movie frame.  This meant that for 
16:9 movies, the subtitles overlayed the picture, while the black bands 
were empty.

It also has a bookmarking function for mplayer.  It uses mplayer's 
editlist functionality; when you press 'I' in mplayer, it writes a 
bookmark to a file (currently /mnt/mmedia/Movies.bookmarks/
<moviename>.edl).  When the movie is launched, if the file is present 
mplayer will skip to the bookmark.

It's a rather crude script (I'm a C++ programmer, but haven't really 
taken the time to learn Perl very well), and is currently slightly 
broken.  I submitted it to the list once ages ago; if I get a chance to 
clean it up this week I'll submit it again, if anyone thinks it would 
be useful (or would like to fix/polish it).

Of course, what would be really cool would be to eliminate the need for 
mplayer (or xine, or ogle) for anything other than DVD playback.  Thor, 
I know you know this, but for the benefit of others... the internal 
Myth player *will* play any content supported by the underlying 
libraries (ffmpeg, libavcodec, libavformat, whatever), but things like 
seeking & scaling are not handled quite right without data from the 
Myth database (seek table, resolution info, etc).  Try playing a movie 
with the command 'mythtv <filename>' and see what you get.

-JAC



More information about the mythtv-users mailing list