-1

I'm getting the following output when I try to extract hdmv pgs subtitles from an mkv file using ffmpeg version 5.0.1-Jellyfin, I also tried ffmpeg version n5.1.1-4 with the same result.

Automatic encoder selection failed for output stream #0:0. Default encoder for format sup (codec 
hdmv_pgs_subtitle) is probably disabled. Please choose an encoder manually.
Error selecting an encoder for stream 0:0

Here is the command.

ffmpeg -i C:\ffmpeg\test.mkv -map 0:s:0 C:\ffmpeg\out\track1.sup -map 0 -map -0:s -c copy C:\ffmpeg\out\test.mkv

I'm able to extract the subtitle using mkvtoolnix + gMKVExtractGUI but I was hoping to automate the process with ffmpeg, I just can't figure out how to get it to work, the command is based on a solution by the user Totor.

Any help would be appreciated.

  • Add `-c copy` right before the sup file argument. You are currently trying to transcode the subtitle stream which ffmpeg doesnt know how to. – kesh Sep 18 '22 at 02:34

1 Answers1

0

Thanks to @kesh for spotting my mistake. For anyone looking at this in the future, the following ffmpeg command exports multiple subtitles and removes all subtitles from the file.

ffmpeg -i input.mkv \
-map 0:s:0 -c copy track1.sup \
-map 0:s:1 -c copy track2.sup \
-map 0 -c copy -map -0:s out.mkv