This project provides scripts and all instructions to stream HDMI inputs, USB webcams and audio inputs over the network for use in OBS.
- Automated + interactive setup script for Pi
- Setup scripts for Windows and macOS
- Ability to stream HDMI and camera audio
- Sync video and audio streams by timestamp
- The streaming PC has to have a unique IP address in the same network as the raspberry pi so that all Pis can stream directly to this IP.
- Install gstreamer including all necessary plugins
For OBS you will need the obs-gstreamer plugin to receive all media streams.
- Enable SSH
- Set up password and wifi for Raspberry Pi
- Install gstreamer including all necessary plugins
- Setup environment variables for the Exact host and port, Cam ID (which generates hostname and the IP address range 50{CAM_ID}x)
- Configure streaming scripts for autostart
To stream an HDMI input we are usign a USB HDMI Capture Stick which make the HDMI input available via a new video and audio input.
The stream already has a low latency (I read about 200ms) but for an even lower latency it might work to use a HDMI to CSI-2 bridge with the instruction for the Pi Camera or to use another and more expensive streaming card which has lower latency.
The latency for the mentioned streaming stick can be reduced by changing the resolution to 720p instead 1080p.
./stream-mjpeg.sh
udpsrc port=5010 ! application/x-rtp,encoding-name=JPEG,payload=26 ! rtpjpegdepay ! jpegdec ! video.
A USB webcam like the Logitech C922 makes the video input available using an x-raw video stream. For this you need another script than for the HDMI input.
./stream-raw.sh
udpsrc port=5010 ! gdpdepay ! rtpvrawdepay ! videoconvert ! video.
For the Pi Camera there already is another project which provides a script including instructions for OBS.
To stream an audio input we are usign a USB audio card which is natively supported by Raspberry Pi OS.
./stream-audio.sh
udpsrc port=5011 caps="application/x-rtp" ! rtppcmadepay ! alawdec ! audio.
or
udpsrc port=5011 ! "application/x-rtp,media=(string)audio, clock-rate=(int)48000, channels=1, payload=(int)96" ! rtpjitterbuffer latency=35 ! rtpL24depay ! audioconvert ! jackaudiosink buffer-time=35000
The x
in the port stands for the specific Raspberry Pi. Each Pi should get an unique ID to avoid port collisions.
- 50x0 - video
- 50x1 - audio