Skip to content

Instantly share code, notes, and snippets.

@kyob
Last active December 16, 2023 20:48
Show Gist options
  • Save kyob/3f98082b243472a0b1b5da8897035a52 to your computer and use it in GitHub Desktop.
Save kyob/3f98082b243472a0b1b5da8897035a52 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