Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to broadcast video stream on a LAN in real-time?

I'm trying to establish a system capable of broadcasting the screen capture of a pc to several other pcs on a LAN.

So far I managed to install nginx on a Raspberry Pi with the rtmp module and I can stream using the Raspberry as a RTMP Server via OBS. I use VLC to watch the stream.

Here is the problem. The main pc doing the broadcast will be displaying a timer that counts down and potentially camera feeds so it would be ideal to keep the broadcast delay to a minimum (real time?). I currently have a 4-6 seconds delay between what is happening on the screen and the stream and am looking for ways to further reduce it.

  • Is there a way to determine how much of that delay time is due to encoding and how much of it is due to transfer?
  • I am currently capturing at 1080p30 and tried options such as downscaling and minimize network impact to no avail.
  • I read other topics concerning LAN broadcast on this forum and someone did mention that RTMP wasn't a good approach...If so what would be a better approach?
  • Any suggestions are welcome and appreciated. I am mostly interested in free solutions as I have no budget and doing this for free for someone else.
  • I also did look into VLC streaming but I don't want to show the whole screen of the pc as there would be controls that the viewers don't have to see. And the only thing VLC can do about it is to specify which part of the screen to broadcast which doesn't seem like a great solution. I chose OBS because it's the only free broadcasting software that can broadcast a specific window to my knowledge.

Thanks in advance :)

like image 577
Ryuu Avatar asked Mar 25 '15 09:03

Ryuu


People also ask

Can you stream on LAN?

Not only can you stream directly from your phone to Twitch, YouTube, and more, with custom alerts and widgets, but you can also now set up a LAN stream to feed directly into your computer. This allows you to stream your mobile games to your PC or have an on-the-go webcam for walking around your home.

Can you live stream without WiFi?

Yes, you can stream without WiFi. Let's look at a few of the most popular methods to secure network access that is capable of streaming when it's otherwise unavailable.


2 Answers

First I think you are right to use OBS, it's a great project allowing you to capture a lot of things.

If you want to optimize the video speed there are many ways you can try :

  • The first one is to use another RTMP client, VLC is good but it uses too much cache, try this one for example (just set the right rtmp url, clear the NetGroup input and connect),
  • Then you can try another server, I wrote the following tutorial on How to set up your own RTMFP server using MonaServer,
  • And finally you can modify your OBS parameters (I use the "Twitch" parameters which are optimized for real-time).

For me with OBS+MonaServer+my VideoPlayer I have a delay of 2 seconds, that's not real-time but that's already better.

Last thing, OBS is known to add latency on RTMP sessions, I know that it is possible to improve it by modifying the source code of OBS but here it's a little bit tricky...

I hope it will help you! Contact me if you need more informations.

like image 75
thomas Avatar answered Oct 27 '22 01:10

thomas


You need to compress and decompress. You are using all the bandwidth on a Gigabit Ethernet connection. If your total distance is less than 15 feet any HDMI cable will work. For distances longer than 15 feet make sure you get a certified cable (some can run up to 45ft w/o signal boosting). VGA will run longer distances as will DVI.

OR, you could drop to 720P and leave enough bandwidth to get the job done.

like image 38
MCatCTS Avatar answered Oct 26 '22 23:10

MCatCTS