Page 1 of 1

Extract PGS Subtitles for Editing

Posted: Sun Feb 21, 2021 8:06 pm
by Limey
I have a BD movie ("Battle of Britain") which has some stray subtitles on the forced track that I want to delete. I have tried extracting the subtitle track with MKVToolNix, but this generates a .mks file that I cannot open with any editing app I can find for a Mac.

Ideally, I want to keep the original look of the subtitles, so I want to avoid converting to .srt.

Anyone have any Mac-friendly solutions?

TIA.

Re: Extract PGS Subtitles for Editing

Posted: Sun Feb 21, 2021 9:24 pm
by Woodstock
MakeMKV, of course, won't do it on its own.

What have you tried editing the MKS file with? Remember that this is NOT a text file, so tools intended for dealing "just" with SRT and SSA aren't going to do it.

A google search for "pgs subtitle edit mac" comes up with a number of references, for doing just what I suppose you're wanting to do - remove subtitles for "grunts and groans". I've seen a lot of references to "Subler" for "most things subtitle related" on the Mac.

Re: Extract PGS Subtitles for Editing

Posted: Fri Feb 26, 2021 5:55 pm
by Limey
I have Subler, Jubler and BDSup2Sub, but none of them can access the .mks file.

I have searched for an app, but the likely candidates are from Windows only.

Re: Extract PGS Subtitles for Editing

Posted: Fri Feb 26, 2021 6:06 pm
by dcoke22
I've used mkvextract (https://mkvtoolnix.download/doc/mkvextract.html) to get a subtitle track out of blu-ray before. I've used online tools to convert those extracted subtitles to .srt format. That's as far as I've needed to go.

I wonder if you could round trip from the edited .srt back into blu-ray PGS format? This post suggests TsMuxeR could do it: https://forum.videohelp.com/threads/298 ... HD-format)

Re: Extract PGS Subtitles for Editing

Posted: Sun Feb 28, 2021 3:19 pm
by keithhelms
I have a script that converts pgs (bluray) format subtitles to vobsub (dvd). It uses mkvextract to pull the subtitles out

mkvextract -q tracks "$inputmkv" ${tracknbr}:"subtitle${tracknbr}.sup"

and then uses bdsub2sub to convert them

java -jar ~/download/BDSup2Sub512.jar -o "subtitle${tracknbr}.idx" "subtitle${tracknbr}.sup"

Once the subtitles are converted to vobsub format there are 2 files - a text .idx file and a binary file containing the graphic image of the subtitle - .sub.

If I wanted to, I could remove a subtitle by deleting the line to display it from the idx file, such as
timestamp: 00:02:50:285, filepos: 000040000
The binary image of the subtitle is still in the sub file, but it will not be shown.

Finally splice the converted subtitle back into the mkv

/usr/bin/mkvmerge -o '_tmp-$inputmkv' -S '$inputmkv' 'subtitle${tracknbr}.idx'

Note: if you have multiple subtitle tracks, you'd need to extract each of them and then merge them all back in.

At this point the edited subtitle track will be in vobsub format in the mkv file and the offending subtitle will not be shown.

Re: Extract PGS Subtitles for Editing

Posted: Mon Mar 01, 2021 7:18 am
by Chetwood
Sounds like a lot of work. I'd suggest OCRing the sub with Subextractor which usually works pretty well on PGS and then delete the offending items with Subtitle Workshop or something similar.