LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-27-2017, 05:45 PM   #1
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Slackware,Linux From Scratch
Posts: 455
Blog Entries: 70

Rep: Reputation: 84
subtitles to output video (mencoder)


Apologies if this should go in another section.

I've got a DVD of a movie made in Sweden. Have vob-copied it to a directory already.

Naturally, it is in Swedish. There are two audio tracks, one for Swedish (obviously) and one in English. If I use mplayer to play any of the vob files, I can get English subtitles and I can switch to either audio track.

If I use mencoder to transcode the video, I can get it to render subtitles into the video, but not in the same font and colors as mplayer. mplayer shows the font in a decent-looking font, white letters with black outline or shadow, which provides contrast when it is displayed over light areas. mencoder instead renders only an outline, in white. Instead of filling each letter, each letter is transparent. That will work on dark or middle areas but not light. In addition, mencoder uses a different, less readable, font. Consultation with the mencoder manual indicates the parameters needed to change this, in theory. In practice, mencoder quietly ignores the parameters and continues in the clear with white output in the not-so-readable font.

The manual for mencoder discusses extraction of subtitles from vob-files into a separate subtitle file. The unsaid assumption here is that one would make a video with no subtitles, and the player (only mplayer or any other video player?) would somehow know to look for, load, parse and use the separate subtitle file(s).

So if I understand correctly, I have four possible options.

One

Render the video using English audio. Pros: easy to do. The output video would be future-proofed for any video player. Cons: Lip sync will obviously be impossible and it seems that different actors were used to put these voices in. I would prefer to hear the original voices.

Two

Render the video using the original Swedish audio. Use the not-so-good font rendering of mencoder subtitle rendering. Pro: Since the font would be rendered into the video, it would be future proofed for any video player. Voices would be of the original actors. Con: not a great font and also not in good contrast-ensuring colors.

Three

Render the video using Swedish audio. Extract and keep a subtitle file. Use the subtitle file on-the-fly within the player each time the movie is to be watched. cons: Will future video players handle this? Fonts & colors can and will vary per player.

Four

Render with two separate stereo audio tracks, selectable at run time by the video player. Have subtitles be embedded in the output file, as subtitles, not as graphics, similar to how it is done in the original vob files, so that subtitles can be switched on and off by the video player. Pros: totally flexible. No separate subtitle file. This is how I'd really prefer to do it. Cons: unsure if it is possible. Would any video player be able to play the result? Fonts & colors can and will vary per player.

So my questions are:

Of the four methods I have described, which are possible? Which would be best?


p.s.: Would some other conversion & recoding program be better than mencoder? I have others installed but I am more familiar with mencoder.

p.p.s.: Until now, I've never worked with subtitles.

p.p.p.s.: I am doing this in Linux.

p.p.p.p.s: Avi is being used for the output container format, with mpeg4 (aka xvid aka divx) as the video codec and mp3 as the audio codec.
 
Old 06-27-2017, 08:40 PM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,667

Rep: Reputation: 494Reputation: 494Reputation: 494Reputation: 494Reputation: 494
Hi good day.

I remember using ffmpeg for the same purpose. Try recode the file using ffmpeg using switches to manipulate the subtitle characters and its syncyhronization with the frames.

Good luck. Hope that helps.

m.m.
 
Old 06-27-2017, 10:50 PM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
mencoder uses ffmpeg extensively. But mencoder is a interface to a number of codecs. You might need to choose the correct one.
 
Old 06-28-2017, 09:32 AM   #4
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 2,993

Rep: Reputation: 823Reputation: 823Reputation: 823Reputation: 823Reputation: 823Reputation: 823Reputation: 823
IMHO mencoder has been broken for years.

All of the options that you listed are possible.
Use ffmpeg to -map the streams that you want from the input to the output. You can reencode those streams or copy them. You can overlay subs onto the output video or save them to a separate file. You -map the sub stream that you want just like the audio stream that you want.

Quote:
Have vob-copied it to a directory already.
Then you have all of it already in a file. Are you wanting to reencode it to make it smaller? A .vob is mpeg2 video.

Quote:
Avi is being used for the output container format, with mpeg4 (aka xvid aka divx) as the video codec and mp3 as the audio codec.
x264 will give you better results with smaller size. The audio stream of a DVD is ac3. Unless it's a huge bitrate there is no reason to reencode it.

To see what streams are in the .vob
Code:
ffmpeg -probesize 1000000000 -analyzeduration 100000000 -i movie.vob
If you want more then ask specific questions.
 
Old 07-12-2017, 08:29 AM   #5
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Slackware,Linux From Scratch
Posts: 455

Original Poster
Blog Entries: 70

Rep: Reputation: 84
Quote:
Originally Posted by teckk View Post
IMHO mencoder has been broken for years.
I've heard others say the same. I will be looking into ffmpeg (fortunately that is already installed )


Quote:
Then you have all of it already in a file. Are you wanting to reencode it to make it smaller?
To make it smaller and to have a convenient file in a directory without having to lug in teh dvdreader every time i want to watch it.
Quote:
A .vob is mpeg2 video.
I realize that. Been ripping DVDs for years. Have the process more or less automated at this point. What makes this situation different is the fact that I actually need to deal with subtitles. That is new.

Quote:
x264 will give you better results with smaller size.
I've heard this also, but I've done experiments that say otherwise. For large resolutions, x264 does better, for the smaller res (720x480) of DVDs, the mpeg4 codec (aka divx aka xvid) gets a better appearance and less CPU use on playback.

Quote:
The audio stream of a DVD is ac3. Unless it's a huge bitrate there is no reason to reencode it.
The audio is always extracted as a seperate .wav so that I can mix from 5:1 to stereo (with settings to make the speech a little bit louder compared to all of the background noise) and apply level compression before remuxing.

Since mencoder is not going to work for this task, I will need to try other software. So this thread is closed. Thank you, everyone, for the replies.

Last edited by jr_bob_dobbs; 07-12-2017 at 08:31 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mencoder, merge subtitles to 3gp video for mobile phone ozegoods Linux - Software 5 05-06-2009 12:45 PM
[mencoder] subtitles size Hyakutake Linux - Software 1 05-01-2007 05:05 PM
mencoder and subtitles help ZeroKun Linux - Software 0 07-19-2005 10:36 AM
mencoder, dvd subtitles J_Szucs Linux - Software 0 04-07-2004 05:24 AM
Subtitles in Mencoder gwroy20 Linux - Software 2 05-15-2003 04:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration