KDE- adding english subtitles - avi to mp4

I have “The Witcher” bonus videos, in another language. I can use VLC-gtk to play them with English subtitles.

I have Avidemux-gtk and Handbrake-gtk. Using VLC-gtk, I know the basics of conversion from AVI to MP4 and ogg to mp3 - 192k bitrate.

I can do some basic ffmpeg command line conversions.

Video AVI format: H.265 + MP3 128kbs 2 channels 44100khz

Subtitles: .sub and .idx

In VLC-gtk convert, I can add subtitles, but it’s in all languages all one on top of the other. I need to overlay only English subtitles - convert avi to mp4 with English subtitles.

According web sources, ffmpeg can add subtitles, but only in .srt format. There are other examples using different commands, such as mplayer and mencoder.

Which command should I use? Format? Help…

You say you already have Handbrake installed.
That’d probably the easiest way to re-encode with your captions file. I know Handbrake supports SRT, IIRC likely supports other formats as well. Changing the container format isn’t required.

TSU

OK, how do I convert sub or idx to srt format? Handbrake documentation: HandBrake Documentation — Welcome

It mentions “add subtitles” features, but not how to convert subtitles. Link?

I went into vlc-gtk preferences and set the language, but the “bottom position” overlaps some text already enbedded. I need more control over the position.

I can still try to convert the subtitles to get more control over position.

Can use the command line vlc to adjust the position of subtitles?

You could always try an online converter. e.g. Convert Sub/Idx Subtitles to Srt: online format converter

do you even need to convert the video?
You could just use a tool like mkvtoolnix and remux the video (into a modern mkv container) with the subtitles added. Then you can just turn the subtitles on and off as needed.

First thing I’d do is run a test on the files you already have.
I only know that srt is supported and works, but IIRC Handbrake is fuzzy about if any other format will work.

Edit…
It seems that Handbrake supports SRT and SSA plus some other formats that are likely integrated into a commercial codec.
https://handbrake.fr/docs/en/latest/advanced/subtitles.html

TSU

I have an old blueray player with usb port that can play mp4 files. So, I need to convert from avi to mp4. Using various methods, I’ve converted many files.

if you do need to convert them, the easiest way (imo) is still to mux the mp4 file, together with the subtitle into an mkv container using mkvtoolnix
It’s simply a matter of dragging your video file and subtitle file(s) into mkvtoolnix then muxing together. Takes about 10 seconds for your average length movie.
the problem with hard coding them is that you wont be able to change the font size or even turn them off after they have been coded in.

Go online and download an .srt file with the English subtitles. Change the name of the file so it matches the name of the video file and place it in the same directory. Then play. Set the video player to use the .srt file.

I have mkvtoolnix. It is working!

I need to be able to change the position and size of the font. I’ll try the online subtitle converter.

I tried it. The waiting list started at 150+ I’ll have to skip this. I need a real time utility.

http://members.upcweb.hu//balla.gyorgy/balla-it/html/articles/20081230-converting_vobsub_subtitles_to_subrip_format_under_linux.html

This is method that will work! But, it’s slow image to letter (by hand OCR) that increases in speed as it learns new images. You use avidemux-gtk:

Use the default calibration. I’m going to try that feature later.

Select the IDX file.

Select output srt file.

As the images appear, enter the correct letter or letters. Then click ok. As you enter more image letters, the process will go faster.

NOTE: Save the glyph file! If it asks for more, resave the file.

I was able to use vlc to set the subtitle file to either idx/sub and srt. Now, I need to compare idx/sub to srt playing on VLC media player.

usually the font size (in a non hard coded sub) would be controlled by whatever tool you are using for playback. i.e. the font size for subtitles in VLC should be changed in VLC

VLC can play srt files, but it’s not converted to mp4 with subtitles for the USB video player.

The OCR sub/idx to srt file leaves errors that need correction. I have to fix them first.

Use avidemux to create the srt file. Then correct the text errors by comparing videos.

Use mkvtoolnix to mix the streams into one mkv file. Then convert mkv to mp4.

Can I use mkvtoolnix to set the font size and position using a srt subtitle file?

VLC can play srt files, but it’s not converted to mp4 with subtitles for the USB video player.

I’m not following here . . .
what do you mean convert to mp4?
What is “USB video player”?
Is this usb player unable to play matroska files? Does it not have a subtitle font setting?

Use mkvtoolnix to mix the streams into one mkv file. Then convert mkv to mp4.

I’m not sure I’m understanding what you are doing here . . .
.mkv and .mp4 are just containers. You shouldn’t need to “convert” anything to put something into one of these containers just to support subtitles

Can I use mkvtoolnix to set the font size and position using a srt subtitle file?

subrip subtitles (.srt) are just plain text files that contain timing information. You cannot set font or font size in an .srt subtitle - this is controlled by the player
mkvtoolnix is a muxing tool that places video, audio and other files such as subtitles into a matroska (.mkv) container. It cannot be used to alter the subtitle in any way other than setting the character coding / language setting information

I did an srt conversion (needs more text correction). I played it and used the srt file. I can’t find any function adjusting font size. ??

delete message

I have an blueray player with a usb port that can play mp4 files, but can’t read subtitle files.

The “Witcher 1” file are formatted: .avi .idx .sub

avidemux: idx-sub –> srt (After, manually correct OCR errors)

mkvtool nix: idx/sub/avi –> mkv

ffmpeg: mkv –> mp4

mkvtoolnix is a muxing tool that places video, audio and other files such as subtitles into a matroska (.mkv) container. It cannot be used to alter the subtitle in any way other than setting the character coding / language setting information

So, mkvtool nix can’t adjust font size and position?

as mentioned previously, .srt sbtitles are a plain text file. They contain no information on font size or screen position.
It would seem that .srt is not the ideal format for you.

you would be better off downloading something like aegisub or gnome subtitles (both in the oss repo) and converting to a format like .ass that allows you to specify font size and screen position