#8714 closed enhancement (fixed)

Support 22.2 channel AAC

Reported by: Yuuki Owned by:
Priority: wish Component: avcodec
Version: git-master Keywords: aac
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

ffmpeg cannot remux 22.2 channel AAC into various container format.

How to reproduce:

> ffmpeg -i audio.latm -c copy audio.m2ts
ffmpeg version n4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
  configuration: --toolchain=msvc --prefix=/msvc64aac --arch=x86_64 --target-os=win64 --disable-pthreads --disable-bzlib --disable-iconv --disable-lzma --disable-xlib --disable-encoders --disable-network --enable-gpl --enable-version3 --disable-doc
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Invalid chan_config 13
    Last message repeated 516 times
[loas @ 000002728131ECC0] decoding for stream 0 failed
[loas @ 000002728131ECC0] Could not find codec parameters for stream 0 (Audio: aac_latm, 0 channels, fltp): unspecified sample rate

Change History (8)

comment:1 by Carl Eugen Hoyos, 17 months ago

Please provide the input sample.

in reply to:  1 comment:2 by Yuuki, 17 months ago

Replying to cehoyos:

Please provide the input sample.

https://drive.google.com/file/d/15HZ6z4zVpjSyP74Ok0zkEcmnTWkVgbzo/view?usp=sharing

Let me know if I should upload to another file hosting service.

comment:3 by Carl Eugen Hoyos, 17 months ago

Component: undeterminedavcodec
Keywords: aac added
Priority: normalwish
Version: unspecifiedgit-master

comment:4 by pkv, 16 months ago

I had implemented decoder and encoder support for ffmpeg native aac a few years back:
https://github.com/pkviet/FFmpeg/commits/pce2
@yuuki It should decode your 22.2 stream ; you can encode too btw.
I had started submitting part of this code on the list but then the reviewing took a while and I lost interest.
There's also the patchset by jeeb:
https://ffmpeg.org/pipermail/ffmpeg-devel/2020-June/264655.html

comment:5 by Yuuki, 16 months ago

Thanks pkv. I've rebased your patch to n4.3 and gave it a shot, it works like a charm.

Remuxing to matroska doesn't work (expected) but decoding to wav definitely works. Hopefully we'll see some patches baked in soon and we can decode them in a video player.

comment:6 by jeeb, 16 months ago

At least my patch set seemed to enable remuxing to Matroska with the sample as I tested here locally (if you want a git version, it's available @ https://github.com/jeeb/ffmpeg/commits/22dot2_aac ).

Compared to pkv's, it only implements the parts that currently are blocking decoding and demuxing of channel_config = 13 AAC streams, while his implements much more parsing of the AAC bit stream (which is a generally GoodIdea, I think?).

Actual 22.2 to something-else downmix would have to be implemented separately so that players could utilize the decoded result through swresample or so.

comment:7 by Carl Eugen Hoyos, 16 months ago

Wouldn’t it be more useful if our decoder by default outputs six or eight channels?

comment:8 by mkver, 13 months ago

Resolution: fixed
Status: newclosed

Fixed in 9c0beaf0d3bb72f6e83b3b155a598a9ec28c8468 and some commits preceding it.

Note: See TracTickets for help on using tickets.