[FFmpeg-user] Converting Every Audio-Stream and copy all other Streams

Christian Maaß christian at maass.it
Thu Jul 18 23:45:36 CEST 2013


Hi Together,

I have the following Problem:

I want to use ffmpeg to convert my mkv files from DTS to AC3 by copying the video and subtitle streams.
I try the following command:

ffmpeg -i Video1.mkv -map 0 -vcodec copy -acodec ac3 -async 1000 -ab 640000 -scodec copy -y Video2.mkv

But when I try it I get the the following message:

Input #0, matroska,webm, from 'Video1.mkv':
  Duration: 01:33:42.04, start: 0.000000, bitrate: 3072 kb/s
    Stream #0.0(eng): Video: h264 (High), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0.1(ger): Audio: dca (DTS), 48000 Hz, 5.1, s16, 1536 kb/s (default)
    Stream #0.2(eng): Audio: dca (DTS), 48000 Hz, 5.1, s16, 1536 kb/s
    Stream #0.3(ger): Subtitle: [0][0][0][0] / 0x0000 (default) (forced)
Number of stream maps must match number of output streams

If I try
ffmpeg -i Video1.mkv -vcodec copy -acodec ac3 -async 1000 -ab 640000 -scodec copy -y Video2.mkv
ffmpeg starts to convert the video, but with just the first audio-stream.

Is it possible to get a command which I can use for all my mkv files without checking the audio-streams for every file, so I can use it in a for-loop?

What do I do wrong?
Thank you for your help.
Kind Regards
Christian Maaß


More information about the ffmpeg-user mailing list