Skip to content

Instantly share code, notes, and snippets.

Last active June 18, 2022 11:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
RTSP Stream with `youtube-dl`

1. Install youtube-dl

2. Install ffmpeg

3. Run rtsp-simple-server (repo here)

docker run --rm -it -e RTSP_PROTOCOLS=tcp -p 8554:8554 -p 1935:1935 -p 8888:8888 aler9/rtsp-simple-server

4. Run ffmpeg with best available quality Youtube video

ffmpeg -re -stream_loop -1 -i $(youtube-dl -g\?v\=vbgwWfwGSR4) -f rtsp rtsp://localhost:8554/stream

5. Access stream from anywhere (NVR; Home Assistant; etc) with the rtsp url:



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment