Log in

View Full Version : 6ch FLAC to 4ch AC3


LigH
4th June 2025, 20:45
I have a 6-channel FLAC of a quadrophonic audio production. I know that Center and LFE are certainly empty.

I would like to encode a 4.0 channel AC3 with quad layout, so I only need to pass channels 1 (FL), 2 (FR), 5 (BL) and 6 (BR).

I guess it can be done in ffmpeg. Probably with a complex_filter string. Can you help me building a command line?

(Or maybe suggest a different workflow?)

SeeMoreDigital
4th June 2025, 20:52
I seem to remember the last time I tried playing a 4-channel (quad) Dolby Digital stream, my Onkyo AVR didn't decode it correctly. Same to with 4-ch DTS...

LigH
4th June 2025, 21:10
Not my main concern so far, expecting libavcodec being able...

hellgauss
5th June 2025, 00:17
ffmpeg -i "file.flac" -af "pan=quad|c0=c0|c1=c2|c2=c4|c3=c5" -c:a ac3 -b:a 384k output.ac3


Perhaps you can try also pan=4.0 or pan=quad(side) . See

ffmpeg -h encoder=ac3

for possible inputs.

tebasuna51
5th June 2025, 09:13
@hellgauss, only one typo and work fine
ffmpeg -i "file.flac" -af "pan=quad|c0=c0|c1=c1|c2=c4|c3=c5" -c:a ac3 -b:a 384k output.ac3

LigH
5th June 2025, 11:47
I already noticed that typo. Tried it and found that the result sounds strange in VLC (missing audio parts). A conversion to a 5.1 AC3 without channel manipulation sounds okay. Testing more when time permits... So far for all supporters:

:thanks:

hellgauss
5th June 2025, 12:28
Sorry for typo, I somewhat overlap start_counter=0 with start_counter=1 :)

I confirm that the output is wrong with vlc (no surround). However it sounds ok with audacity and foobar (using ffmpeg plugin).

With mpc-BE and mpv.net also is ok.