title: Relay RTP Stream with NodeJS
body: <p>I'm attempting to relay RTP packets from a Raspberry Pi to my Macbook Air using NodeJS. </p>
  
  <p>Here is the gstreamer command I'm using to create the video feed on my Raspberry Pi:</p>
  
  <pre><code>gst-launch-1.0 rpicamsrc bitrate=1000000 \
      ! 'video/x-h264,width=640,height=480' \
      ! h264parse \
      ! queue \
      ! rtph264pay config-interval=1 pt=96 \
      ! gdppay \
      ! udpsink host=10.0.0.157 port=3333
  </code></pre>
  
  <p>I then receive the datagrams from my Raspberry Pi on my Mac via NodeJS and forward them to port 5000 on my Mac with the following code:</p>
  
  <pre><code>var udp = require('dgram');
  var server = udp.createSocket('udp4');
  
  server.on('message',function(msg,info){
      server.send(msg,5000,'0.0.0.0', function(){
  
      });
  });
  
  server.bind(3333);
  </code></pre>
  
  <p>Here is the gstreamer command I run on my mac to receive the RTP datagram stream on port 5000:</p>
  
  <pre><code>gst-launch-1.0 udpsrc port=5000 \
      ! gdpdepay \
      ! rtph264depay \
      ! avdec_h264 \
      ! videoconvert \
      ! osxvideosink sync=false
  </code></pre>
  
  <p>The stream works fine going directly from the Raspberry Pi to gstreamer on port 5000, however, when I attempt to use the NodeJS app as the intermediary to forward the packets I receive the following error from gstreamer on my Mac:</p>
  
  <pre><code>ERROR: from element /GstPipeline:pipeline0/GstGDPDepay:gdpdepay0: Could not decode stream.
  Additional debug info:
  gstgdpdepay.c(490): gst_gdp_depay_chain (): /GstPipeline:pipeline0/GstGDPDepay:gdpdepay0:
  Received a buffer without first receiving caps
  </code></pre>
  
  <p>Is there a way in which I can use NodeJS as an intermediary to forward RTP packets to a gstreamer client?</p>