0

I'm streaming Raspberry's Pi h264-encoded uv4l video device with netcat like this:

cat /dev/video0 | nc -klp 2222

On the "client-side" I can view the stream with:

mplayer -fps 30 -demuxer h264es ffmpeg://tcp://rpi.local:2222

How can I turn this "client-side" into some kind of streaming server for multiple clients? The stream is "fine as it is", no need to re-encode it, just pass it thru to multiple clients.

With all the flexibility of uv4l could I maybe fake somehow a local /dev/video from my network stream?

1

One way is to just use the native UV4L Streaming Server. According to this tutorial, you can open many raw H264 streams at the same time over HTTP or HTTPS. The tutorial shows the following command using vlc client, but you can adapt it to mplayer.

cvlc http://raspberrypi:8080/stream/video.h264 --demux h264

In the tutorial, it's written that you can open one client "at a time", but this is no longer a limitation, provided that you also make sure that inline-headers = yes is specified in the configuration file. The advantage in using the Streaming Server is that it's the same OS process as the underlying UV4L driver and that you can control the max number of HTTP clients.

  • Thx for your answer, but my goal is to keep just one Raspberry Pi connection (to put the heavy client-handling on second machine). – madneon Jan 30 '18 at 15:51
0

One way to achieve this is to use ncat, that comes with nmap package:

ncat rpi.local 2222 | ncat -kl 4444

This will listen to multiple client connections on port 4444. This method is as lightweight as the methods from question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.