OBS Studio OBS-Studio: Send an UDP Stream to a second PC using OBS [Deleted]

Status
Not open for further replies.

jwh

New Member
Jack0r submitted a new resource:

OBS-Studio: Send an UDP Stream to a second PC using OBS - The custom ffmpeg output allows us to use different output protocols, here is one example.



Read more about this resource...
2 reasons I can think of:
1 - RTMP has some overhead being a protocol which is a superset of UDP. IE, it has more stuff in the UDP datagram packets so you get less frames of video/audio per burst. As such, frame losses due to dropped UDP packets via RTMP are more drastic and will cause higher corruption of the stream.
2 - You don't need a server to broadcast UDP. The tutorial SHOULD have walked you through a process of setting up an output to a UDP multicast IP (i.e., udp://224.0.0.1:9999). This special subnet is capable of being sent and received on a local network. For RTMP, you need something to wrap the UDP packets with the RTMP protocol for proper slicing due to how RTMP allows seeking of previous uncached data.

Feel free to ask more questions, but I might be slow-replying.


EDIT:

I just actually read thoroughly, and he's technically doing it wrong by pointing to his own IP (or really any Class-C subnet). This sets up a SINGLE cast on UDP, which while it WILL work, will not allow multiple clients to connect to the stream.

Instead, use an IP on the multicast subnet: https://en.wikipedia.org/wiki/Multicast_address
I showed an example above.

Then when listening on other clients (i.e., vlc) use udp://@224.0.0.1:9999 (or whichever ip you choose).


Goodmorning,

I followed the guide and I managed to stream to a 2nd pc on the network.
Unfortunately I was not able to stream in multicast.
Please consider that
I used udp://224.0.0.1:9999 at the file path and udp://@224.0.0.1:9999 on vlc but steaming did not work
then I tried to use udp://192.168.0.10:9999 in the file path and udp://@:9999 on vlc it worked.

I am using Windows: is there any setting I should do somewhere else? Firewall or what else?

Thanks a lot
jonni
 

Boildown

Active Member
A specific subset of IPv4 IPs are considered "multicast". 192.168.*.* is not among them, that's unicast. So that will work for sending a stream point to point, but it won't work to send to multiple devices.

The multicast range is from 224.0.0.0 to 239.255.255.255. But generally speaking, you should stick to 239.*.*.* because the others can be reserved for other things. For example, the IP you chose isn't routable outside the network it resides on. More info: https://en.wikipedia.org/wiki/Multicast_address#IPv4

TL;DR: To minimize the risk of problems, stick to 239.*.*.* IPs for multicast, unless you really know what you're doing.

P.s. If you already knew all this, and nothing in 239. /8 works either, then I'd guess you need to enable multicast on your switch.
 
Last edited:

jwh

New Member
A specific subset of IPv4 IPs are considered "multicast". 192.168.*.* is not among them, that's unicast. So that will work for sending a stream point to point, but it won't work to send to multiple devices.

The multicast range is from 224.0.0.0 to 239.255.255.255. But generally speaking, you should stick to 239.*.*.* because the others can be reserved for other things. For example, the IP you chose isn't routable outside the network it resides on. More info: https://en.wikipedia.org/wiki/Multicast_address#IPv4

TL;DR: To minimize the risk of problems, stick to 239.*.*.* IPs for multicast, unless you really know what you're doing.

P.s. If you already knew all this, and nothing in 239. /8 works either, then I'd guess you need to enable multicast on your switch.

Thanks for replay...
I used udp://239.0.0.1:9999 at the file path and udp://@239.0.0.1:9999 on vlc but steaming did not work.
I am trying to multicast over wifi, so I should probably see if the multicast is enabled on my wify modem/router, right?

Thanks
jonni
 

Roc Ren

New Member
Hello. Thank you very much for sharing this methods with us.
May I ask if there is a way to send the udp streaming to computers under external routers? I have port forwarding set up, but since the file location already contains a port, in your example: ":9999", can I still add a port forward before it?

Thanks again!
 

AdamPRO

New Member
Hi, i have a big problem because when I record minecraft, when i move my mouse its starting to cut please help thanks.
 

fahemplitwit

New Member
Should this function still be operational? I've spent several hours tinkering without success.. I'm using Windows 7 and Arch linux.

I've made the recommended setting changes on my netgear switch(es).

I'm using udp://239.0.0.1:9000 and have tried several different ports and IPs in the 239. range.

Neither machine has an operational firewall.

I did attempt to use the NDI plugin in first, but on the Arch machine OBS refuses to open if it's installed. I've uninstalled and reinstalled OBS after uninstalling the NDI packages.

I can't connect to the stream from either machine. Both machines are on the same switch. I've attempted recording to a URL on each machine. It would make more sense if 1 worked and the other didn't, but neither work at all.

I've bound it to my main NIC in advanced settings. And also left the setting at "default".

I didn't think something like that was out of my expertise but, it's really causing me frustration. The instructions seem simple enough and I can't see what I am missing.
 

Boildown

Active Member
Can you open the multicast stream on the same PC you're creating it on? It should always work there, if the multicast exists and the player is working right.
 

Kudalyn

New Member
Hello! I'm hoping to get some help, because myself and my fiancee have exhausted all we know to do.

(tl;dr) I've had this set up working before, working just fine. Then suddenly it stopped... but quickly after that we tried the NDI output version and that worked great too! Even better, for it was easier on my Surface Pro to output.
Then my motherboard/processor melted, and I had to replace both with a older motherboard/processor combo that we had laying around for emergencies. That processor is too old to read NDI outputs, so we looked to try the UDP stream option again for my art.
(tl;dr over)

