I need to stream
raspivid video via UDP instead TCP in a multicast fashion.
raspivid -w 640 -h 480 -vf -ih -fps 30 -n -o udp://dest_address:12345
I can stream the video trough UDP on
dest_address host where I can play it with:
vlc udp://@:12345 :demux=h264... it works fine.
Unluckly I need a server like approach:
- In the real case I don't know host
dest_addressbut I know its network address (and mask and so on) and therefore broadcast address of such net;
- At least a second host should be allowed to connect and receive the same stream;
- I need it to be as much realtime as possibile (at least on the first host connected host).
the command line above does not fit my need (
raspivid will not listen for UDP connections).
I tried using
netcat in this way:
raspivid -w 640 -h 480 -vf -ih -fps 30 -n -o - | nc -lu 12345
and then tried to stream it trough
vlc (tried several urls and command line options) but nothing seems to work.
I previoulsy used
netcat to simulate a TCP video server in this way
raspivid -w 640 -h 480 -vf -ih -fps 30 -n -o - | nc -l -p 12345
and it works fine but it only accept a single client.
P.S. I'm not an expert in TCP/IP and/or UDP networking (and maybe I should have misunderstood some basic concept) but I'm willing to learn.