I have a camera feed that streams 24/7 on YouTube. Everything works fine, except the stream often goes down due to internet reliability issues. I can detect that the stream is down with the v3/search endpoint, then an automated command is sent from my server to restart it, but the stream doesn't start like it should.
I've discovered that the live stream will only start if I open the YouTube Live Dashboard first.Before opening the dashboard, my streaming software will upload data using the stream key, but there's no live stream. Upon opening the YouTube Live Dashboard, it shows "Good Connection" but with no video feed. My automation script is continuously restarting the stream, so it comes up very shortly after opening the dashboard every time.
Streaming software: I use ffmpeg to translate an RTSP stream directly to YouTube.
ffmpeg -rtsp_transport tcp -re -i "rtsp://$cameraLink" -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -force_key_frames "expr:gte(t,n_forced*2)" -nostdin -f flv -map 0:v:0 -map 1:a:0 -c:v libx264 -preset ultrafast -crf 43 -s 1280x724 -r 30 -c:a aac "rtmp://a.rtmp.youtube.com/live2/$streamKey"Since entering into the YouTube Live Dashboard seems to start some sort of "active state", I've tried various Oauth2 and key API methods to start the live stream. I haven't gotten anything to work so far.