Extract PGS Subtitles for Editing

MKV playback, recompression, remuxing, codec packs, players, howtos, etc.
Post Reply
Limey
Posts: 4
Joined: Mon Feb 13, 2012 4:47 pm

Extract PGS Subtitles for Editing

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

Re: Extract PGS Subtitles for Editing

Post 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.
Limey
Posts: 4
Joined: Mon Feb 13, 2012 4:47 pm

Re: Extract PGS Subtitles for Editing

Post 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.
dcoke22
Posts: 3066
Joined: Wed Jul 22, 2020 11:25 pm

Re: Extract PGS Subtitles for Editing

Post 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)
keithhelms
Posts: 38
Joined: Sat Apr 16, 2016 10:34 am

Re: Extract PGS Subtitles for Editing

Post 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.
Chetwood
Posts: 982
Joined: Mon Aug 30, 2010 9:16 am

Re: Extract PGS Subtitles for Editing

Post 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.
MultiMakeMKV: MakeMKV batch processing (Win)
MultiShrink: DVD Shrink batch processing
Offizieller Uebersetzer von DVD Shrink deutsch
Post Reply