4

I am trying to encode a mkv-file while keeping the audiostreams and the subtitles. This is the command I am using:

avconv -i inputfile.mkv -c:v mpeg2video -acodec copy - scodec copy -b:v 5000k -maxrate:v 6000k -bufsize 1835k outputfile.mkv

The problem is that my mkv contains more than one audiostream and subtitle. And using the upper command the output file only contains the default marked audiostream and subtitle. Is there any additional command to copy all containing audiostreams and subtitles?

1
  • Just curious: Do you specifically need MPEG2 video? You'd get much better quality with H.264 or even MPEG-4 Visual.
    – slhck
    Feb 4, 2013 at 8:06

1 Answer 1

5

To force FFmpeg/Libav to copy all input streams to the output, use the -map 0 option.

ffmpeg -i in.mkv \
       -map 0 -c copy \
       -c:v mpeg2video -qscale:v 2 \
       out.mkv

FFmpeg and Libav should behave the same way here. See How to use -map option on the FFmpeg wiki. Try the suggested '-qscale:v 2' option in this commandline, it should give excellent results, or simply keep the bitrate options as specified in your own post.

2
  • My edit consisted of tidying the syntax a little to conform with the FFmpeg wiki answer and adding a -qscale option to hopefully make better quality video...
    – andrew.46
    May 22, 2014 at 3:25
  • Good suggestion, thank you @andrew.46
    – slhck
    May 22, 2014 at 7:54

You must log in to answer this question.

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