A Docker image to stream your webcam (or another V4L device) straight to YouTube.
You can learn more about YouTube streaming on YouTube Studio.
cd docker-youtube-stream-webcam
docker build -t youtube-stream .docker run \
-d \
-e STREAM_KEY=your-youtube-stream-key \
-e DEVICE=/dev/video0 \
--device=/dev/video0 \
youtube_streamCurrently, this has been tested with:
- Logitech C920 HD
...and probably works with other devices too, but who knows 🤷♂️
At the moment, the stream will not transmit sound; a dummy audio track is streamed to YouTube. If you want to change this, you can change the ffmpeg options in stream.sh and rebuild the container.
Removing line 9 from stream.sh should enable sound from your camera.
Probably, if you want to install dependencies yourself, go for it, then run:
STREAM_KEY=your-youtube-stream-key \
DEVICE=/dev/videoX \
./stream.sh