Search code examples
encodingffmpegaac

FFmpeg - Down-mix AC3 5.1 to Fraunhofer FDK ACC 2.1


I'm trying to re-encode some of my old videos to "archive" them.

I do not need to keep the audio 5.1, but I would like to down-mix it to 2.1 instead of Stereo which sounds just too dull.

This is the relevant part which takes care of the down-mix to Stereo and re-encodes the audio, I would like to adjust it to down-mix to 2.1.

-ac 2 -c:a libfdk_aac -vbr 3

I did some research and it seems that there is a -layouts switch which does support 2.1, but I don't know, how to use it. What channel should go where?

Just for illustration and for you to get the whole picture - I'm currently using this script:

#!/bin/bash
for i in *.mkv;
do 
    #Output new files by prepending "x265" to the names

    /cygdrive/c/media-autobuild_suite/local32/bin-video/ffmpeg.exe -y -i "$i" -c:v libx265 -preset slow -b:v 512k -x265-params pass=1 -c:s copy -c:a copy -f matroska NUL && \
    /cygdrive/c/media-autobuild_suite/local32/bin-video/ffmpeg.exe    -i "$i" -c:v libx265 -preset slow -b:v 512k -x265-params pass=2 -c:s copy -ac 2 -c:a libfdk_aac -vbr 3 x265_"$i"

done

Solution

  • The FDK aac encoder does not support 2.1, but the native encoder does.

    ffmpeg -i "$i" ... -c:s copy -af pan=2.1 -c:a aac x265_"$i"