Possible problem with rtpbin when using AAC?
Peter Maersk-Moller
pmaersk at gmail.com
Tue May 10 10:47:18 UTC 2016
Hi.
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.
When using AAC, the player script fails in one of the following ways:
1. A video window pops up showing the first frame, but no more frames
are shown and no audio is coming out.
2. Failing to connect decodebin to audioconvert producing this
WARNING: from element /GstPipeline:pipeline0/GstDecodeBin:decoder2: Delayed
linking failed.
Additional debug info:
./grammar.y(506): gst_parse_no_more_pads ():
/GstPipeline:pipeline0/GstDecodeBin:decoder2:
failed delayed linking some pad of GstDecodeBin named decoder2 to some pad
of GstAudioConvert named audioconvert0
/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"
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data
flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop ():
/GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming task paused, reason not-linked (-1)
*Player script:*
#!/bin/bash
port_base=14100
port_video_rtp=$port_base
port_video_rtcp=$(($port_base+1))
port_audio_rtp=$(($port_base+2))
port_audio_rtcp=$(($port_base+3))
video_caps='application/x-rtp,media=video,payload=96,clock-rate=90000,encoding-name=H264'
if [ X$1 = Xmp3 ] ; then
audio_caps='application/x-rtp,media=audio,payload=14,clock-rate=90000,encoding-name=MPA'
else
audio_caps='application/x-rtp,media=audio,payload=96,clock-rate=44100,encoding-name=MP4A-LATM'
fi
gst-launch-1.0 -v rtpbin name=rtpbin buffer-mode=slave \
udpsrc do-timestamp=1 caps=$video_caps port=$port_video_rtp !\
rtpbin.recv_rtp_sink_0 \
rtpbin. !\
decoder1. \
udpsrc port=$port_video_rtcp !\
rtpbin.recv_rtcp_sink_0 \
udpsrc caps=$audio_caps port=$port_audio_rtp typefind=1 !\
rtpbin.recv_rtp_sink_1 \
rtpbin. !\
decoder2. \
udpsrc port=$port_audio_rtcp !\
rtpbin.recv_rtcp_sink_1 \
decodebin name=decoder1 !\
videoconvert ! autovideosink \
decodebin name=decoder2 ! audioconvert !\
audioresample ! autoaudiosink
*The encoder script is here:*
#!/bin/bash
port_base=14000
port_video_rtp=$port_base
port_video_rtcp=$(($port_base+1))
port_audio_rtp=$(($port_base+2))
port_audio_rtcp=$(($port_base+3))
host=127.0.0.1
AUDSRC="audiotestsrc is-live=1"
channels=2
rate=44100
if [ $1 = "mp3" ] ; then
AUDIOENCODER="lamemp3enc bitrate=128 cbr=1"
AUDIOPAY="rtpmpapay"
AUDIOPARSE=queue
AUDIOFORMATOUT="audio/mpeg,mpegversion=1"
else
AUDIOENCODER="faac bitrate=128000"
AUDIOPAY="rtpmp4apay"
AUDIOPARSE=aacparse
AUDIOFORMATOUT="audio/mpeg,mpegversion=4,stream-format=raw"
fi
AUDIOFORMAT="audio/x-raw,format=S16LE,layout=interleaved,rate=$rate,channels=$channels"
VIDSRC="videotestsrc is-live=1"
width=640
height=480
framerate=25/1
VIDEOFORMAT="video/x-raw,format=I420,pixel-aspect-ratio=1/1,interlace-mode=progressive,width=$width,height=$height,framerate=$framerate"
VIDEOFORMATOUT="video/x-h264,alignment=au,stream-format=byte-stream,profile=main"
gst-launch-1.0 -v rtpbin name=rtpbin \
$AUDSRC !\
queue !\
$AUDIOFORMAT !\
audioparse rate=$rate channels=$channels !\
audioconvert !\
$AUDIOENCODER !\
$AUDIOPARSE !\
$AUDIOFORMATOUT !\
$AUDIOPAY !\
rtpbin.send_rtp_sink_1 \
rtpbin.send_rtp_src_1 !\
udpsink host=$host port=$port_audio_rtp \
rtpbin.send_rtcp_src_1 !\
udpsink host=$host port=$port_audio_rtcp sync=false async=false \
$VIDSRC !\
$VIDEOFORMAT !\
queue !\
videoconvert !\
x264enc bitrate=1500 tune=zerolatency speed-preset=2 key-int-max=60
bframes=0 !\
$VIDEOFORMATOUT !\
h264parse !\
rtph264pay !\
rtpbin.send_rtp_sink_0 \
rtpbin.send_rtp_src_0 !\
udpsink host=$host port=$port_video_rtp \
rtpbin.send_rtcp_src_0 !\
udpsink host=$host port=$port_video_rtcp sync=false async=false
Debugging output from second failure type:
$ GST_DEBUG=3 bash rtpbin2screen
Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstUDPSrc:udpsrc0.GstPad:src: caps =
"application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\
clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"
/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"
/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"
/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"
/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"
/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"
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
/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"
/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"
/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"
/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"
/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"
/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"
New clock: GstSystemClock
/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"
/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"
/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"
/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"
/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"
/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"
/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"
/GstPipeline:pipeline0/GstDecodeBin:decoder1/GstAacParse:aacparse0.GstPad:sink:
caps = "audio/mpeg\,\ mpegversion\=\(int\)4\,\ framed\=\(boolean\)true\,\
channels\=\(int\)2\,\ stream-format\=\(string\)raw"
/GstPipeline:pipeline0/GstDecodeBin:decoder1/GstRtpMP4ADepay:rtpmp4adepay0.GstPad:src:
caps = "audio/mpeg\,\ mpegversion\=\(int\)4\,\ framed\=\(boolean\)true\,\
channels\=\(int\)2\,\ stream-format\=\(string\)raw"
/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"
/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"
/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"
/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"
/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"
/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"
/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"
/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"
/GstPipeline:pipeline0/GstDecodeBin:decoder2.GstGhostPad:sink: caps =
"application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\
clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"
/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"
/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"
Redistribute latency...
/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"
/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"
/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"
/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"
/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"
/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"
0:00:00.507094004 11710 0x7fc360003230 WARN default
grammar.y:506:gst_parse_no_more_pads:<decoder2> warning: Delayed linking
failed.
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
WARNING: from element /GstPipeline:pipeline0/GstDecodeBin:decoder2: Delayed
linking failed.
Additional debug info:
./grammar.y(506): gst_parse_no_more_pads ():
/GstPipeline:pipeline0/GstDecodeBin:decoder2:
failed delayed linking some pad of GstDecodeBin named decoder2 to some pad
of GstAudioConvert named audioconvert0
/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"
0:00:00.538318706 11710 0x16d8de0 WARN basesrc
gstbasesrc.c:2948:gst_base_src_loop:<udpsrc0> error: Internal data flow
error.
0:00:00.538357748 11710 0x16d8de0 WARN basesrc
gstbasesrc.c:2948:gst_base_src_loop:<udpsrc0> error: streaming task paused,
reason not-linked (-1)
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data
flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop ():
/GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming task paused, reason not-linked (-1)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160510/d766256d/attachment-0001.html>
More information about the gstreamer-devel
mailing list