## Convert sound inside a video, from 5.1 to stereo, without image modification?

3

2 days ago I had troubles with video conversion, today that's audio. Here is the problem, the converter I found (see this question) detects all my sources audio channels as different channels (like if they were dvd languages) :

The first chanenl is the left speaker, and the second one is the right speaker, all others are middle's one. When I convert my video, the output is stereo but I loose one speaker. Here is an image to understand :

I gave a different color to each channels of my source : as you can see, after output, only the selected input is used for both speakers.

I suspect this software not to handle 5.1 channels as source. Because this is the only soft I found that supports my image resolution, I need to keep it for video conversion. But I first need to convert dolby to sereo using another software.

Do you know a way to convert dolby to stereo, without altering video ?

edit: ffmpeg -i <video> command gives this output.

Do you want to discard everything except left and right, or do you want to downmix (combine specific channels into left and/or right)? Which channels should go where? – None – 2012-12-16T17:45:23.897

I want to discard everything except left and right. I keep original files for HD purposes but there, that's for sharing. Thanks – None – 2012-12-16T20:37:41.500

1

You can do this with ffmpeg (OS X static builds). It can copy the video, so no need to re-encode, and select specific audio channels for the output. If you show the ffmpeg console output of ffmpeg -i input I can give an example command.

– None – 2012-12-20T03:41:33.860

Whoa, a command-line, I dreamt ot that! The output of this command is pastebined here. There is yellow warnings about unimplemented channels, but all info are there anyway.

– None – 2012-12-20T09:11:18.973

Shoudn't the audio 5.1 mix be remixed for stereo?? – None – 2012-12-20T22:33:54.107

At least I wanted to preserve the left/right channels into stereo (with headset this looks very similar to original source), I am not experienced at all so I'm not looking for complex things. – None – 2012-12-20T23:07:57.130

5

You can use the amerge and pan filters in ffmpeg to combine two mono streams into one stereo output:

ffmpeg -i input -filter_complex "[0:3] [0:4] amerge,pan=stereo:c0=c0:c1=c1" -c:v copy -c:a pcm_s16le output


or using -ac instead of pan:

ffmpeg -i input -filter_complex "[0:3] [0:4] amerge" -c:v copy -c:a pcm_s16le -ac 2 output


[0:3] and [0:4] refer to your desired audio streams as shown in your ffmpeg output. I just chose these as examples. There are other audio filters and options too, so there are probably several other ways to do this.

You are the man of my day. – None – 2012-12-20T20:24:27.207

@Ninsuo Glad it worked for you. I forgot to mention that if you want to switch the channel locations then you can simply switch the positions of [0:3] and [0:4] as in "[0:4] [0:3] amerge". – None – 2012-12-20T20:53:34.407

Thanks I understood the command-line. For me that's [0:1] for left and [0:2] for right. Works like a charm. – None – 2012-12-20T21:11:51.780