RTSP Video as OBS Source via FFMPEG

Add a (network) camera with an RTSP feed to OBS as a camera source on Linux.
 
  • Install v4l2loopback & ffmpeg for your distribution.
  • Add a /etc/modprobe.d/v4l.conf file thats contains something along the lines of:
options v4l2loopback video_nr=10 
options v4l2loopback card_label="RTSP H264 STREAM1"
where the 10 is arbituary and refers to the XX in /dev/videoXX
and the card_label is something meaningful to you.
  • Reboot and make sure a /dev/video10 device now exists.
 
  • Create an executable shell script that contains something like:
nohup ffmpeg -i rtsp://camera_ip_address:554/mediainput/h264/stream_1 -f v4l2  -pix_fmt yuv420p /dev/video10&
N.B. the rtsp URL is specific to your camera device and the -pix_fmt option may need some tweaking to work with your camera.
 
  • Run the shell script.
  • Then add a "Video Capture Device (V4L2)"  source in OBS, selecting the /dev/video10 device. You should then see the network camera video stream show up on the OBS canvas.
PS: When finished using the v4l2loopback device don't forget to kill the ffpeg process.