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.

  1. Jack0r
    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:
    [​IMG]
    • Settings -> Output -> Output Mode -> Advanced
      • Recording -> Type -> Custom Output (FFmpeg)
      • FFmpeg Output Type -> Output to URL
      • File path or URL -> udp://224.0.0.1:9999
        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://192.168.0.5:9999
        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://@224.0.0.1:9999 (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:
    [​IMG]
    You can of course use other software that is capable to playback an udp stream.
    Charnel, ICAN, Adam Powers and 2 others like this.

Recent Reviews

  1. Lucage
    Lucage
    5/5,
    This worked flawlessly for me. Great alternative to a RTMP server
  2. frol
    frol
    5/5,
    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://@0.0.0.0:9999

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

    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
  3. bingeboy
    bingeboy
    5/5,
    Thanks! I've been having issues with RTMP with Nginx. This looks like a great alternative.
  4. Racer Andy
    Racer Andy
    5/5,
    Followed the instructions and it works perfectly
    Thanks