Possible problem with rtpbin when using AAC?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Possible problem with rtpbin when using AAC?

Peter Maersk-Moller-2
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)



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Possible problem with rtpbin when using AAC?

Sebastian Dröge-3
On Di, 2016-05-10 at 12:47 +0200, Peter Maersk-Moller wrote:

> 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:
> A video window pops up showing the first frame, but no more frames
> are shown and no audio is coming out.
> [...]
This looks like some general (gst-launch caused) linking confusion. Can
you simplify your scripts to only do audio? I would guess that the
problem with AAC disappears then. Can you confirm?

And I assume the pipelines also works fine if you remove the audio
parts all together and only have video?

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Possible problem with rtpbin when using AAC?

Peter Maersk-Moller-2
Hi Sebastian.

Video works fine alone (also works when MP3 audio is included).
Audio alone works for MP3. Audio never gets to play when using AAC. So it does not work for AAC.

Audio alone scripts are included for you to verify. With rtpbin, they can now hardly be stripped further.
Player script:

#!/bin/bash
port_base=14100
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 caps=$audio_caps port=$port_audio_rtp !\
        rtpbin.recv_rtp_sink_1                           \
          rtpbin.                                       !\
          decoder2.                                      \
          udpsrc port=$port_audio_rtcp                  !\
          rtpbin.recv_rtcp_sink_1                        \
          decodebin name=decoder2 ! audioconvert        !\
          audioresample ! autoaudiosink


Encoder script:
#!/bin/bash

port_base=14000
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"
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


On Tue, May 10, 2016 at 12:54 PM, Sebastian Dröge <[hidden email]> wrote:
On Di, 2016-05-10 at 12:47 +0200, Peter Maersk-Moller wrote:
> 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:
> A video window pops up showing the first frame, but no more frames
> are shown and no audio is coming out.
> [...]

This looks like some general (gst-launch caused) linking confusion. Can
you simplify your scripts to only do audio? I would guess that the
problem with AAC disappears then. Can you confirm?

And I assume the pipelines also works fine if you remove the audio
parts all together and only have video?

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Possible problem with rtpbin when using AAC?

Sebastian Dröge-3
On Di, 2016-05-10 at 13:12 +0200, Peter Maersk-Moller wrote:
> Hi Sebastian.
>
> Video works fine alone (also works when MP3 audio is included).
> Audio alone works for MP3. Audio never gets to play when using AAC.
> So it does not work for AAC.
>
> Audio alone scripts are included for you to verify. With rtpbin, they
> can now hardly be stripped further.

Your scripts are using different ports as base: 14000 and 14100

After fixing this, the problem becomes that aacparse can't do anything
with the output of the depayloader for whatever reason. It consumes
buffers but never outputs anything.

Can you file a bug with simplified and fixed up scripts? E.g. you don't
need the audioparse, or the various capsfilters on the sender.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Possible problem with rtpbin when using AAC?

Peter Maersk-Moller-2
Hi Sebastian.

Right, the pasted script had a port mismatch although what I tested had the right ports.
Anyway, I have narrowed it down to this, headline: Streaming AAC using RTP does not work and it seems not related to using rtpbin or at least not that alone. My question to you is then which module should I file the bug under?

I have 3 sender scenarios:

$ AUDIO='audio/x-raw,rate=48000,channels=2'
$ gst-launch-1.0 -v audiotestsrc is-live=1 ! $AUDIO ! faac ! queue ! rtpmp4apay ! udpsink host=127.0.0.1 port=14002
$ gst-launch-1.0 -v audiotestsrc is-live=1 ! $AUDIO ! avenc_aac  ! queue ! rtpmp4apay ! udpsink host=127.0.0.1 port=14002
$ gst-launch-1.0 -v audiotestsrc is-live=1 ! $AUDIO ! avenc_aac compliance=-2 ! queue ! rtpmp4apay ! udpsink host=127.0.0.1 port=14002

On the receiving end, you can narrow it down to this:

gst-launch-1.0 -v udpsrc port=14002 caps="application/x-rtp,media=audio,payload=96,clock-rate=48000,encoding-name=MP4A-LATM" do-timestamp=1 ! rtpmp4adepay ! aacparse ! identity silent=0 ! autoaudiosink

Then you will see no data coming out from aacparse. You can replace aacparse with avdec_aac or decodebin, decodebin probably uses avdec_aac. Using identity before aacparse or avdec_aac reveals DTS and PTS starting nicely from 0.

So my question is which module should I file it under? Could be something with rtpmp4apay/depay ?


Regards
Peter

On Wed, May 11, 2016 at 8:43 AM, Sebastian Dröge <[hidden email]> wrote:
On Di, 2016-05-10 at 13:12 +0200, Peter Maersk-Moller wrote:
> Hi Sebastian.
>
> Video works fine alone (also works when MP3 audio is included).
> Audio alone works for MP3. Audio never gets to play when using AAC.
> So it does not work for AAC.
>
> Audio alone scripts are included for you to verify. With rtpbin, they
> can now hardly be stripped further.

Your scripts are using different ports as base: 14000 and 14100

After fixing this, the problem becomes that aacparse can't do anything
with the output of the depayloader for whatever reason. It consumes
buffers but never outputs anything.

Can you file a bug with simplified and fixed up scripts? E.g. you don't
need the audioparse, or the various capsfilters on the sender.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Possible problem with rtpbin when using AAC?

Sebastian Dröge-3
On Mi, 2016-05-11 at 13:01 +0200, Peter Maersk-Moller wrote:

> So my question is which module should I file it under? Could be
> something with rtpmp4apay/depay ?

That would be my best guess so far, yes.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Possible problem with rtpbin when using AAC?

Peter Maersk-Moller-2
Hi Sebastien.

Bug has been filed as https://bugzilla.gnome.org/show_bug.cgi?id=766267

It has been marked as a blocker, since RTP streaming of MPEG-4 Audio is kind of a must.
I have also corrected the receiver script as an autoaudiosink can't receive output from aacparse ... obviously.

Thanks for the help.

Regards
Peter

On Wed, May 11, 2016 at 1:09 PM, Sebastian Dröge <[hidden email]> wrote:
On Mi, 2016-05-11 at 13:01 +0200, Peter Maersk-Moller wrote:

> So my question is which module should I file it under? Could be
> something with rtpmp4apay/depay ?

That would be my best guess so far, yes.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel