Page 1 of 2

Subtitles off centered

Posted: Sat Mar 09, 2024 11:45 pm
by RAHRL
I use MakeMKV to rip both dvd’s and blurays with only minor issues and complaints.

But sometimes, I need to do some post-processing on ripped video files. In the case of bluray discs, the mkv files are generally rather large (around 20 GB) and they would quickly fill up my hard disks if I would leave them like that.

So I compress them with Handbrake into smaller mkv files using RF = 18. This typically reduces the filesize with a factor of 3-4 with only minor loss in quality.

I already did this for a few blurays, which went well including the subtitles, and I recently tried the same with a Peter Falk bluray comprising 4 movies. These movies have English subtitle tracks (PGS) which I would like to keep.

Unfortunately, the subtitles in the resulting mkv files are off centered (horizontally misaligned), but not in a consistent way. Some are shifted to the left, some to the right and some are correctly centered. The vertical offset is mostly correct.

Anybody a suggestion how to solve this?

Re: Subtitles off centered

Posted: Sun Mar 10, 2024 12:41 am
by Radiocomms237
The very first thing I would suggest is to check whether they are like that in the source files (IE. watch the disc)?

If not, and Handbrake has done something to screw up the positioning, you can either:
  • figure out what setting within HB caused this, correct it, and re-encode again; or
  • extract the subs from the source files and mux them into the end-result using MKVToolNix, effectively bypassing whatever HB did.
Or in either case, you could extract the subs from the end result and modify the position of each image using SubtitleEdit, and then mux them back in.

Re: Subtitles off centered

Posted: Sun Mar 10, 2024 12:44 am
by Woodstock
Some titles off-set the subtitles to the direction their audio would come from. I.e., if the speaker is left of center, the subtitle will be offset to the left, same with right and center. I have a couple of GKids disks like this. But, select a different subtitle track, and they're all centered.

Could this be what you're seeing? Handbrake will align subtitles with how they're displayed on the picture... if you're not changing the resolution of the video at the same time you're encoding it.

Re: Subtitles off centered

Posted: Sun Mar 10, 2024 12:06 pm
by RAHRL
Radiocomms237 wrote:
Sun Mar 10, 2024 12:41 am
The very first thing I would suggest is to check whether they are like that in the source files (IE. watch the disc)?
I checked (I should have done that in the first place, foolish of me), and they are like that in the original ripped file as well. So it seems not to be a Handbrake problem
Radiocomms237 wrote:
Sun Mar 10, 2024 12:41 am
Or in either case, you could extract the subs from the end result and modify the position of each image using SubtitleEdit, and then mux them back in.
I will give this a try. I.e. use SubtitleEdit to do the OCR on the subtitle and generate a SRT file. Then use that SRT in the Handbrake compression as an external subtitle file.
I never modified the position of the subtitles in an SRT file beore, to be honest I didn't even know it was actually in there.

Thx.

Re: Subtitles off centered

Posted: Sun Mar 10, 2024 12:23 pm
by RAHRL
Woodstock wrote:
Sun Mar 10, 2024 12:44 am
Some titles off-set the subtitles to the direction their audio would come from. I.e., if the speaker is left of center, the subtitle will be offset to the left, same with right and center. I have a couple of GKids disks like this. But, select a different subtitle track, and they're all centered.
Your suggestion got me thinking and you might be right. As the subtitles are like that in the orginally ripped file, it could have been done on purpose. Generally they seem to follow the person speaking (i.e. they follow the audio). So if the actor is on the left side (and the audio is probably on the left speaker), subtitles are to the left, and so on. Incidentally, the subtitles are moved to the top, no idea why they did that.

I have tried a few audio audio settings (other audio track, switching to mono) but to no avail.
To be honest, I don't understand what they were thinking when they did this. The subtitles are jumping all over the place, it's very wearing to follow them. What a bad idea to do that!

Unfortunately, there is just one subtitle track, I can only switch it on or off. No other options.
Woodstock wrote:
Sun Mar 10, 2024 12:44 am
Could this be what you're seeing? Handbrake will align subtitles with how they're displayed on the picture... if you're not changing the resolution of the video at the same time you're encoding it.
Could very well be, I did not change the resolution of the video.

Re: Subtitles off centered

Posted: Mon Mar 11, 2024 2:23 am
by Radiocomms237
RAHRL wrote:
Sun Mar 10, 2024 12:06 pm
I will give this a try. I.e. use SubtitleEdit to do the OCR on the subtitle and generate a SRT file. Then use that SRT in the Handbrake compression as an external subtitle file.
I never modified the position of the subtitles in an SRT file beore, to be honest I didn't even know it was actually in there.

Thx.
You don't need to go through the OCR process. Simply open SubtitleEdit and use:

"File > Import > Blu-ray (.sup) subtitle file for edit..."

Then edit the position of any affected lines directly.

Image

Re: Subtitles off centered

Posted: Tue Mar 12, 2024 10:23 pm
by RAHRL
Deleted as no longer relevant.

Re: Subtitles off centered

Posted: Wed Mar 13, 2024 12:05 am
by Radiocomms237
Sorry, I should have explained that you need to extract the subtitle track(s) from the .mkv file first.

There are many options for extracting tracks from .mkv files. You can use MKVToolNix with the MKVEXtractGUI-2 add-on, plus there are many stand-alone programs that will do it, as well as most video editing suites.

I use Inviska MKVExtract (no longer supported but I believe you can download it here).

Once open, simply drag 'n drop the .mkv file into the program, check the tracks you want, and click "Begin". It will then extract the selected tracks into the same folder as the source file.

Once you have the subtitle track you need, import it into SubtitleEdit as above and you will be able to adjust the position of the individual images.

You can modify each and every line individually, or you can change the entire file at once using "Tools > Alignment..." from the menu.

Once you're happy, remember to "File > Save as..." (I recommend saving under a different file name so you still have an unmodified copy).

Then use MKVToolNix to mux the modified subtitle back into the .mkv file (you can remove the original subs or leave them there so users can choose).

Re: Subtitles off centered

Posted: Wed Mar 13, 2024 10:18 pm
by RAHRL
Deleted content as no longer relevant.

Re: Subtitles off centered

Posted: Thu Mar 14, 2024 2:49 pm
by RAHRL
Deleted content as no longer relevant.

Re: Subtitles off centered

Posted: Thu Mar 14, 2024 4:32 pm
by RAHRL
Deleted as no longer relevant.

Re: Subtitles off centered

Posted: Thu Mar 14, 2024 4:55 pm
by RAHRL
Deleted content as no longer relevant.

Re: Subtitles off centered

Posted: Thu Mar 14, 2024 6:43 pm
by RAHRL
Deleted as no longer relevant.

Re: Subtitles off centered

Posted: Thu Mar 14, 2024 9:40 pm
by RAHRL
Problem solved!

Deleted content as no longer relevant.

I still have a question about a warning "track ID does not exist" when muxing the a new subtitle track in with mkvmerge from a .sup file.

Re: Subtitles off centered

Posted: Sat Mar 16, 2024 12:24 am
by Radiocomms237
Glad you got it sorted out. I use the GUI of all these programs, so command line stuff is beyond me (seems like ten times as much work if you ask me).

The "track ID" error is nothing really, you will get that almost every time you add a track into an .mkv file.

Every track within an MKV container (including video, audio and subs) is assigned a "track ID", and if you introduce a track from another source it will likely have a track ID identical to one already present, or no track ID at all. Both scenarios will generate an error and in both cases MKVToolNix will automatically reassign a new track ID anyway.