Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding problems using 7.1 FLAC with HE-AAC #92

Closed
Dendraspis opened this issue Jul 1, 2023 · 2 comments
Closed

Encoding problems using 7.1 FLAC with HE-AAC #92

Dendraspis opened this issue Jul 1, 2023 · 2 comments

Comments

@Dendraspis
Copy link
Contributor

Hello,
this might be related to #62, but is a bit different at the same time.
The encode itself seems to work, but there seems to be no program, that can handle these files except qaac - even ffmpeg struggles.

LAV Splitter error message indicates:
Audio: AAC 96000Hz stereo 223kbps

That sort of fits the mediainfo output of the resulting file, which does not print any available channels.

Command Line:
qaac64.exe -v256 --he --verbose "Test.flac" -o "Test.m4a"

qaac 2.79, CoreAudioToolbox 7.10.9.0

Test.m4a
Format: int24 -> float32
Output layout: 7.1 (C L R Ls Rs Rls Rrs LFE)
AAC-HE Encoder, CVBR 224kbps, Quality 96
[100.0%] 0:49.055/0:49.055 (12.1x), ETA 0:00.000
4709376/4709376 samples processed in 0:04.046
Overall bitrate: 223.677kbps
Optimizing...done

qaac64 --check:

qaac 2.79, CoreAudioToolbox 7.10.9.0
libsoxconvolver 0.1.0
libsoxr-0.1.3
libsndfile-1.0.31
libFLAC 1.3.2

Source File:

General
Count                                    : 348
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Count of audio streams                   : 1
Audio_Format_List                        : FLAC
Audio_Format_WithHint_List               : FLAC
Audio codecs                             : FLAC
Audio_Channels_Total                     : 8
Complete name                            : .\Test.flac
Folder name                              : .
File name extension                      : Test.flac
File name                                : Test
File extension                           : flac
Format                                   : FLAC
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Format/Url                               : https://xiph.org/flac/
Format/Extensions usually used           : fla flac
Commercial name                          : FLAC
Internet media type                      : audio/x-flac
File size                                : 48827919
File size                                : 46.6 MiB
File size                                : 47 MiB
File size                                : 47 MiB
File size                                : 46.6 MiB
File size                                : 46.57 MiB
Duration                                 : 49056
Duration                                 : 49 s 56 ms
Duration                                 : 49 s 56 ms
Duration                                 : 49 s 56 ms
Duration                                 : 00:00:49.056
Duration                                 : 00:00:49.056
Overall bit rate mode                    : VBR
Overall bit rate mode                    : Variable
Overall bit rate                         : 7962805
Overall bit rate                         : 7 963 kb/s
Stream size                              : 0
Stream size                              : 0.00 Byte (0%)
Stream size                              :  Byte0
Stream size                              : 0.0 Byte
Stream size                              : 0.00 Byte
Stream size                              : 0.000 Byte
Stream size                              : 0.00 Byte (0%)
Proportion of this stream                : 0.00000
File creation date                       : 2023-07-01 00:44:57.150 UTC
File creation date (local)               : 2023-07-01 02:44:57.150
File last modification date              : 2023-07-01 00:44:58.718 UTC
File last modification date (local)      : 2023-07-01 02:44:58.718
Writing application                      : Lavf60.5.100
Writing application                      : Lavf60.5.100

Audio
Count                                    : 286
Count of stream of this kind             : 1
Kind of stream                           : Audio
Kind of stream                           : Audio
Stream identifier                        : 0
Format                                   : FLAC
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Format/Url                               : https://xiph.org/flac/
Commercial name                          : FLAC
Internet media type                      : audio/x-flac
Duration                                 : 49056
Duration                                 : 49 s 56 ms
Duration                                 : 49 s 56 ms
Duration                                 : 49 s 56 ms
Duration                                 : 00:00:49.056
Duration                                 : 00:00:49.056
Bit rate mode                            : VBR
Bit rate mode                            : Variable
Bit rate                                 : 7961454
Bit rate                                 : 7 961 kb/s
Channel(s)                               : 8
Channel(s)                               : 8 channels
Channel positions                        : Front: L C R, Side: L R, Back: L R, LFE
Channel positions                        : 3/2/2.1
Channel layout                           : L R C LFE Lb Rb Ls Rs
Sampling rate                            : 96000
Sampling rate                            : 96.0 kHz
Samples count                            : 4709376
Bit depth                                : 24
Bit depth                                : 24 bits
Compression mode                         : Lossless
Compression mode                         : Lossless
Stream size                              : 48819633
Stream size                              : 46.6 MiB (100%)
Stream size                              : 47 MiB
Stream size                              : 47 MiB
Stream size                              : 46.6 MiB
Stream size                              : 46.56 MiB
Stream size                              : 46.6 MiB (100%)
Proportion of this stream                : 0.99983
Writing library                          : Lavf60.5.100
Writing library                          : Lavf60.5.100
MD5 of the unencoded content             : 7B07F43CB33BA0D1481D4412B8AE7E94

Output File:

