LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   subtitles to output video (mencoder) (https://www.linuxquestions.org/questions/linux-software-2/subtitles-to-output-video-mencoder-4175608751/)

jr_bob_dobbs 06-27-2017 05:45 PM

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. :D

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.

malekmustaq 06-27-2017 08:40 PM

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.

AwesomeMachine 06-27-2017 10:50 PM

mencoder uses ffmpeg extensively. But mencoder is a interface to a number of codecs. You might need to choose the correct one.

teckk 06-28-2017 09:32 AM

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.

jr_bob_dobbs 07-12-2017 08:29 AM

Quote:

Originally Posted by teckk (Post 5728296)
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.


All times are GMT -5. The time now is 04:39 PM.