<div dir="ltr"><div><div><div><div><div>Hi<br><br></div>Using a named pipe is notoriously difficult to get to work. The following pipeline using unnamed pipe works.<br><br>gst-launch-1.0 audiotestsrc is-live=1 ! audioconvert ! audioresample ! mulawenc ! rtppcmupay ! fdsink fd=3 3>&1 1>&2 | gst-launch-1.0 fdsrc fd=0 !  "application/x-rtp, media=(string)audio, clock-rate=(int)8000, encoding-name=(string)PCMU" ! queue ! rtpjitterbuffer ! rtppcmudepay ! mulawdec ! queue ! pulsesink  <br><br></div>However that won't get you where you say you want to go. However worth noting is that using fdsrc and fdsink is easy to get to work.<br><br></div>I use xinetd (inetd's replacement). It will listen for UDP packets on a port and start up a process and forward these packets to the stdin of the process. The process can then use GStreamer's fdsrc to receive the packets. You pipeline can use chroot to sandbox it if set up corrrectly and xinetd can be setup to only accept packets from the IP addresses you define.<br><br></div>I use this xinetd configuration (place it in /etc/xinetd.d/something-audio)<br><br>service snowmix-audio-feed-udp-1-1<br>{<br>        disable         = yes<br>        type            = UNLISTED<br>        id              = snowmix-audio-feed-udp-1-1-stream<br>        socket_type     = dgram<br>        protocol        = udp<br>        user            = stream<br>        wait            = yes<br>        instances       = 1<br>        server          = /home/stream/Projects/Snowmix-0.5.2/xinetd/xinetd-audio-feed<br>        #server_args    = port format rate channels<br>        server_args     = 9100 vorbis/rtp 44100 1<br>        port            = 9100<br>        only_from       = <a href="http://127.0.0.1/32">127.0.0.1/32</a> <a href="http://192.168.0.0/16">192.168.0.0/16</a><br>}<br><br></div>When xinetd receives a udp packet on port 9100, it will here execute the script  /home/stream/Projects/Snowmix-0.5.2/xinetd/xinetd-audio-feed with the 4 arguments "9100 vorbis/rtp 44100 1"<div><div><br></div><div>In my case, my script uses the arguments to setup a pipeline suitable for decoding and the execute the pipeline using "fdsrc fd=0" as the source of the stream.<br><br></div><div>I usually use an audio encoding and a packet format suitable and robust for streaming. You use ulaw. Some may say that it is not the obvious first choice for a robust streaming, but if it works for you and you are happy about it ...<br><br><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 25, 2016 at 12:11 PM,  <span dir="ltr"><<a href="mailto:wsnark@tuta.io" target="_blank">wsnark@tuta.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div>
Hi,<br><br>I'm trying to build a GStreamer-based RTP receiver in a sandboxed architecture:<br>- A "listener" process listens at UDP port and redirect the stream to receiver<br>- "Receiver" process runs in a sandbox without network access, gets data from "listener" over a pipe.<br><br>The reason for such architecture is increased security - so that vulnerable parsing code is run with minimum privileges.<br><br>At prototyping phase I'm trying to create a PoC using "gst-launch-1.0", but I cannot find a way to create a working pipeline to play RTP stream from a pipe instead of udpsrc.<br><br>For example, usual udpsrc receiving pipeline that works:<br>gst-launch-1.0 udpsrc  port=3000 caps="application/x-rtp, media=(string)audio, clock-rate=(int)8000, encoding-name=(string)PCMU" ! rtppcmudepay ! mulawdec ! pulsesink<br><br>Corresponding sending part is <br>gst-launch-1.0 filesrc location="test.wav" ! wavparse ! audioconvert ! audioresample ! mulawenc ! rtppcmupay ! udpsink host=127.0.0.1 port=3000<br><br>Changing udpsrc to filesrc doesn't work:<br>gst-launch-1.0 filesrc location="/tmp/pipe" !  "application/x-rtp, 
media=(string)audio, clock-rate=(int)8000, encoding-name=(string)PCMU" !
 rtppcmudepay ! mulawdec ! pulsesink<br><br>Sending part: <br>gst-launch-1.0 filesrc location="test.wav" ! wavparse ! audioconvert ! audioresample ! mulawenc ! rtppcmupay ! filesink location=/tmp/pipe<br><br>The stream is actually played, but just garbled sound. Error output:<br>WARNING: from element /GstPipeline:pipeline0/<wbr>GstRtpPcmuDepay:rtppcmudepay0: Could not decode stream.<br>Additional debug info:<br>gstrtpbasedepayload.c(503): gst_rtp_base_depayload_handle_<wbr>buffer (): /GstPipeline:pipeline0/<wbr>GstRtpPcmuDepay:rtppcmudepay0:<br>Received invalid RTP payload, dropping<br><br>If I capture incoming stream to file, then I'm unable to play it either (same behavior). If I remove RTP elements from the pipeline, raw PCMU is played fine.<br><br>So my questions are:<br>1. Is it possible to play RTP stream without udpsrc using gst-launch-1.0?<br>2. Is it possible to implement this in code, in own application?<br><br>Thanks,<br>Wire Snark<br><br>  </div>

<br>______________________________<wbr>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.<wbr>freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-<wbr>devel</a><br>
<br></blockquote></div><br></div>