General
Count                                    : 349
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Count of audio streams                   : 1
Audio_Format_List                        : AAC LC SBR
Audio_Format_WithHint_List               : AAC LC SBR
Audio codecs                             : AAC LC SBR
Complete name                            : .\Test.m4a
Folder name                              : .
File name extension                      : Test.m4a
File name                                : Test
File extension                           : m4a
Format                                   : MPEG-4
Format                                   : MPEG-4
Format/Extensions usually used           : braw mov mp4 m4v m4a m4b m4p m4r 3ga 3gpa 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma ismt f4a f4b f4v
Commercial name                          : MPEG-4
Format profile                           : Apple audio with iTunes info
Internet media type                      : audio/mp4
Codec ID                                 : M4A
Codec ID                                 : M4A  (M4A /mp42/isom)
Codec ID/Url                             : http://www.apple.com/itunes/
CodecID_Compatible                       : M4A /mp42/isom
File size                                : 1385384
File size                                : 1.32 MiB
File size                                : 1 MiB
File size                                : 1.3 MiB
File size                                : 1.32 MiB
File size                                : 1.321 MiB
Duration                                 : 49131
Duration                                 : 49 s 131 ms
Duration                                 : 49 s 131 ms
Duration                                 : 49 s 131 ms
Duration                                 : 00:00:49.131
Duration                                 : 00:00:49.131
Overall bit rate mode                    : VBR
Overall bit rate mode                    : Variable
Overall bit rate                         : 225582
Overall bit rate                         : 226 kb/s
Stream size                              : 11707
Stream size                              : 11.4 KiB (1%)
Stream size                              : 11 KiB
Stream size                              : 11 KiB
Stream size                              : 11.4 KiB
Stream size                              : 11.43 KiB
Stream size                              : 11.4 KiB (1%)
Proportion of this stream                : 0.00845
HeaderSize                               : 11699
DataSize                                 : 1373685
FooterSize                               : 0
IsStreamable                             : Yes
Encoded date                             : 2023-07-01 01:18:18 UTC
Tagged date                              : 2023-07-01 01:18:22 UTC
File creation date                       : 2023-07-01 01:17:48.838 UTC
File creation date (local)               : 2023-07-01 03:17:48.838
File last modification date              : 2023-07-01 01:18:22.596 UTC
File last modification date (local)      : 2023-07-01 03:18:22.596
Writing application                      : qaac 2.79, CoreAudioToolbox 7.10.9.0, AAC-HE Encoder, CVBR 224kbps, Quality 96
Writing application                      : qaac 2.79, CoreAudioToolbox 7.10.9.0, AAC-HE Encoder, CVBR 224kbps, Quality 96
Encoding Params                          : (Binary)

Audio
Count                                    : 285
Count of stream of this kind             : 1
Kind of stream                           : Audio
Kind of stream                           : Audio
Stream identifier                        : 0
StreamOrder                              : 0
ID                                       : 1
ID                                       : 1
Format                                   : AAC
Format                                   : AAC LC SBR
Format/Info                              : Advanced Audio Codec Low Complexity with Spectral Band Replication
Commercial name                          : HE-AAC
Commercial name                          : HE-AAC
Format settings                          : Implicit
Format settings, SBR                     : Yes (Implicit)
Format settings, SBR                     : Yes (Implicit)
Format_AdditionalFeatures                : LC SBR
Codec ID                                 : mp4a-40-2
Duration                                 : 49131
Duration                                 : 49 s 131 ms
Duration                                 : 49 s 131 ms
Duration                                 : 49 s 131 ms
Duration                                 : 00:00:49.131
Duration                                 : 00:00:49.131
Bit rate mode                            : VBR
Bit rate mode                            : Variable
Bit rate                                 : 223677
Bit rate                                 : 224 kb/s
Maximum bit rate                         : 372957
Maximum bit rate                         : 373 kb/s
Samples per frame                        : 2048
Sampling rate                            : 96000
Sampling rate                            : 96.0 kHz
Samples count                            : 4716576
Frame rate                               : 46.875
Frame rate                               : 46.875 FPS (2048 SPF)
Frame count                              : 2303
Compression mode                         : Lossy
Compression mode                         : Lossy
Stream size                              : 1373677
Stream size                              : 1.31 MiB (99%)
Stream size                              : 1 MiB
Stream size                              : 1.3 MiB
Stream size                              : 1.31 MiB
Stream size                              : 1.310 MiB
Stream size                              : 1.31 MiB (99%)
Proportion of this stream                : 0.99155
Encoded date                             : 2023-07-01 01:18:18 UTC
Tagged date                              : 2023-07-01 01:18:22 UTC
@nu774
Copy link
Owner

nu774 commented Jul 4, 2023

This is because insert71RearPCEToASC() in cautil.cpp assumes AAC-LC, so it miserably breaks on HE-AAC. IIRC, CoreAudio didn't support 7.1ch for HE-AAC, hence it was OK in the past.
For 7.1ch HE-AAC to be supported, one of the following options is required:

  • Instead of PCE, just switch to new ISO/IEC 14496-3 AMD 4:2013 AAC channel layout constant for 6.1ch/7.1ch(rear) layout.
  • Fix insert71RearPCEToASC() to support HE-AAC.

@nu774 nu774 closed this as completed in a2e2fc4 Jul 5, 2023
@Dendraspis
Copy link
Contributor Author

Dendraspis commented Jul 5, 2023

Thank you, much appreciated. 👍

Even if I couldn't test it yet. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants