Opened 5 years ago

Last modified 2 months ago

#1407 new enhancement

aac: 960/120 MDCT window is not implemented

Reported by: cehoyos Owned by:
Priority: wish Component: avcodec
Version: git-master Keywords: aac
Cc: rafael@riseup.net, Maurits, basic.master@gmx.de Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/145562
An aac sample with 960/120 MDCT was uploaded by a user, mdct_error.flv is now in samples/A-codecs/AAC

$ ffmpeg -i mdct_error.flv
ffmpeg version N-41284-ge00b2d2 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jun  4 2012 08:52:52 with gcc 4.3.2
  configuration: --cc=/usr/local/gcc-4.3.2/bin/gcc --enable-gpl --enable-libopenjpeg --enable-libvorbis --enable-libspeex --enable-libmp3lame --enable-libtheora --extra-ldflags=-lm --enable-libvpx --enable-libxavs
  libavutil      51. 56.100 / 51. 56.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.101 / 54.  6.101
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 78.100 /  2. 78.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[aac @ 0x9018c00] 960/120 MDCT window is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x9018c00] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/MPlayer/incoming/ and contact the ffmpeg-devel mailing list.
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, flv, from 'mdct_error.flv':
  Metadata:
    fps             : 25
    SAR             : 64:45
  Duration: 00:00:31.04, start: 0.000000, bitrate: 1675 kb/s
    Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25 tbr, 1k tbn, 50 tbc
    Stream #0:1: Audio: aac, 48000 Hz, stereo
At least one output file must be specified

Attachments (2)

aac_latm_960.aac (548.3 KB) - added by Basic.Master 5 months ago.
AAC-LC in LATM format with 960 samples/frame
aac_isobmff_960.m4a (331.6 KB) - added by Basic.Master 5 months ago.
HE-AAC in MP4/ISOBMFF format with 960 samples/frame

Download all attachments as: .zip

Change History (25)

comment:1 Changed 4 years ago by Maurits

Some additional information.

While the 960 frame length is rare in standalone files, it is common in streams such as those used in DAB+ digital radio.

In case anyone needs more examples or test samples, this is a status overview of a typical German DAB+ digital radio multiplex: http://www.dabmon.de:8002/
Clicking on any of the streams after 'label:' will give you a AAC960 stream to test. While the stream will be played in most cases, it is clearly being played a bit too slow due to FFmpeg incorrectly treating it as AAC1024.

comment:2 Changed 2 years ago by rafael2k

Also Digital Radio Mondiale (a Digital Radio standard) uses AAC960.
I have some samples if needed.

comment:3 Changed 2 years ago by rafael2k

Btw, a simple way to reintroduce support for AAC960 is re-add faad2 support compiled in 960 mode.

Last edited 2 years ago by rafael2k (previous) (diff)

comment:4 Changed 2 years ago by rafael2k

  • Priority changed from wish to minor

I think the fact the ffmpeg does not support the playback of the audio from two major Digital Radio standards justify to raise the priority from wish to minor.

comment:5 Changed 2 years ago by rafael2k

  • Cc rafael@riseup.net added

comment:6 Changed 2 years ago by cehoyos

  • Priority changed from minor to wish

comment:7 Changed 2 years ago by rafael2k

What is happening here, cehoyos?
According to the Issue Tracker manual[1]:

minor
(...)

Feature requests about things few people want or which do not make a big
difference.

wish

Something that is desirable to have but that there is no urgency at
all to implement, e.g. something completely cosmetic like a website
restyle or a personalized doxy template or the FFmpeg logo.
This priority is not valid for bugs.

Is it not clear that we have a minor bug here? I'll not change to priority higher, but I'd say that it's even a normal or important!

important

For feature requests this priority would be used for things many people
want.

[1] - http://git.videolan.org/?p=ffmpeg.git;a=blob_plain;f=doc/issue_tracker.txt;hb=HEAD

comment:8 Changed 2 years ago by rafael2k

  • Priority changed from wish to minor

Changed priority to minor, which is the correct.

comment:9 Changed 2 years ago by cehoyos

Sorry, but enhancements or feature requests have priority wish on this issue tracker.

comment:10 Changed 2 years ago by cehoyos

  • Priority changed from minor to wish

comment:11 follow-up: Changed 2 years ago by Maurits

FYI, in case anyone wants to take this on, the people over at OpenDigitalRadio.org have patched their version of the Fraunhofer FDK AAC codec library to support the AAC 960 transform that is required for DAB+ digital radio.

The code can be found at: https://github.com/Opendigitalradio/fdk-aac-dabplus

comment:12 in reply to: ↑ 11 Changed 2 years ago by cehoyos

  • Cc Maurits added

