ffmpeg - Encoding - 5.1 Audio

ffmpeg -i input.mkv -c:v libx265 -c:a libopus -b:a 128k -ac6 output.mkv

NOTE: The following switches need to be specifically set:

  • Use the switch -ac 6 right after 128k.
    -b:a 128k -ac 6