Here is a short script which uses ffmpeg to stream video from a Unifi NVR straight to Youtube. I experimented with a few different ffmpeg options and found this one produces the best stream with the best audio.
1 2 3 4 5 |
#!/bin/bash while : do echo `/usr/bin/ffmpeg -rtsp_transport tcp -i rtsp://[your-nvr]:7447/5a45afdg76256bcec92c377_0 -tune zerolatency -vcodec libx264 -t 12:00:00 -pix_fmt + -c:v copy -c:a aac -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/m1uz-f547-your-youtube-stream-url` done |
The first stream URL is generated by creating a stream for the camera in Unifi video. The second URL is the stream URL from youtube.
Previous Post
Fix for nonfunctioning power window in 2007 Mazda3
I've been having trouble with the driver's side power window on my 2007 Mazda3 for a while. The window would go down, but wouldn't go back up. Researching the problem online, this ... Read more
Next Post
Push RouterOS metrics to InfluxDB
Here is a really simple and easy way to push metrics (or any value) from RouterOS right into InfluxDB: #this script grabs some simple measurements #and POSTs them to an influxDB server ... Read more