When I try to play my 5.1 flac files with ffplay, it automatically detects the stream thusly:
Duration: xx:xx:xx.xx, start: 0.000000, bitrate: xxxx kb/s
Stream #0:0: Audio: flac, 48000 Hz, 5.1(side), s32 (24 bit)
As you can see, it detects the files as having the channel layout 5.1(side). This makes the side speakers (which should really be rear speakers) very quiet. If I add gain to those channels, they distort. I just want them to play properly, with the other 5.1 channel layout in the ffplay documentation, described as FL,FR,C,LFE,RL,RR.
Here is an excerpt from the ffplay documentation:
Standard channel layout compositions can be specified by using the following identifiers:
‘5.1’
FL+FR+FC+LFE+BL+BR
‘5.1(side)’
FL+FR+FC+LFE+SL+SR
Both of the above layouts have 6 channels. So how can I specify I want to use '5.1' and not '5.1(side)'?
It’s for this layout the audio was mixed, and it’s this layout that I have set up with speakers.
How can I achieve this?
You can use the channelmap filter:
Or re-map channels upon playback if you want to avoid re-encoding:
What I did was take your 5.1(side) flac file & split into 6 .wav files with ffmpeg (must be relativity recent ffmpeg.
So to start, in an empty folder placed the .flac, then cd'd to that folder in a terminal. This command will split to .wav's. (using voltest.flac as example
ffmpeg -i ./voltest.flac -filter_complex "channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]" -map "[FL]" front_left.wav -map "[FR]" front_right.wav -map "[FC]" front_center.wav -map "[LFE]" lfe.wav -map "[SL]" back_left.wav -map "[SR]" back_right.wav
After splitting then re-encoded back to a flac using this command
ffmpeg -i front_left.wav -i front_right.wav -i front_center.wav -i lfe.wav -i back_left.wav -i back_right.wav -filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a]amerge=inputs=6[aout]" -map "[aout]" output.flac
So output.flac will be mapped as you desired. You could probably create a script to do a number of .flacs at once back to orig. name with a little experimenting..