GNOME Bugzilla – Bug 792437
fdkaacdec decoding error
Last modified: 2018-01-23 15:25:09 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
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.
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.