Questino on Gnuradio as the client and VLC as the server


#1

Hi All,

I am using USRP to receive video streaming, and feed the data to a
socket as
the client. Then, I open a vlc as the server to open the network stream
via
UDP. The code is shown below.

the server

vlc udp://@:2002

the client, which is inserted into benchmark_rx.py in

/gnuradio-example/python/digital
def main():

def rx_callback(ok, payload):

print “ok = %5s pktno = %4d n_rcvd = %4d n_right = %4d” %
(ok,
pktno, n_rcvd, n_right)

    rxdata.append(payload[2:])
    clientHost = 'localhost'           # servername is localhost'
    clientPort = 2002                   # use arbitrary port > 1024
    dgramSock = socket.socket( socket.AF_INET, socket.SOCK_DGRAM ) 

create a UDP socket

    dgramSock.connect((clientHost,clientPort)) # connect to server 

on
the port
for ndx_data in rxdata:
dgramSock.sendto( ndx_data, (clientHost, clientPort) )

send the data

        data = dgramSock.recv(4096)                 # receive up to 

4096
bytes
#print data
dgramSock.close()

.......

My questions are:
1, I don’t think the client(Gnuradio) and the server(VLC) are connected
via
UDP
2, Is it correct that I write the received data to a client UDP socket?
3, If I change the server to the following(don’t use VLC as the server),
I
can play serverfile.mpeg using VLC. However, I don’t want vlc to open
from
file.
serverHost = ‘’
serverPort = 2002
dgramSock = socket.socket( socket.AF_INET, socket.SOCK_DGRAM )
dgramSock.bind( (serverHost, serverPort) )
msggot=[]
while 1:
msg, (addr, port) = dgramSock.recvfrom(4096)
print ‘Server connected by’, addr,port
#print 'Server got ',msg
dgramSock.sendto( msg, (addr, port) )

fd = open(‘serverfile.mpeg’,‘a’)
fd.write(msg)
fd.close
dgramSock.close()

Overall, I want to play the realtime video that I received from USRP.
Can
anyone help me with these questions? I really appreciate.

Thanks,
Brook

View this message in context:
http://www.nabble.com/Questino-on-Gnuradio-as-the-client-and-VLC-as-the-server-tp22130820p22130820.html
Sent from the GnuRadio mailing list archive at Nabble.com.