ab-av1 icon indicating copy to clipboard operation
ab-av1 copied to clipboard

Question about how to handle multi channel audio

Open BankaiNoJutsu opened this issue 2 years ago • 2 comments

Hello,

I noticed that when specifying --acodec but leaving --downmix-to-stereo out, audio is converted, however channels are not kept in same order as they were, leading to L C R becoming L R C sometimes.

This applies to DTS mainly.

Would it be possible to add a check for this? To keep the same order of L, R, C etc?

Or should I just downmix?

Cheers!

BankaiNoJutsu avatar Feb 18 '23 10:02 BankaiNoJutsu

We're mostly just relying on ffmpeg to do its thing with audio. So we inherit the default behaviour. I'm not sure why this would be the default behaviour of ffmpeg though.

Related: You can configure more ffmpeg audio options using --enc. You can also just copy the audio and deal with it directly in ffmpeg (or something else) later.

alexheretic avatar Feb 18 '23 10:02 alexheretic

I remember this was a thing with libopus. The channels are not 1:1 the same, so telling 5.1 or 7.1 explicit should help. Googling for libopus multichannel 5.1 should give more details.

Try --acodec libopus --enc af=aformat=channel_layouts="7.1|5.1" or use copy/default on the first run and then afterwards directly with ffmpeg ffmpeg -i myfile.mkv -vcodec copy -map 0 -c:a libopus -af aformat=channel_layouts="7.1|5.1|stereo" myfileoutput.mkv Or use for faster comparing/results only the audio track (first in this example) and mux it later: ffmpeg -i myfile.mkv -map 0:a:0 -af aformat=channel_layouts="7.1|5.1|stereo" myfileaudiotrack1.opus (typed from my memory, don't use it blindly)

6channels will get default 320kbps, stereo 96kbps and 8channels even more, but overall it is enough to be transparent.

mr44er avatar Mar 16 '23 14:03 mr44er