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?

link|improve this question

50% accept rate
feedback

migrated from stackoverflow.com Jun 4 '11 at 16:39

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 0 down vote accepted

after some trials it seems i had to add -scodec copy to my command line. I mean ffmpeg -i video.avi -i subtitle.srt -scodec copy combined.mkv did add subtitles to my video.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.