Streaming OBS directly to another OBS instance
As part of my Linux Dev live stream I had an OBS instance doing screen capture on my dev computer while running a separate OBS instance on my stream computer for compositing and sending to multiple streaming platforms. I needed a way to configure a RTMP server to receive the stream from the dev computer and incorporate it in OBS.
FFmepg is a suite of tools for working with video and video streams in various formats. It has an option to set up a RTMP server and listen for a RTMP stream. The OBS Media Source launches an instance of FFmpeg and allows passing it extra arguments.
Setting listen=1
in the “FFmpeg Options” section changes the meaning of the “Input” field from a URL to connect to, to
a URL to listen on. The URL format is rtmp://[username:password@]server[:port][/app][/instance][/playpath]
. Setting
server:port to “0.0.0.0:1935” will listen on port 1935 on all network interfaces. You can change this to the IP address
of a specific network interface if you have multiple and want to restrict who can access it. Specify username:password
if your computer is accessible from outside the local network or if you are connected to an untrusted network. Generally
you will want to use rtmp://0.0.0.0:1935/live/app
but if you have multiple streams you want to be able to receive,
change “app” to any unique identifier per Media Source.
That’s it! That is all you need to do to setup up OBS Studio to receive RTMP video streams. For the sending instance
of OBS, you will configure the Stream settings under File->Settings->Stream
to a “Custom”
service. Set the server URL to rtmp://<your computers local ip address>:1935/live/app
. Start the receiving instance of
OBS before starting the stream on the sending instance, or you will get a connection error.
If the two instances are not connected to the same local network then you will either need to set up port forwarding on your network router or configure a LAN VPN between the computers. Hamachi is a free LAN VPN that has been around for over 20 years and is cross-platform.
Leave a Comment