Replying to Maurits:

FYI, in case anyone wants to take this on, the people over at OpenDigitalRadio.org have patched their version of the Fraunhofer FDK AAC codec library to support the AAC 960 transform that is required for DAB+ digital radio.

Do I understand correctly that the people at "Open"DigitalRadio? decided to patch a proprietary, non-free decoder instead of the one in libavcodec?

Do you agree that this is not exactly helpful for the issue described here?

comment:13 Changed 2 years ago by heleppkes

The code he linked is for encoding DAB+ compatible audio, not decoding.

PS:
fdk-aac is free and open-source, just not in a way that is compatible with the GPL.

Last edited 2 years ago by heleppkes (previous) (diff)

comment:14 follow-up: Changed 12 months ago by DerouineauNicolas

Is there still any link to an aac stream with 960 or 120 samples frame length ?

I tried to reproduce with:

wget http://www.dabmon.de/p/8002/playlist/1.m3u
cat 1.m3u -> http://www.dabmon.de/p/8002/stream/1.aac
ffplay http://www.dabmon.de/p/8002/stream/1.aac

and there is no odd factor length imdct used in the decoding process

comment:15 in reply to: ↑ 14 Changed 12 months ago by Maurits

Replying to DerouineauNicolas:

Is there still any link to an aac stream with 960 or 120 samples frame length ?

Try any of these: http://dabmonitor.nl

It is easier to hear the issue with human voices (they sound unnaturally deep), with music it's harder to distinguish as it just sounds slightly "slower". If you capture the stream I would expect you to see the difference, though.

comment:16 Changed 12 months ago by cehoyos

What's wrong with mdct_error.flv in samples.ffmpeg.org/A-codecs/AAC?

comment:17 Changed 10 months ago by Basic.Master

  • Cc basic.master@gmx.de added

comment:18 Changed 5 months ago by richardpl

None of these streams are 960 any more.

comment:19 Changed 5 months ago by rafael2k

All over the air digital radio in the DAB+ and DRM standards use 960 transform AAC variation. With a cheap rtl2832U you can receive DAB+. You can easily create a 960 samples AAC with the modified fdk-aac which the link is posted in the thread.

Last edited 5 months ago by rafael2k (previous) (diff)

comment:20 Changed 5 months ago by richardpl

How, I downloaded modified fdk-aac and failed to create sample. I downloaded odr-audioenc and that one produces gibberish that faad2 cant decode.

comment:21 Changed 5 months ago by Basic.Master

All that DABMON streams are still AAC with 960 samples/frame. The problem is that these streams use the ADTS format, which cannot incorporate the signalling whether 960 or 1024 was used. But this signalling is required, as all AAC decoders (I have seen so far) otherwise default to 1024 samples/frame and the audio sounds slow and low-pitched, as described!

The 960/1024 samples/frame signalling is done by the frameLengthFlag within the GASpecificConfig, which in turn is contained in the AudioSpecificConfig (all defined in ISO 14496-3). So for correct playback, such AAC content has to be stored in a format that contains this config. This may be e.g. just an MP4/ISOBMFF container or an LATM stream.

ODR-AudioEnc does not produce plain AAC frames, but the so-called Superframes. A Superframe is a special container defined by DAB+ (ETSI TS 102 563) that has a fixed length (for a given service). Within a Superframe, there are (depending on the usage of SBR, and of 48/32 kHz) 2 to 6 AAC frames of variable length. As this format is intended for DAB+ transmission, it is hardly surprising that it cannot be played without modification by usual players.

I will provide DAB+ samples in both LATM and MP4 format, with the necessary 960 signalling. Both are played correctly by VLC, but fail with ffplay and the mentioned error message.

Changed 5 months ago by Basic.Master

AAC-LC in LATM format with 960 samples/frame

Changed 5 months ago by Basic.Master

HE-AAC in MP4/ISOBMFF format with 960 samples/frame

comment:22 Changed 5 months ago by peloverde

mdct_error.flv seems to expect the the full 128 coeffs for short windows using the top SFB which seems to be incompatible with the spec and FDK. Using this 128 limit would break conformant streams using the top SFB for non-PNS bands.

comment:23 Changed 2 months ago by Basic.Master

Meanwhile support for 960 samples/frame has been added:
https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/dbc9a8f21f92d0613142ea23bb836356fc41de38

(only discovered due to this issue: https://github.com/piratfm/eti-tools/issues/10)

While the support seems to be fine for the above AAC-LC sample, according to the console warnings there is no support (yet) for SBR (HE-AAC) and/or PS (HE-AAC v2) for the 960 case. Thus in such cases only the half-bandwidth respectively Mono core is decoded.

Note: See TracTickets for help on using tickets.