Converting 5.1 audio to stereo and keeping both tracks

2

3

Let's say I have a video file that has 5.1 audio (maybe AAC or something) and I want to convert that track to stereo so I can use it with Plex without doing any transcoding. Well, I also want to keep the 5.1 track as the 2nd track so if I ever get a 5.1 system, I can use that track. So basically, I just want to copy the video, copy the audio, and add the converted track as the 1st track (the default track).

I've searched all over the web and couldn't find anything about this. I usually just use Handbrake for my video conversions, but it doesn't have a way to just copy the video. Any help would be greatly appreciated.

Jordan Harris

Posted 2016-02-17T04:24:07.280

Reputation: 181

Answers

6

I was able to pull this off by using the following command. I'm not experienced with FFmpeg though, so I'm probably doing something wrong. Any suggestions at all? I don't even think the "96k" part is working.

Updated working command:

ffmpeg -i "input.mkv" \
-map 0:0 -map 0:1 -map 0:1 \
-c:v copy \
-c:a:0 aac -b:a:0 192k -ac 2 \
-c:a:1 copy \
"output.conv.mkv"

Edit: Just thought I should mention, I originally used libfaac (with 96k bit rate), but actually meant to use libfdk_aac here. I changed it to aac in case anyone wants to use this command as is and have good quality. By the way, FFmpeg documentation says libfdk_aac > aac > libfaac.

Jordan Harris

Posted 2016-02-17T04:24:07.280

Reputation: 181

It should be -b:a:0 – Gyan – 2016-02-17T05:24:08.320

Thank you very much. Yes, now it works exactly as I wanted and expected it to. I edited the command accordingly. – Jordan Harris – 2016-02-17T05:33:22.007

Also, unless it's an old version, you can replace libfaac with aac which is stable and good quality now. – Gyan – 2016-02-17T05:38:31.530

Awesome, thank you. Yeah I knew about that one, but for some reason I needed libfaac before so I downloaded a version with it built in. It's an older version of FFmpeg though, so I might just use the built in aac. – Jordan Harris – 2016-02-17T05:54:05.400

1

Use ffmpeg as follows

ffmpeg -i input -vn -c:a aac -ac 2 stereo.mp4

ffmpeg -i input -i stereo.mp4 -c copy -map 0:v -map 1:a -map 0:a dualaudio.mp4

Gyan

Posted 2016-02-17T04:24:07.280

Reputation: 21 016