1

I'm trying to extract a subtitle in "HDMV PGS" format embedded in a video with this command ffmpeg -i Movie.mkv -map 0:s:0 subs.srt from an answer on Super User command, but it gives the error

Error initalizing output stream 0:0 -- subtitle encoding only possible from text to text or bitmap to bitmap
Stream mapping:
    Stream #0:3 -> #0:0 (hdmv_pgs_subtitle (pgsub) -> ass (ssa))
        Last message repeated 1 times

as shown in the screenshot enter image description here

What should I do?

3
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Oct 23, 2022 at 0:30
  • This is no extraction though. As noted in the error, you can't convert bitmap subtitle to text subtiltle, unless you are using some OCR-ish converter (if such thing even exists). If you really just want to extract as-is, add -c:s copy, or maybe use mkvtoolnix instead.
    – Tom Yan
    Commented Oct 23, 2022 at 1:47
  • Related - superuser.com/questions/861645/converting-dvd-subtitles-to-text
    – Tetsujin
    Commented Oct 23, 2022 at 9:32

1 Answer 1

0

To extract these bitmap-subtitles, you can do it in 2 steps :

1 : ffmpeg -i Movie.mkv -map 0:s:0 -c:s dvdsub -f matroska subs.mkv
2 : mkvextract subs.mkv tracks 0:mysub

and you'll get 2 files :
• mysub.idx   ← index file
• mysub.sub   ← bitmap file

index file contains the timestamps
bitmap file contains the bitmap subtitles

To edit bitmap file, you need OCR, like SubtitleEdit

1
  • dvdsub is not the same thing as pgs though. The conversion will significantly reduces quality. And mkvextract can extract PGS from mkv files, AFAIK. (While on the other hand, some files might not have CodecPrivate for the dvdsub stream and mkvextract forbids you to extract such stream, as of today.)
    – Tom Yan
    Commented Oct 25, 2022 at 0:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .