Does anyone LiveStream their camera on youtube?

Smilingreen

Known around here
Joined
Sep 17, 2021
Messages
3,603
Reaction score
14,390
Location
Tennessee USA
I have been looking for a RPi 4 Model B - 8GB RAM. I have the 4B with 4 gig and a 3B+ with 1 gig. Both are on my desk. I use the 4B for running a ADS-B receiver and the 3B+ is running CumulusMX for my weather station. I need one more, for just general screwing around with. When they finally get back in stock, I'll probably snag 2 of them, provided they are a decent price.

I am trying to miniaturize my computer collection. I run a MAC Mini M1 for my main desktop computer, I run a Lenovo M710Q Think Centre mini for Blue Iris and my CAD Software, I have a Dell Optiplex 3040 mini I run my Ham Radio software on and use another Dell Optiplex 3040 mini for use with my entertainment center in the mancave. My home built NAS is still running on a Dell Optiplex 780. It is beginning to get tired after 8 years, 24/7 running. Trying to figure out how to miniaturize that. May have to go spend some money and get a Synology NAS. I already have way too many computers running in my man cave, what's a couple of more?? :idk: :thumb:
 

78suited

Young grasshopper
Joined
Jan 4, 2021
Messages
35
Reaction score
23
Location
Netherlands
@TonyR I've noticed that your livestream stopped and you started a new one again. Did you see specific notifications in YouTube Studio (stream status).
 

TonyR

IPCT Contributor
Joined
Jul 15, 2014
Messages
16,715
Reaction score
38,909
Location
Alabama
@TonyR I've noticed that your livestream stopped and you started a new one again. Did you see specific notifications in YouTube Studio (stream status).
It's up again.
Was trying to quit vMix and use OBS, went back to vMix, live back up @ 0848 CT.
To be continued...have doc appt in 1 hour. :cool:
 

78suited

Young grasshopper
Joined
Jan 4, 2021
Messages
35
Reaction score
23
Location
Netherlands
My stream died today, but was a personal record.....72 hours and 41 minutes. I've started a new session, let's see if I can top the PR :)
 

78suited

Young grasshopper
Joined
Jan 4, 2021
Messages
35
Reaction score
23
Location
Netherlands
Edit: after testing with Synology Surveillance Station, I now started to rest with rtmp directly to YouTube. That seems to work fine also and I’m curious how long the livestream stays online.

I also tried OBS Studio, but I couldn’t get it running. Someone know how to set it up with a Dahua cam? I followed a couple of tutorials on the internet but that didn’t work out for me.
 

oceantrvlr

n3wb
Joined
Jan 31, 2022
Messages
10
Reaction score
4
Location
Marshfield, MA
I know this is a year-old thread, but are there more recent threads specifically regarding streaming to YT via RTMP either directly from a camera, via OBS or from a customized RPi?

I have a Hikvision camera which streams to TY via OBS which manages to stay up for months, but I'd like to ditch the windows computer at some point and go direct from a new camera, or maybe go the raspberry route. I spent some time trying to get ffmpeg working on a raspberry but was not able to get it to work.

I'm hoping to deploy a new camera in a new location soon and want to figure out my options.
 

TRLcam

Getting comfortable
Joined
Apr 16, 2014
Messages
294
Reaction score
1,083
Location
Nebraska!
 

elvisimprsntr

Pulling my weight
Joined
Dec 26, 2022
Messages
83
Reaction score
151
Location
Florida
Many moons ago, I spun up a Linux VM instance to YT live stream an old camera pointed outside during a hurricane.

I think I earned $2 in ad revenue, which I had to pay income tax on. :(
 

78suited

Young grasshopper
Joined
Jan 4, 2021
Messages
35
Reaction score
23
Location
Netherlands
I know this is a year-old thread, but are there more recent threads specifically regarding streaming to YT via RTMP either directly from a camera, via OBS or from a customized RPi?

I have a Hikvision camera which streams to TY via OBS which manages to stay up for months, but I'd like to ditch the windows computer at some point and go direct from a new camera, or maybe go the raspberry route. I spent some time trying to get ffmpeg working on a raspberry but was not able to get it to work.

I'm hoping to deploy a new camera in a new location soon and want to figure out my options.
After several tests and attempts to livestream continuously using my Synology NAS and Dahua cams, I ran into solution. At least, I hope so...

I am testing it right now and for those who ran into the same problem, maybe this will resolve the problem of streams that stop after a certain time:

 
Last edited:

TRLcam

Getting comfortable
Joined
Apr 16, 2014
Messages
294
Reaction score
1,083
Location
Nebraska!
That is true. But. If the stream is off for 15 minutes or so, it will not come back. I'm not sure of the exact time limit.

If your OBS is installed on a Linux machine and you are into command line operations, you can use a YouTube utility called "youtube-dl" to check the status of the stream. Then using the results, you can automatically restart the YouTube livestream.

Here is the command to get you started.

sudo pip3 install youtube-dl

youtube-dl -F 'htttps:/www.youtube.com/watch?v=YOUR_VIDEO_ID'

Replace YOUR_VIDEO_ID with the actual video ID of the live stream. If the live stream is active, this command will list available formats for the video. If the stream is not active, it will return an error.

Or, another approach is to monitor the bandwidth used by your ethernet connection. You can do that using a Linux utility called ifstat.

sudo apt-get install ifstat

#!/bin/bash

# Monitor eth0 and execute a script if bandwidth falls below 100bps

# Path to the restart script
RESTART_SCRIPT="/home/pi/scripts/restart.sh"

log_debug() {
echo "[DEBUG] $(date '+%Y-%m-%d %H:%M:%S') - $1"
}

log_debug "Starting bandwidth monitor for eth0."

while true; do
read RX TX <<< $(ifstat -i eth0 1 1 | awk 'NR==3 {print $1, $2}')

log_debug "Current bandwidth - RX: ${RX}bps, TX: ${TX}bps"

if (( $(echo "$RX < 100" | bc -l) )) || (( $(echo "$TX < 100" | bc -l) )); then
log_debug "Bandwidth below threshold. Executing restart script."
bash "$RESTART_SCRIPT"
log_debug "Restart script executed."
break
else
log_debug "Bandwidth is above the threshold."
fi

sleep 5
done

In this example the script monitors eth0 and if the bandwidth goes below 100 bps the script runs another bash script called restart.sh. The restart script kills the existing stream and restarts a new one.
 

78suited

Young grasshopper
Joined
Jan 4, 2021
Messages
35
Reaction score
23
Location
Netherlands
Unbelievable, this is so frustrating....the stream did end again and I'm about tog give it up. Unfortunately I don't have a Linux machine, other than mij Synology NAS.

Now I even can't use RTMP straight from my Dahua cam anymore, which worked fine before. I used this setup guide for it but none of my cameras are able to stream directly to YouTube anymore. Anyone else experiencing problems?

 

TRLcam

Getting comfortable
Joined
Apr 16, 2014
Messages
294
Reaction score
1,083
Location
Nebraska!
One thing I noticed in the video, he said you need "P2P" enabled. You do not.
 

78suited

Young grasshopper
Joined
Jan 4, 2021
Messages
35
Reaction score
23
Location
Netherlands
One thing I noticed in the video, he said you need "P2P" enabled. You do not.
I left that option disabled too, no need for enabling it.

It looks like YouTube changed something, because I can use VLC player to watch the camera live via rtsp. Using the settings with rtmp don't work anymore, typical.
 

DezertManiac

Getting the hang of it
Joined
Nov 2, 2018
Messages
55
Reaction score
91
Location
CA
I have one Dahua 4K camera that I use the built in RTMP YouTube encoder. It is still running.

I am also running this livestream on a Dahua 4k camera with the built in RTMP YouTube encoder, and works really well. I believe the longest continuous stretch (being online) has been close to a month, it only came down due to a power outage (very common in our area and prolonged) UPS ran out of juice.
  • I am currently researching on how to run it from OBS as I am in need of adding "stream sponsors" is RTSP the only way?
  • Ultimately I think running FFmpeg on a Raspberry Pi might be the best option; the question is if I go this route, how do I go from FFmpeg >OBS > YT?
  • I would also like to add a weather widget like on this stream Side note, I wonder how they can accomplish the uptime on this stream for over 3+ years
TIA for sharing your expertise on this matter!!!
 
Top