After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 792437 - fdkaacdec decoding error
fdkaacdec decoding error
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-01-11 18:08 UTC by Florent Thiéry
Modified: 2018-01-23 15:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
short audio sample (58.83 KB, audio/x-m4a)
2018-01-11 18:08 UTC, Florent Thiéry
Details

Description Florent Thiéry 2018-01-11 18:08:31 UTC
Created attachment 366678 [details]
short audio sample

I'm trying to decode an AAC stream (provided by a network camera)

$ gst-launch-1.0 filesrc location=test.m4a ! qtdemux ! aacparse ! fdkaacdec ! autoaudiosink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstFdkAacDec:fdkaacdec0: Could not decode stream.
Additional debug info:
../subprojects/gst-plugins-bad/ext/fdkaac/gstfdkaacdec.c(220): gst_fdkaacdec_handle_frame (): /GstPipeline:pipeline0/GstFdkAacDec:fdkaacdec0:
decoding error: 16386

avdec_aac does succeeed:
$ gst-launch-1.0 filesrc location=test.m4a ! qtdemux ! aacparse ! avdec_aac ! autoaudiosink

Aacparse detects:
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstAacParse:aacparse0.GstPad:src: caps = audio/mpeg, mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw, level=(string)2, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)1190, rate=(int)48000, channels=(int)2
Comment 1 Tim-Philipp Müller 2018-01-23 12:27:01 UTC
aacparse doesn't "detect" the stream format here, it simply trusts the stream-format in the upstream caps, as it should.

The problem is that this m4a file doesn't contain raw AAC, it contains AAC in form of ADTS frames. That's just broken.

The other elements then try to parse this stream as raw AAC and run into errors. Same happens with faad.

Only works with avdec_aac because we force an extra parsing step (IIRC), but we probably shouldn't be forcing that for raw input there either.
Comment 2 Florent Thiéry 2018-01-23 15:25:00 UTC
Thanks, in the meantime i found the following workaround which will trick aacparse into parsing ADTS:

gst-launch-1.0 filesrc location=test.m4a ! qtdemux ! capssetter replace=true caps="audio/mpeg, stream-format=(string)adts" ! aacparse ! fdkaacdec ! autoaudiosink

I will report the initial problem to the device manufacturer.