<div dir="ltr"><div><div><div><div><div>Hi.<br><br></div>I have a bit of a problem getting rtpbin to work reliably with AAC. Works fine with MP3. The problem can be reproduced with following two scripts. The player part fails in varying ways when using AAC, but works as said fine with MP3. When using BOTH the scripts with the argument 'mp3' it will use MP3, otherwise they will use AAC. Using GStreamer 1.8.1. Note the player does not send stats back to the encoder/sender, but that ought to be okay.<br><br></div><div>When using AAC, the player script fails in one of the following ways:<br><ol><li>A video window pops up showing the first frame, but no more frames are shown and no audio is coming out.</li><li>Failing to connect decodebin to audioconvert producing this</li></ol><p style="margin-left:40px">WARNING: from element /GstPipeline:pipeline0/GstDecodeBin:decoder2: Delayed linking failed.<br>Additional debug info:<br>./grammar.y(506): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstDecodeBin:decoder2:<br>failed delayed linking some pad of GstDecodeBin named decoder2 to some pad of GstAudioConvert named audioconvert0<br>/GstPipeline:pipeline0/GstDecodeBin:decoder2.GstDecodePad:src_0.GstProxyPad:proxypad11: caps = "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,\ colorimetry\=\(string\)bt601\,\ framerate\=\(fraction\)25/1"<br>ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data flow error.<br>Additional debug info:<br>gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:<br>streaming task paused, reason not-linked (-1)<br></p></div><b>Player script:</b><br><br></div><font size="1"><span style="font-family:monospace,monospace">#!/bin/bash<br><br>port_base=14100<br>port_video_rtp=$port_base<br>port_video_rtcp=$(($port_base+1))<br>port_audio_rtp=$(($port_base+2))<br>port_audio_rtcp=$(($port_base+3))<br><br>video_caps='application/x-rtp,media=video,payload=96,clock-rate=90000,encoding-name=H264'<br>if [ X$1 = Xmp3 ] ; then<br>  audio_caps='application/x-rtp,media=audio,payload=14,clock-rate=90000,encoding-name=MPA'<br>else<br>  audio_caps='application/x-rtp,media=audio,payload=96,clock-rate=44100,encoding-name=MP4A-LATM'<br>fi<br><br>gst-launch-1.0 -v rtpbin name=rtpbin buffer-mode=slave           \<br>        udpsrc do-timestamp=1 caps=$video_caps port=$port_video_rtp !\<br>        rtpbin.recv_rtp_sink_0                           \<br>          rtpbin.                                       !\<br>          decoder1.                                      \<br>        udpsrc port=$port_video_rtcp                    !\<br>        rtpbin.recv_rtcp_sink_0                          \<br>        udpsrc caps=$audio_caps port=$port_audio_rtp typefind=1 !\<br>        rtpbin.recv_rtp_sink_1                           \<br>          rtpbin.                                       !\<br>          decoder2.                                      \<br>          udpsrc port=$port_audio_rtcp                  !\<br>          rtpbin.recv_rtcp_sink_1                        \<br>        decodebin name=decoder1                       !\<br>        videoconvert ! autovideosink                   \<br>        decodebin name=decoder2 ! audioconvert        !\<br>        audioresample ! autoaudiosink</span></font><br><br></div><b>The encoder script is here:<br></b><br><font face="monospace,monospace"><font size="1">#!/bin/bash<br><br>port_base=14000<br>port_video_rtp=$port_base<br>port_video_rtcp=$(($port_base+1))<br>port_audio_rtp=$(($port_base+2))<br>port_audio_rtcp=$(($port_base+3))<br>host=127.0.0.1<br><br>AUDSRC="audiotestsrc is-live=1"<br>channels=2<br>rate=44100<br>if [ $1 = "mp3" ] ; then<br>  AUDIOENCODER="lamemp3enc bitrate=128 cbr=1"<br>  AUDIOPAY="rtpmpapay"<br>  AUDIOPARSE=queue<br>  AUDIOFORMATOUT="audio/mpeg,mpegversion=1"<br>else<br>  AUDIOENCODER="faac bitrate=128000"<br>  AUDIOPAY="rtpmp4apay"<br>  AUDIOPARSE=aacparse<br>  AUDIOFORMATOUT="audio/mpeg,mpegversion=4,stream-format=raw"<br>fi<br>AUDIOFORMAT="audio/x-raw,format=S16LE,layout=interleaved,rate=$rate,channels=$channels"<br><br>VIDSRC="videotestsrc is-live=1"<br>width=640<br>height=480<br>framerate=25/1<br>VIDEOFORMAT="video/x-raw,format=I420,pixel-aspect-ratio=1/1,interlace-mode=progressive,width=$width,height=$height,framerate=$framerate"<br>VIDEOFORMATOUT="video/x-h264,alignment=au,stream-format=byte-stream,profile=main"<br>gst-launch-1.0 -v rtpbin name=rtpbin                     \<br>        $AUDSRC                                         !\<br>        queue                                           !\<br>        $AUDIOFORMAT                                    !\<br>        audioparse rate=$rate channels=$channels        !\<br>        audioconvert                                    !\<br>        $AUDIOENCODER                                   !\<br>        $AUDIOPARSE                                     !\<br>        $AUDIOFORMATOUT                                 !\<br>        $AUDIOPAY                                       !\<br>        rtpbin.send_rtp_sink_1                           \<br>          rtpbin.send_rtp_src_1                         !\<br>          udpsink host=$host port=$port_audio_rtp        \<br>          rtpbin.send_rtcp_src_1                        !\<br>          udpsink host=$host port=$port_audio_rtcp sync=false async=false \<br>        $VIDSRC                                         !\<br>        $VIDEOFORMAT                                    !\<br>        queue                                           !\<br>        videoconvert                                    !\<br>        x264enc bitrate=1500 tune=zerolatency speed-preset=2 key-int-max=60 bframes=0 !\<br>        $VIDEOFORMATOUT                                 !\<br>        h264parse                                       !\<br>        rtph264pay                                      !\<br>        rtpbin.send_rtp_sink_0                           \<br>          rtpbin.send_rtp_src_0                         !\<br>          udpsink host=$host port=$port_video_rtp        \<br>          rtpbin.send_rtcp_src_0                        !\<br>          udpsink host=$host port=$port_video_rtcp sync=false async=false<br></font><br></font></div>Debugging output from second failure type:<br><br>$ GST_DEBUG=3 bash rtpbin2screen <br>Setting pipeline to PAUSED ...<br>/GstPipeline:pipeline0/GstUDPSrc:udpsrc0.GstPad:src: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin.GstGhostPad:recv_rtp_sink_0.GstProxyPad:proxypad4: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin/GstRtpSession:rtpsession0.GstPad:recv_rtp_src: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin/GstRtpSsrcDemux:rtpssrcdemux0.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin/GstRtpSession:rtpsession0.GstPad:recv_rtp_sink: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin.GstGhostPad:recv_rtp_sink_0: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"<br>Pipeline is live and does not need PREROLL ...<br>Setting pipeline to PLAYING ...<br>/GstPipeline:pipeline0/GstUDPSrc:udpsrc2.GstPad:src: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)44100\,\ encoding-name\=\(string\)MP4A-LATM"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin.GstGhostPad:recv_rtp_sink_1.GstProxyPad:proxypad6: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)44100\,\ encoding-name\=\(string\)MP4A-LATM"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin/GstRtpSession:rtpsession1.GstPad:recv_rtp_src: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)44100\,\ encoding-name\=\(string\)MP4A-LATM"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin/GstRtpSsrcDemux:rtpssrcdemux1.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)44100\,\ encoding-name\=\(string\)MP4A-LATM"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin/GstRtpSession:rtpsession1.GstPad:recv_rtp_sink: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)44100\,\ encoding-name\=\(string\)MP4A-LATM"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin.GstGhostPad:recv_rtp_sink_1: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)44100\,\ encoding-name\=\(string\)MP4A-LATM"<br>New clock: GstSystemClock<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin/GstRtpJitterBuffer:rtpjitterbuffer0.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ ssrc\=\(uint\)1544968374"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin/GstRtpJitterBuffer:rtpjitterbuffer0.GstPad:src: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ ssrc\=\(uint\)1544968374"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin/GstRtpPtDemux:rtpptdemux0.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ ssrc\=\(uint\)1544968374"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin/GstRtpJitterBuffer:rtpjitterbuffer1.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)44100\,\ encoding-name\=\(string\)MP4A-LATM\,\ ssrc\=\(uint\)2970634256"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin/GstRtpJitterBuffer:rtpjitterbuffer1.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)44100\,\ encoding-name\=\(string\)MP4A-LATM\,\ ssrc\=\(uint\)2970634256"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder1.GstGhostPad:sink.GstProxyPad:proxypad0: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)44100\,\ encoding-name\=\(string\)MP4A-LATM"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder1/GstTypeFindElement:typefind.GstPad:src: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)44100\,\ encoding-name\=\(string\)MP4A-LATM"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder1/GstAacParse:aacparse0.GstPad:sink: caps = "audio/mpeg\,\ mpegversion\=\(int\)4\,\ framed\=\(boolean\)true\,\ channels\=\(int\)2\,\ stream-format\=\(string\)raw"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder1/GstRtpMP4ADepay:rtpmp4adepay0.GstPad:src: caps = "audio/mpeg\,\ mpegversion\=\(int\)4\,\ framed\=\(boolean\)true\,\ channels\=\(int\)2\,\ stream-format\=\(string\)raw"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder1/GstRtpMP4ADepay:rtpmp4adepay0.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)44100\,\ encoding-name\=\(string\)MP4A-LATM"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder1/GstTypeFindElement:typefind.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)44100\,\ encoding-name\=\(string\)MP4A-LATM"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder1.GstGhostPad:sink: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)44100\,\ encoding-name\=\(string\)MP4A-LATM"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin.GstGhostPad:recv_rtp_src_1_2970634256_96.GstProxyPad:proxypad8: caps = "application/x-rtp\,\ media\=\(string\)audio\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)44100\,\ encoding-name\=\(string\)MP4A-LATM"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder2.GstGhostPad:sink.GstProxyPad:proxypad2: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder2/GstTypeFindElement:typefind.GstPad:src: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder2/GstRtpH264Depay:rtph264depay0.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder2/GstTypeFindElement:typefind.GstPad:sink: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder2.GstGhostPad:sink: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"<br>/GstPipeline:pipeline0/GstRtpBin:rtpbin.GstGhostPad:recv_rtp_src_0_1544968374_96.GstProxyPad:proxypad10: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder2/GstH264Parse:h264parse0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ codec_data\=\(buffer\)014d401effe10018674d401eda0280f6c044000003000400000300ca3c58ba8001000468ef3c80\,\ level\=\(string\)3\,\ profile\=\(string\)main\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ framerate\=\(fraction\)25/1\,\ parsed\=\(boolean\)true"<br>Redistribute latency...<br>/GstPipeline:pipeline0/GstDecodeBin:decoder2/avdec_h264:avdec_h264-0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ codec_data\=\(buffer\)014d401effe10018674d401eda0280f6c044000003000400000300ca3c58ba8001000468ef3c80\,\ level\=\(string\)3\,\ profile\=\(string\)main\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ framerate\=\(fraction\)25/1\,\ parsed\=\(boolean\)true"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder2/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ codec_data\=\(buffer\)014d401effe10018674d401eda0280f6c044000003000400000300ca3c58ba8001000468ef3c80\,\ level\=\(string\)3\,\ profile\=\(string\)main\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ framerate\=\(fraction\)25/1\,\ parsed\=\(boolean\)true"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder2/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ codec_data\=\(buffer\)014d401effe10018674d401eda0280f6c044000003000400000300ca3c58ba8001000468ef3c80\,\ level\=\(string\)3\,\ profile\=\(string\)main\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ framerate\=\(fraction\)25/1\,\ parsed\=\(boolean\)true"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder2/GstH264Parse:h264parse0.GstPad:sink: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ codec_data\=\(buffer\)014d401effe10018674d401eda0280f6c044000003000400000300ca3c58ba8001000468ef3c80\,\ level\=\(string\)3\,\ profile\=\(string\)main"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder2/GstRtpH264Depay:rtph264depay0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ codec_data\=\(buffer\)014d401effe10018674d401eda0280f6c044000003000400000300ca3c58ba8001000468ef3c80\,\ level\=\(string\)3\,\ profile\=\(string\)main"<br>/GstPipeline:pipeline0/GstDecodeBin:decoder2/avdec_h264:avdec_h264-0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,\ colorimetry\=\(string\)bt601\,\ framerate\=\(fraction\)25/1"<br>0:00:00.507094004 11710 0x7fc360003230 WARN                 default grammar.y:506:gst_parse_no_more_pads:<decoder2> warning: Delayed linking failed.<br>0:00:00.507143243 11710 0x7fc360003230 WARN                 default grammar.y:506:gst_parse_no_more_pads:<decoder2> warning: failed delayed linking some pad of GstDecodeBin named decoder2 to some pad of GstAudioConvert named audioconvert0<br>WARNING: from element /GstPipeline:pipeline0/GstDecodeBin:decoder2: Delayed linking failed.<br>Additional debug info:<br>./grammar.y(506): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstDecodeBin:decoder2:<br>failed delayed linking some pad of GstDecodeBin named decoder2 to some pad of GstAudioConvert named audioconvert0<br>/GstPipeline:pipeline0/GstDecodeBin:decoder2.GstDecodePad:src_0.GstProxyPad:proxypad11: caps = "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,\ colorimetry\=\(string\)bt601\,\ framerate\=\(fraction\)25/1"<br>0:00:00.538318706 11710      0x16d8de0 WARN                 basesrc gstbasesrc.c:2948:gst_base_src_loop:<udpsrc0> error: Internal data flow error.<br>0:00:00.538357748 11710      0x16d8de0 WARN                 basesrc gstbasesrc.c:2948:gst_base_src_loop:<udpsrc0> error: streaming task paused, reason not-linked (-1)<br>ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data flow error.<br>Additional debug info:<br>gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:<br>streaming task paused, reason not-linked (-1)<br><div><br><div><br></div></div></div>