Skip to content

Instantly share code, notes, and snippets.

View johnsie's full-sized avatar

John McCourt johnsie

View GitHub Profile
@johnsie
johnsie / stream-rstp-to-youtube.sh
Created October 14, 2020 14:01 — forked from kyob/stream-rstp-to-youtube.sh
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}
@johnsie
johnsie / stream-rstp-to-youtube.sh
Created October 14, 2020 14:01 — forked from kyob/stream-rstp-to-youtube.sh
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}
@johnsie
johnsie / namecheap-ddns
Created July 19, 2020 22:03
Simple Namecheap Dynamic DNS client
#!/bin/sh
set -eu
FETCH="fetch -qo -"
# or for curl:
#FETCH="curl -s"
# $1: your domain
# $2: subdomain to update use @ for TLD
# $3: the password given to you by Namecheap's web interface
#
# Rerun this script every 5 minutes. Crontab entry (not as root):