FFmpeg: Exporting subtitle stream to .ass file
5,667
Solution 1
try this
ffmpeg -i input.mkv -map 0:{subtitle_stream_index} -c copy output_subtitle.ass
assuming the subtitle stream index is 7 from your question then the command will be
ffmpeg -i input.mkv -map 0:7 -c copy output_subtitle.ass
Solution 2
You should try this: ffmpeg -i input.mkv -vn -an -codec:s:0.7 ass output_subtitle.ass
assuming you have found out the stream identifier to be 0:7.
Related videos on Youtube
![YourMJK](https://i.stack.imgur.com/sx1i4.png?s=256&g=1)
Author by
YourMJK
Updated on September 18, 2022Comments
-
YourMJK almost 2 years
What I'm trying to do is exporting the subtile stream of a MKV-file to a ASS-subtitle-file. I'm not really experienced with ffmpeg so I'm sorry if I miss something obvious
This is what I've got so far:
ffmpeg -i input.mkv -map 0:7 -c:s ass output_subtitle.ass
But when I try to run it, it gives me the error "Only SUBTITLE_ASS type supported"
-
Kard Nails over 10 yearsBy the way, why not use str?
-
Kard Nails over 10 yearsLighter, simpler, more widely supported and it's not like ass has that much to offer that str hasn't. Unless you want some really fancy formatting.
-
YourMJK over 10 yearsWell, how do you define "fancy formatting"? The subtitle got a custom font and color :D
-
Elisa Cha Cha over 10 yearsPlease include the complete
ffmpeg
console output. -
YourMJK over 10 yearsToo long to post here...
-
Elisa Cha Cha over 10 yearsNobody has said that before. You may, of course, omit multiple repeating lines. If you are unsure just provide the first ~50 and last ~50 lines.
-
YourMJK over 10 yearsWell I found a line that may be interesting:
[matroska,webm @ 0x7fb421018600] Could not find codec parameters for stream 7 (Subtitle: hdmv_pgs_subtitle): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options'
-
YourMJK over 10 yearsAnd the last lines: Chapter #0.1: start 325.575250, end 612.278333 Metadata: title : Chapter 02 […] (Lots of chapters) Stream #0:0(eng): Subtitle: ass Metadata: title : Untertitel Stream mapping: Stream #0:4 -> #0:0 (pgssub -> ass) Press [q] to stop, [?] for help [ass @ 0x7fb422417c00] Only SUBTITLE_ASS type supported. Subtitle encoding failed
-
-
YourMJK over 10 yearsThanks for the answer but somehow it still gives me the same error. Maybe it is relevant that the subtitle stream has a pgssub codec?
-
Kard Nails over 10 yearsHave you tried to export str instead?
-
YourMJK over 10 yearsYes, I did but it leaves me with a new error: "Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height" Command I used:
ffmpeg -i input.mkv -vn -an -codec:s:0.7 srt output_subtitle.srt
-
YourMJK over 10 yearsWait, I'm confused. Is it "SRT" or "STR"?!