Subtitles off centered

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

Subtitles off centered

Post 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?
Radiocomms237
Posts: 371
Joined: Mon Oct 18, 2021 12:23 am

Re: Subtitles off centered

Post 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.
Woodstock
Posts: 9951
Joined: Sun Jul 24, 2011 11:21 pm

Re: Subtitles off centered

Post 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.
MakeMKV Frequently Asked Questions
How to aid in finding the answer to your problem: Activating Debug Logging
RAHRL
Posts: 64
Joined: Tue Dec 05, 2023 6:44 pm

Re: Subtitles off centered

Post 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.
RAHRL
Posts: 64
Joined: Tue Dec 05, 2023 6:44 pm

Re: Subtitles off centered

Post 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.
Last edited by RAHRL on Tue Mar 12, 2024 7:29 pm, edited 1 time in total.
Radiocomms237
Posts: 371
Joined: Mon Oct 18, 2021 12:23 am

Re: Subtitles off centered

Post 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
RAHRL
Posts: 64
Joined: Tue Dec 05, 2023 6:44 pm

Re: Subtitles off centered

Post by RAHRL »

Deleted as no longer relevant.
Last edited by RAHRL on Sat Mar 16, 2024 6:22 pm, edited 3 times in total.
Radiocomms237
Posts: 371
Joined: Mon Oct 18, 2021 12:23 am

Re: Subtitles off centered

Post 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).
RAHRL
Posts: 64
Joined: Tue Dec 05, 2023 6:44 pm

Re: Subtitles off centered

Post by RAHRL »

Deleted content as no longer relevant.
Last edited by RAHRL on Sat Mar 16, 2024 6:30 pm, edited 2 times in total.
RAHRL
Posts: 64
Joined: Tue Dec 05, 2023 6:44 pm

Re: Subtitles off centered

Post by RAHRL »

Deleted content as no longer relevant.
Last edited by RAHRL on Sat Mar 16, 2024 6:30 pm, edited 3 times in total.
RAHRL
Posts: 64
Joined: Tue Dec 05, 2023 6:44 pm

Re: Subtitles off centered

Post by RAHRL »

Deleted as no longer relevant.
Last edited by RAHRL on Sat Mar 16, 2024 6:29 pm, edited 2 times in total.
RAHRL
Posts: 64
Joined: Tue Dec 05, 2023 6:44 pm

Re: Subtitles off centered

Post by RAHRL »

Deleted content as no longer relevant.
Last edited by RAHRL on Sat Mar 16, 2024 6:30 pm, edited 3 times in total.
RAHRL
Posts: 64
Joined: Tue Dec 05, 2023 6:44 pm

Re: Subtitles off centered

Post by RAHRL »

Deleted as no longer relevant.
Last edited by RAHRL on Sat Mar 16, 2024 6:29 pm, edited 2 times in total.
RAHRL
Posts: 64
Joined: Tue Dec 05, 2023 6:44 pm

Re: Subtitles off centered

Post 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.
Last edited by RAHRL on Sat Mar 16, 2024 6:29 pm, edited 1 time in total.
Radiocomms237
Posts: 371
Joined: Mon Oct 18, 2021 12:23 am

Re: Subtitles off centered

Post 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.
Post Reply