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

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

Instead of using OBS in the usual way of sending out an rtmp stream, the custom ffmpeg output offers us even more output protocols that we can use. In this guide I will use UDP as an example. (A full list of supported protocols can be found here: https://www.ffmpeg.org/ffmpeg-protocols.html)

First we of course have to configure OBS-Studio:
  • Settings -> Output -> Output Mode -> Advanced
    • Recording -> Type -> Custom Output (FFmpeg)
    • FFmpeg Output Type -> Output to URL
    • File path or URL -> udp://
      This is a multicast address which means any pc on your local network can receive the stream. A different port can be used.
      Alternatively you can directly send to just one PC in your system by using his IP, for example: udp://
      You can use any port that is free and accessible on the PC's you want to use.
    • Container Format -> Depends on the protocol, for udp it would be mpegts
    • Video Bitrate -> 15000 or higher (depends on your encoder)
    • Audio Bitrate -> 128 or higher (depends on your encoder)
    • Video and Audio Encoder will be limited by the used container but we can luckily unlock other Encoder for our purpose:
      Activate the checkbox "Show all codecs"
      Be aware, some combinations and codecs will not work for streaming! You will have to test to find your best combination.
    • Video Encoder -> libx264 / h264_nvenc (if you have an nvidia gpu) or other codecs can be used
    • Audio Encoder -> AAC, AC3 or even OPUS can be selected.
    • Enter any Muxer/Video Encoder or Audio Encoder settings as desired. See the FFmpeg Manual for more info on the available options.
    • Click ok to save the settings.
  • Start a Recording, not a Stream.
You can now watch the stream in VLC (for example) on another PC in your local network. Open a network stream in VLC and enter the following address: udp://@ (if you used this address as the "File Path" earlier, in the case of streaming to one pc you can enter udp://@:9999 on the receiving PC)

That way VLC will listen for the incoming stream from OBS:
You can of course use other software that is capable to playback an udp stream.
First release
Last update
4.50 star(s) 12 ratings

More resources from Jack0r

Latest updates

  1. Update to fix some now incorrect sentences

    Codecs can now be unlocked to be able to select any container/encoder combination you want to...
  2. Added Multicast IP

    Thanks to dnb, I was able to improve the guide further. Using a Multicast IP the output stream...

Latest reviews

I too couldn't get it working until I added the packet size, but it works a treat. I'm going to use this in our church when we run out of space and we need to stream the service to our hall
1. Using the multicast address can bring your wifi to a screeching halt if you have a decent number of connected devices. The cost scales up with the number of devices, even if they are not receiving. Changing to the direct recipient IP address fixed my wifi problems.

2. You can use "VLC Video Source" in OBS if you have the 64-bit version of OBS and VLC installed (for VLC, you'll have to click the arrow next to "Download" and *specifically* select the 64-bit installer.) This way you can stream directly from one OBS instance to another OBS on another computer.

3. Set keyframes to a lower number than the default ~250 (perhaps 30 frames is better in case of packet loss, it will recover in 1/2 second instead of 4 seconds)/
VERY IMPORTANT!!! add pkt_size=1316 to the string!!!!!!!!!!!!!
Doesn't work. Says "An unspecified error occurred while recording". Very informative!
I used VLC 2.2.8 to make this tutorial work.

Doesn't work with 3.x.x, it doesn't show the video stream at all.
Be sure to add udp://xxx.0.0.xx:xxxx?pkt_size=1316

Couldn't get the video feed to come through on VLC (2018) until I found this. :)

via https://obsproject.com/forum/threads/obs-studio-send-an-udp-stream-to-a-second-pc-using-obs.55379/page-3
This worked flawlessly for me. Great alternative to a RTMP server
For the sake of completeness, I want to mention that you can use a direct IP address for UDP (Multicast over WiFi can be very resource heavy), and to minimize your latency you will need to run your player with command line options:

$ ffplay -fflags nobuffer udp://@

$ mpv --no-cache udp://@

For MPV, you might also want to configure a shortcut to `drop-buffers` command in ~/.config/mpv/input.conf (https://mpv.io/manual/master/#input-commands-that-are-possibly-subject-to-change):

c drop-buffers
Thanks! I've been having issues with RTMP with Nginx. This looks like a great alternative.
Followed the instructions and it works perfectly