I've been trying to figure out how to extract hdmv pgs subtitles from an mkv file for a few days now. I must be doing something wrong. I'm a noob at this. Can someone please help? I think i need to set an encoder or set a codec parameter to fix the issue.
this is the subtitle I'm trying to rip
Stream #0:4(eng): Subtitle: hdmv_pgs_subtitle (default)
Metadata:
title : Signs / Songs
BPS-eng : 7215
DURATION-eng : 00:22:43.946000000
NUMBER_OF_FRAMES-eng: 96
NUMBER_OF_BYTES-eng: 1230263
_STATISTICS_WRITING_APP-eng: mkvmerge v28.0.0 ('Voice In My Head') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2018-10-22 23:45:00
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
and the ffmpeg command i'm using is
ffmpeg -i "FILE PATH".mvk -map 0:4 "FILE PATH".srt
I've also tried
ffmpeg -i "FILE PATH".mkv -map 0:4 pgssub "FILE PATH".srt
ffmpeg -i "FILE PATH".mkv -map 0:4 hdmv_pgs_Subtitles "FILE PATH".srt
along with a few other variations and always get an error.
Can someone please tell me what i'm doing wrong and show me the correct code to use. I'm on a mac and i've also tried using MKVToolNix and get a weird binary file that doesn't work cause it's probably in the wrong format.
Here is how you can convert PGS to SRT using the Subtitle Edit program: Launch Subtitle Edit on your Windows PC. Click Open to import the PGS file. Hit the Format tab and select SRT as the output file type.
Go to https://www.nikse.dk/subtitleedit and download the app, install and launch it. Click File and import subtitle from MKV file. Or you can drag and drop the file into the program. Select the video file with PGS subtitles and open it by tapping Open, after which the OCR window pops up.
A: Actually, PGS is not a text-based subtitle file type, it's just a timed sequence of graphic images. Just like when you extract subtitles from DVD, converting PGS to SRT, OCR (Optical Character Recognition) is a necessary process.
My understanding is that PGS is bitmap subtitles. In other words, it’s a bunch of pictures showing the subtitles that are simply placed on top of the video upon display.
Meanwhile, SRT is text subtitles: it is a plain text file that contains the text of each subtitle line and the times when the line is to be displayed.
To convert images to text, you need some sort of OCR (optical character recognition) software. FFmpeg does not support OCR, as far as I’m aware.
A brief search on the Web tells me that Subtitle Edit can extract PGS from MKV, run it through OCR and save the result as SRT. There are some guides for this on the Web, but if you have further questions, they are probably better suited for Super User.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With