Skip to content

Instantly share code, notes, and snippets.

@johnsie
Forked from kyob/stream-rstp-to-youtube.sh
Created October 14, 2020 14:01
Show Gist options
  • Save johnsie/8e3e6bf15bc433a12b0eeb73624794c6 to your computer and use it in GitHub Desktop.
Save johnsie/8e3e6bf15bc433a12b0eeb73624794c6 to your computer and use it in GitHub Desktop.
Stream video from IP camera to youtube via ffmpeg
#!/bin/bash
RTSP_URL="rtsp://login:password@[ip]:554/cam/realmonitor?channel=1&subtype=1"
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2"
YOUTUBE_KEY="put your key"
screen -d -m ffmpeg -f lavfi -i anullsrc -rtsp_transport tcp -i ${RTSP_URL} -tune zerolatency -vcodec libx264 -pix_fmt + -c:v copy -c:a mp3 -strict experimental -f flv ${YOUTUBE_URL}/${YOUTUBE_KEY}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment