Subtitles off centered

Please post here for issues related to Blu-ray discs
RAHRL
Posts: 64
Joined: Tue Dec 05, 2023 6:44 pm

Re: Subtitles off centered

Post by RAHRL »

Thx for all your help and advice!

I will post a small summary and delete the previous posts. Perhaps it will help some other novice one day :)
RAHRL
Posts: 64
Joined: Tue Dec 05, 2023 6:44 pm

Re: Subtitles off centered

Post by RAHRL »

SUMMARY: How to center horizontally off-centered subtitles.

Step 1: Use SubtitleEdit to import the subtitle from the .mkv (without the ocr) and center it.
1. In subtitleEdit, select File, choose Import and "Blue ray (.sup) subtitle file for edit" (6th option).
By default it will look for .sup files but it can be changed to .mkv. Then select the .mkv with the subtitle off-centered and click on Open. This will import the subtitles as images, without doing the ocr.
2. Then, in the dialog menu, click on one of the subtitle lines and do select all (ctrl-a), right click mouse, select "Center selected lines (horizontally, keep the vertical position)" (3rd option).
3. In the same dialog menu, create the .sup file by selecting "Save as" from the File menu. Enter a filename and click on Save. That .sub file will contain the centered subtitles, including the images.

Step 2 (optional). Delete the orginal (off-centered) subtitle from the .mkv file.
1. Find the ID numbers of the subtitle tracks that you want te delete:

mkvmerge -i file1.mkv

2. Suppose the .mkv has 3 subtitle tracks with ID's = 3,4,5. (ID = 0 is for the video itself, ID's 1 and 2 are for audio) and you decide to delete the subtitle track with ID = 4.

mkvmerge -o file2.mkv --subtitle-tracks 3,5 file1.mkv

or, if you decide to delete all subtitle tracks:

mkvmerge -o file2.mkv --no-subtitles file1.mkv

Step 3. Add the newly created .sup file as a new aubtitle track to the .mkv file.

mkvmerge -o file3.mkv --track-name 0:Centered --language 0:en subtitles.sup file2.mkv

I still haven't completely figured out how the track-id (TID), in this case 0, works.
Generally, the .sup file with TID=0 will be added as a new track before the existing subtitle tracks.
In the case of a non-existing large TID, the subtitle will be added after the existing tracks.
In some cases the track-name becomes visible in VLC, in other cases it defaults to track-x, where x is the track-number.

===

Tip 1: List all tracks of an .mkv file (this will also show the subtitle track being present/absent) in the .mkv file

mkvmerge -i file.mkv

Tip 2: How to add MKVToolNix permanently to your search path In Windows 10 when working with the command prompt.
(Installation of MKVToolNix should do that, but does not for some reason not known to me,)

Step 1: Open the Control Panel.
Step 2: Click System
Step 3: Click Info
Step 4: Click Advanced system settings.
Step 5: In the System Properties dialog box, click the Environment Variables button.
Step 6: In the Environment Variables dialog box, under System variables, select the Path variable and click Edit.
Step 7: Add the line C:\Program Files\MKVToolNix
and ok/save everything.

Tip 3: A few more small tips regarding working with the command prompt:

- When working on the command prompt use " (double quotes) to enclose directory- and filenames that contain a space.
- it is possible to copy/paste text using the mouse, both within the command prompt window, as from an other window, thus avoiding typing tedious filenames /commands over and over again.
- a history of previous commands can be recalled by pressing the UP key.
- ctrl-c will give you a fresh, empty command line without executing the current command line.

Good luck!
Post Reply