Trying to decode AAC over RTP

I am able to create a pipeline to encode a test tone with avenc_aac and send it over the network with RTP. I can decode this RTP stream with VLC by loading a .sdp file in VLC. However, when I try to decode the stream on another computer with gstreamer, I get the following output. How do I get the decode pipeline to work?

0:00:03.424411593 13524 0x5618925cfb60 ERROR libav :0:: Number of scalefactor bands in group (41) exceeds limit (40).
0:00:03.424434782 13524 0x5618925cfb60 WARN libav gstavauddec.c:756:gst_ffmpegauddec_handle_frame:<avdec_aac0> decoding error
0:00:03.445641648 13524 0x5618925cfb60 ERROR libav :0:: Number of scalefactor bands in group (41) exceeds limit (40).
0:00:03.445665396 13524 0x5618925cfb60 WARN libav gstavauddec.c:756:gst_ffmpegauddec_handle_frame:<avdec_aac0> decoding error

My encode pipeline is:

GST_DEBUG=1 gst-launch-1.0 audiotestsrc ! audio/x-raw, rate=48000, channels=2, layout=interleaved ! audioconvert ! audioresample ! avenc_aac ! rtpmp4apay name=pay1 pt=97 ! udpsink host=10.10.0.126 port=40012

My decode pipeline is:

GST_DEBUG=2 gst-launch-1.0 udpsrc port=40012 caps=“application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)MP4A-LATM” ! rtpmp4adepay ! capsfilter caps=“audio/mpeg, mpegversion=(int)4” ! avdec_aac ! fakesink

Hi, I believe you are missing a parsing element (aacparse) before the decoder. As such the decoder will not be able to process the incoming stream. Could you try the following:

GST_DEBUG=2 gst-launch-1.0 udpsrc port=40012 ! \
caps=“application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)MP4A-LATM” ! \
rtpmp4adepay ! capsfilter caps=“audio/mpeg, mpegversion=(int)4” ! \
aacparse ! avdec_aac ! fakesink

I tried adding the aacparse element, but then I get a flood of these messages:

0:00:15.019007084 2422 0x55dfb2ba90c0 ERROR aacparse gstaacparse.c:354:gst_aac_parse_sink_setcaps: Need codec_data for raw AAC

Yes, that is true. I am seeing the same on my side. Though your initial error did point to the decoder being unable to handle the data coming out of rtpmpadepay.

Do you requirements restrict you to the current pipelines?
Just to have an idea of how much I can change the pipeline to provide a possible solution