Gstreamer sender and receiver via UDP/TCP on Jetson TX1
<p>I'd like to send and receive video frames via UDP or TCP using Gstreamer on Jetson TX1. </p>

<p>Seemingly, I can send video frames as below.</p>

<p>Sender:  </p>

<pre><code>gst-launch-1.0 nvcamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1024, height=(int)720, format=(string)I420, framerate=(fraction)30/1' !  nvvidconv flip-method=2 ! udpsink host=&lt;BCast IP addr&gt; auto-multicast=true port=8089
</code></pre>

<p>Receiver: </p>

<pre><code>gst-launch-1.0 -v udpsrc port=8089 ! ... ! nvoverlaysink -e
</code></pre>

<p>UPDATE: This seemed fine, but, still black frames on receiver.</p>

<pre><code> gst-launch-1.0 -v udpsrc port=8089 ! capsfilter caps='video/x-raw(memory:NVMM),width=244,height=244, format=I420, framerate=20/1' ! nvoverlaysink -e
</code></pre>

<p>I don't know what filters needs to be added on "Receiver" side. 
(I tried "videoparse",but got error: "videoparse: event not found")
Also, Is there a way to capture each video frame (image) using python script? 
Ultimately, I'd like to capture each frames in jpeg or png format using python script. 
I can test whether a receiver can get data from sender (video src) but, still have issues mentioned above. </p>

<pre><code>import socket
import sys
import time

HOST = ''   # Symbolic name meaning all available interfaces
PORT = 8089 # Arbitrary non-privileged port

# Datagram (udp) socket
try :
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    print 'Socket created'
except socket.error, msg :
    print 'Failed to create socket. Error Code : ' + str(msg[0]) + ' Message ' + msg[1]
    sys.exit()


# Bind socket to local host and port
try:
    s.bind((HOST, PORT))
except socket.error , msg:
    print 'Bind failed. Error Code : ' + str(msg[0]) + ' Message ' + msg[1]
    sys.exit()

numFrames = 0
while 1:
    # receive data from client (data, addr)
    d = s.recvfrom(4096)
    data = d[0]
    addr = d[1]

    if not data:
        break

    reply = 'OK...' + data

    s.sendto(reply , addr)
    print 'Message[' + addr[0] + ':' + str(addr[1]) + '] - ' + data.strip()
</code></pre>