Log in

View Full Version : 7.1 Encoding


easy2Bcheesy
1st December 2016, 18:54
Hi there,

I've been pulling teeth today trying to do rudimentary 7.1 audio via Adobe Premiere, which doesn't apparently support it (!).

I import ProRes+8 channel WAVs and have now reached the point where I can export a QuickTime ProRes MOV that - once reimported - shows the same eight channels with the same waveforms. In effect, I can now do basic editing and my exports appear valid.

The issue is that of all the x264/x265 GUIs out there, only Handbrake appears to be able to open the Quicktime ProRes MOV export produced by Premiere. And Handbrake can't seem to put the surrounds into the right place. Here are some test outputs.

HEVC/AAC test (6+2 format - 7.1 format does the same) - https://mega.nz/#!v98wRCSA!yyV0g27Yhcks_s-EiVwNR5D5Vvl1YkLeI0EmSMOT0vw

h.264/AC3 test (7.1) - https://mega.nz/#!z4khTKhL!r5ASneoXoEPcy-YsxKW6YhtCgW5B_1OPD2WjJD45tB4

On the AAC test, side surrounds and rear surrounds are all grouped into the rear. On the AC3 test, side surrounds and rear surrounds are all grouped into the sides.

Not entirely sure how to proceed - help would be appreciated! I'm testing by using an Xbox One running into a receiver. I would love to blame the Xbox but running the encodes on an LG screen into the receiver via ARC also exhibits similar behaviour.

sneaker_ger
1st December 2016, 19:03
Both files are 6 channel. AC3 is limited to 5.1 anyways. Source file would be more interesting.

Probably can be solved via ffmpeg pipe to qaac but knowledge of source file is required to know exact command.

More info about AAC:
http://forum.videohelp.com/threads/377639-7-1ch-AAC-encoding (+qaac standard channel layout change in 2.60/2.61 (https://sites.google.com/site/qaacpage/news))

hello_hello
1st December 2016, 20:18
On the AAC test, side surrounds and rear surrounds are all grouped into the rear. On the AC3 test, side surrounds and rear surrounds are all grouped into the sides.

It seems in both cases the audio is being downmixed to 5.1ch and the difference is how it's interpreted when it's decoded.

If you look at the default wave file channel order here (https://msdn.microsoft.com/en-us/library/windows/hardware/dn653308%28v=vs.85%29.aspx) you'll find it's this:

Front Left - FL
Front Right - FR
Front Center - FC
Low Frequency - LF
Back Left - BL
Back Right - BR
Front Left of Center - FLC
Front Right of Center - FRC
Back Center - BC
Side Left - SL
Side Right - SR

There's no such thing as "surround" channels in wave file land, so traditionally the back speakers were mapped to "surround" for AC3 or AAC 5.1ch encoding.
When support for specifying other layouts using dwChannelMask became more common and 7.1ch threw a spanner in the works.... it started to make more sense to map the "side" channels to "surround" for 5.1ch and use "back" as "rear surround" for 7.1ch.

Generally encoders don't care and will accept either the back or side channels as "surround" for 5.1ch.
It's possible a player/decoder might be schizophrenic about it decoding it according to the codec.

If I remember correctly foobar2000 decodes 5.1ch AAC and AC3 to "back" but for DTS it decodes to "side" and I think ffmpeg does the same. I don't know why.
MediaInfo displays 5.1ch AAC, AC3 and DTS as "side" but for Opus it displays "back". I don't think I ever learned if there's a reason for that either.

easy2Bcheesy
1st December 2016, 20:25
OK, getting this down to a reasonable size was 'challenging'.

I squeezed the video dimensions to 640x360 but the audio arrangement is the same.

https://mega.nz/#!Wt8khL6K!RQmyIGRyXzMU3unjcDbE8g7UvMKW3YB4t58am7EvkL4

I will be interested in your thoughts!

sneaker_ger
1st December 2016, 21:11
Can't see anything special.
ffmpeg -i input.mov -vn -c:a aac out.m4a
ffmpeg -i input.mov -f wav - | qaac - -o out.m4a

Works?

easy2Bcheesy
1st December 2016, 22:27
Which makes Handbrake not working even more annoying. I guess I'll need to break this into video and audio encodes and manually mux it. Thanks!

easy2Bcheesy
2nd December 2016, 13:11
The top line creates an eight-channel m4a which is great! However, muxing it into an mp4 via megui's muxer creates a file that cannot be read on Xbox with booked channel separation on PC in 7.1 mode. Weirdly, stereo via headset sounds OK...

Any ideas?

The qaac line doesn't appear to work though I do have QuickTime installed.

sneaker_ger
2nd December 2016, 13:21
Not all devices have the necessary license for multi-channel AAC. I know that's the case for the Xbox 360, not sure about Xbox One.

SeeMoreDigital
3rd December 2016, 20:06
Not all devices have the necessary license for multi-channel AAC...Indeed. And not all devices are able to transcode multi-channel AAC audio to multi-channel PCM and pass it via HDMI to a surround sound amplifier :eek:

kuchikirukia
11th December 2016, 22:28
The qaac line doesn't appear to work though I do have QuickTime installed.

I'm not sure if QT installs the necessary components. iTunes does.
If you don't want to install bloatware, just rename the iTunes installer from exe to 7z, open it in 7-zip, and extract and install both CoreAudioToolbox msi's.

sneaker_ger
11th December 2016, 23:10
Installing the msis is still too much garbage. In the qaac site's download section is a script (makeportable.zip) to only extract the dlls which can be put into the qaac.exe folder.

But it is useless, I guess, since his xbox doesn't seem to support multi-channel AAC anyways.