10

I'm trying to extract some subtitles as an srt file because there are some lines I'd like to edit therein before remuxing the video.

Unfortunately I'm running into an error that I really don't understand at all. The error reads: Subtitle encoding currently only possible from text to text or bitmap to bitmap.

The subtitles that I'm trying to extract are described by ffmpeg as hdmv_pgs_subtitle. I'm not sure if this has anything to do with the problem?

The command that I'm executing is ffmpeg -i "C:\Users\User\Desktop\Movie.mkv" -map 0:s:3 Movie.srt.

Any insight would be greatly appreciated.

2 Answers 2

10

HDMV PGS subtitles are bitmap subtitles, which essentially means they are series of images with transparency that get overlayed on the video when enabled, instead of text files like srt subtitles. Naturally ffmpeg will not be able to convert a type to another, especially not from a bitmap type to a text type as that probably requires the ability of Optical Character Recognition.

You might be able to extract it as-is by specifying -c:s copy. (Not sure what extension name should be use, but it wouldn't really matter anyway so you can use something like .pgs or even nothing.)

3
  • Ohh ok, that makes sense. If I extract them, can I even edit them?
    – oldboy
    Sep 23, 2019 at 4:07
  • 1
    Unlikely. I mean even if you can open it with a certain piece of software, you will only be able edit it in the sense of editing images with Photoshop or GIMP, I suppose.
    – Tom Yan
    Sep 23, 2019 at 5:09
  • Subler will do OCR on subtitles. I rip the mkv to mp4 with Handbrake first.
    – David
    Sep 15, 2023 at 12:06
2

You're using the suffix .srt (a text format), so it's trying to convert image subtitles to text subtitles. Which it can't do, currently.

Try...

ffmpeg -i "C:\Users\User\Desktop\Movie.mkv" -map 0:s:3 -scodec copy Movie.sup

That should do the trick. .sup is the suffix that ffmpeg likes for pgs files.

Note: I also added -scodec copy to your command. For some reason ffmpeg gets confused otherwise.

1
  • I will try this the next time that I have to do it <3333
    – oldboy
    Jun 13, 2022 at 19:21

You must log in to answer this question.

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