6
1
I know maybe it's not a right place to ask this question but I couldn't find more related Q/A site from StackExchange group so here it goes :
I need to add subtitle to a movie, i already have avi format video and srt format subtitle file and now i want to encode them both into one file. so the output file should have 3 streams, video,audio and subtitle. when i try ffmpeg -i video.avi -i subtitle.srt combined.mkv
it understands what I want and logs
stream #0.0 -> #0.0
stream #0.1 -> #0.1
stream #1.0 -> #0.2
but then it generates error Encoder (codec id 0) not found for output stream #0.2
. I tried adding -newsubtitle
option after combined.mkv
but that seemed to be unnecessory cause it generated log like this :
stream #0.0 -> #0.0
stream #0.1 -> #0.1
stream #1.0 -> #0.2
stream #1.0 -> #0.3
can anyone help me what I should do to introduce subtitle encoder to ffmpeg (I also tried mp4 format for output stream but the same error was reported) ? and by the way does anyone know a way to keep the original video quality in generated one?
I can understand the loss part, but why would I lose autio/video streams? – Ali1S232 – 2012-12-18T10:08:29.540
@Gajoo by default, ffmpeg only uses one video stream, one audio stream, and one subtitle stream. It tries to choose the best quality one (though it goes about this in a pretty naive way), but if you have, say, both English and Japanese audio on a cartoon, then you will lose one of them.
-map 0
overrides those defaults and tells ffmpeg to use every stream from input 0 (the first input file). – evilsoup – 2012-12-19T16:49:27.750