So once again, my problem is that for some reason, the VLC on my main PC absolutely refuses to show any video of any form over the network. The biggest kicker is that every other pc/tablet on our network can read the UDP stream when we're testing it, EXCEPT mine.
We've tried everything we can think of, my fiancee spending many hours at my pc trying to figure out why it's suddenly not working. I've gone through this thread trying out other people's suggestions on what to change, and not a single one works.

My main pc's VLC can find and read the network stream, but no video will ever show. I REALLY need to figure out what the heck is wrong, for I host art streams regularly for my career and not being able to stream is a big damper on my motivation and enjoyment.

If anyone has heard of this happening and can possibly give a few pointers, I'd greatly appreciate it. I really don't want to have to drop a ton of money on a new motherboard/processor right now when it'd be a risky expense.
Thank you.
 

Boildown

Active Member
We really have nothing to go on to answer your questions, compounded by it not even being an OBS problem, but a VLC problem or network problem, apparently.

Which PC generates the stream, and how is it doing it? Unicast or multicast? Via OBS? Where's the logs? Can VLC play back the stream on the same PC it is being created on?

Which other PCs on your network can play back the stream? How are they getting it, unicast or multicast, or via OBS?

Are you sure the stream is even getting to the PC that can't play it back? How are you sure?
 

Kudalyn

New Member
We really have nothing to go on to answer your questions, compounded by it not even being an OBS problem, but a VLC problem or network problem, apparently.

Which PC generates the stream, and how is it doing it? Unicast or multicast? Via OBS? Where's the logs? Can VLC play back the stream on the same PC it is being created on?

Which other PCs on your network can play back the stream? How are they getting it, unicast or multicast, or via OBS?

Are you sure the stream is even getting to the PC that can't play it back? How are you sure?

Sorry for the delay.
My Surface Pro 4 is the pc that is generating the stream, using this UDP streaming method via OBS. I use multicast. I do not have the logs on hand at the moment.
I have not tried using the Surface to play back the stream, but using a separate tablet and a secondary PC (not my streaming PC) both are able to view the stream via VLC no problem. I've tested it multiple times. They are getting it via multicast and VLC, following the instructions on this forum.

The only PC that is NOT getting video from the stream is my streaming PC.
I am sure that the stream is getting to my streaming PC because A: this whole method has worked before a few months ago and B: when I open the network stream in VLC it loads it properly and the timer for how long it's been connected/playing is running, but there is no video at all. Not just a black screen, but the default 'black screen with the VLC logo' in the middle. As if it's only getting audio, not video, but I do not play audio over the network stream.

I'm sorry if the first message was a bit unclear, I've just been rather frustrated trying to fix this problem and continuously hitting dead ends. The fact that every other pc on my network can play the stream BUT the one I actually want to is very frustrating.
 

Boildown

Active Member
Solve the problem with VLC being unable to display the video on the streaming PC first. That should work. Can you record the UDP stream on one of the computer where it works, copy the file over, and play it in VLC on the streaming PC, and have it work correctly? If not I'd suspect some sort of missing codec on that computer (install the codec). Maybe its set to decode via hardware acceleration that doesn't exist on that PC. Maybe the VLC version is different. Raise the issue on the VLC forums. Use wireshark and capture the incoming stream to make sure its really there (video and audio) as a sanity check. Obviously make sure your graphics drivers are up to date.

Once you can get the video on your streaming PC, what do you plan on doing with it? What kind of streaming PC is it? Is it hardwired? I don't think multicast propagates over wireless (wireshark capture would resolve this question definitively).
 

Mark Weiss

Member
I went through this exercise and successfully streamed to another PC on the same LAN.

Now what I'd like to do is take it to the next level: streaming multicast over the internet. (elegant would be to embed the video in a HTML5 web page on my IIS7 web server).
 

LPTfun

New Member
First of all Thx for that How to over here.
I have a might stupid question. What do i have to use for an ip adress if i want to send the signal from computer a to b via The Internet ?
What do i need for that ? Upload downstream etc. Thx for your help :)
 

Boildown

Active Member
First of all Thx for that How to over here.
I have a might stupid question. What do i have to use for an ip adress if i want to send the signal from computer a to b via The Internet ?
What do i need for that ? Upload downstream etc. Thx for your help :)

Probably just the remote computer's IP address and bandwidth plus some margin that exceeds the agggregate bitrate of the streams that you're sending.
 

LPTfun

New Member
Probably just the remote computer's IP address and bandwidth plus some margin that exceeds the agggregate bitrate of the streams that you're sending.

Ok so i use The Wan ip of the Computer where i want to send it. That sounds cool. Thx
 

glory

New Member
Hey guys,

I'm trying to figure out why my UDP local stream doesn't work but I guess some advices would help.

I managed to get a connection between my OBS and VLC but I've got no image and a super delayed and stuttering sound.

When I use the same settings and record as a file, it's super smooth, no frame skipping nor sound stuttering.

Could it be a router / switch issue ? (I use a basic instalation with my isp router > small 5 port switch > PC)

I've tried both unicast and multicast and encountered the same issue. I i'm trying to get it to work with same Broadcasting and Receiving PC.

If you have ideas, i'll be glad to hear, did a lot of googling already
 
Status
Not open for further replies.
Top