0

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?

Journeyman Geek
  • 127,463
  • 52
  • 260
  • 430
Idhtft
  • 1
  • 1
  • 1
  • 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 Oct 23 '22 at 00: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](https://en.wikipedia.org/wiki/Optical_character_recognition)-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 Oct 23 '22 at 01:47
  • Related - https://superuser.com/questions/861645/converting-dvd-subtitles-to-text – Tetsujin Oct 23 '22 at 09:32

1 Answers1

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

Alain1A45
  • 306
  • 1
  • 7
  • 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 Oct 25 '22 at 00:14