I connect my PC to my home theater via SPDIF, so when watching video files that uses AAC 5.1 channels, it is downmixed to stereo and the surround channels are lost.
I would like to be able to convert all 5.1 AAC output to 5.1 AC3, so my HT properly plays 6 discrete chanels.
My current approach is to use
avconv to convert my files's audio streams like this:
avconv -i <inputfile> -codec copy -codec:a ac3_fixed -b:a 448k <outputfile>
It works, but it has a few drawbacks:
All audio streams are converted to AC3, even the ones I don't need or want to, like stereo, DTS or AC3. I would like to convert only the AAC 5.1 ones. Command should be generic enough so I don't have to inspect the file or pick streams manually.
While conversion works fine, there are a few issues: volume is huge, loud as I've never seen before, and I fear some metadata is lost on conversion.
I must run this for every video I want to watch. It takes time and waste a lot of HDD space.
So, is there a solution that fixes at least one of these drawbacks?
Set OS (pulse audio?) to encode multichannel PCM to AC3 on-the-fly? (that would be amazing, since it would not only with videos but also for games.
Fix my command line with some smart parameters