Youtube stream auto stop & restart ?

Phoenixoboros

New Member
Hello,

I want to stream my desktop 12 hours a day on Youtube but for many reasons I don't want a single stream to be longer than 4 hours.

Is there a way to automate stream rotation so that OBS automatically stops the stream and restarts it when it reaches a set amount of time?
What I want to achieve is basically the split recording file functionality for Youtube streams.

Regards,
 

AaronD

Active Member
The Advanced Scene Switcher plugin can do that, but does YouTube actually split it? It might just see a hiccup, and continue the same stream.
 

sergi5

New Member
The problem is that when a new stream starts (for example using Advanced Scene Switcher), there is a popup up window with a button that block the process with the message :
Output.NoBroadcast.Text="You need to set up a broadcast before you can start streaming."

It is possible to plan several broadcast in advanced (without requiring plugin) but after one stream is finished, even if new broadcasts are planed, we need to manually select one in advance otherwise, the broadcast will not launch automatically even if said to do when configuring.

So how to restart a news stream every 11h59 because of the limit of 12h of youtube to stream that youtube archive and so be able to stream 24/7 ?

Using OBS 30.0.02 with ubuntu
 

AaronD

Active Member
Don't schedule the streams. Use the one stream that is always set up in addition to the scheduled ones. I used to have a scheduled thing, but it was just easier to start throwing data at the default one, so I eventually deleted it.

The uncertainty above is about YouTube seeing an actually new stream, or just a hiccup in the old one. You might play with the time that the stream is stopped, just to satisfy YouTube's no-data timeout.

In fact, you might even use that no-data timeout as a convenient window to reboot, which would apply some security patches that were downloaded and installed while the stream was still running. That's what keeps you from getting hacked.
 

sergi5

New Member
Ok, not "schedule the streams". Let say that was solution 0). But what is the solution, because there is still a problem with a required manual click required:

I tried to play with the delay between the last stream stops and the new stream starts but..:
To connect to youtube, there are two ways:

1) use a key from youtube linked to the stream. In this second case, the key seems to be linked to only one stream. So 1-1) if I start a new stream from OBS with the same key, if the delay was short (about less than 10 seconds), the new stream continues the old one. As it has never stop.
1-2) if the delay was longer (about more than 30 seconds), the youtube stops the old stream, but the new stream is shown nowhere in youtube. This is not a new stream in youtube, and data sent to youtube seems to go in /dev/null
So this is not a solution because the key is linked to a stream and not to a channel.

2) connect to the youtube account with OBS
Quite the same. if the delay is long before starting a new one, youtube has closed the previous stream, and there is this popup window in OBS that requires a manuel click from a human. There is no concept of "default" broadcast and there is two solutions (even if there is 0, 1, on more actual or futur streams in the event broadcast window):
2-1) either select a broadcast in the list if exist
2-2) "create and select" a broadcast.
And then after the manual click , the stream starts.

To conclude: no solution found to prevent requiring a manual click with that pop up window :-(

best regards
 

AaronD

Active Member
I got an e-mail about a reply to this thread, but I don't see the reply here. But I wanted to respond anyway.

sergi5 said:
So 1-1) if I start a new stream from OBS with the same key, if the delay was short (about less than 10 seconds), the new stream continues the old one. As it has never stop.
1-2) if the delay was longer (about more than 30 seconds), the youtube stops the old stream, but the new stream is shown nowhere in youtube. This is not a new stream in youtube, and data sent to youtube seem to go in /dev/null
So this is not a solution because the key is linked to a stream and not to a channel.
I just did exactly that this morning at church. Two different streams back to back, neither of them scheduled, and they both worked. I wonder what's different? Why didn't yours work?

The first is a regular service, and the second is a business meeting:
There was some talk about deleting the business meeting after a week, so if you're reading this after that, it might not be such a good example anymore.

I do know that YouTube had a problem with spambots a few years ago, and so they killed the really good API that they once had. Maybe that has something to do with it? I did change the title and description manually in the web browser, outside of OBS, after the first stream timed out and before starting the next one with everything else the same.

We use the stream key - OBS is *not* logged into our YouTube account - and it was the same key for both of those back to back streams.
 

sergi5

New Member
Thank you AaronD for this info.
This was your key info point :
"I did change the title and description manually in the web browser, outside of OBS, after the first stream timed out and before starting the next one with everything else the same."
So I succeed to reproduce what you did, this is how:

1) Stop a stream,
2) wait about 1 minute so that youtube stops the stream from their side.
3) Then it is required to load the webpage: https://studio.youtube.com/channel/_IDHERE_/livestreaming
You do not need to interact with the webpage, only to load it and your browser will follow a youtube url redirection. (What I do is loading that page every 30seconds with a violentmonkey script )
4) Then it is possible to start a new stream from OBS (and it won't pop up any button requiring a manual click ! )

If you do not load the youtube webpage on step 3), and you start a new stream, that new stream will not be used by youtube as if it goes directly to trash on the youtube side.
 

Phoenixoboros

New Member
Thank you I will try that, youtube streams longer than 4 hours can't be edited via YouTube Studio properly to remove any copyrighted songs that leads to video de monetization, having an automatic setup to keeps streams being longer than 4 hours would be very useful.
 

ABEEEEEEEEEEEE

New Member
Thank you AaronD for this info.
This was your key info point :
"I did change the title and description manually in the web browser, outside of OBS, after the first stream timed out and before starting the next one with everything else the same."
So I succeed to reproduce what you did, this is how:

1) Stop a stream,
2) wait about 1 minute so that youtube stops the stream from their side.
3) Then it is required to load the webpage: https://studio.youtube.com/channel/_IDHERE_/livestreaming
You do not need to interact with the webpage, only to load it and your browser will follow a youtube url redirection. (What I do is loading that page every 30seconds with a violentmonkey script )
4) Then it is possible to start a new stream from OBS (and it won't pop up any button requiring a manual click ! )

If you do not load the youtube webpage on step 3), and you start a new stream, that new stream will not be used by youtube as if it goes directly to trash on the youtube side.
I have tried reloading https://studio.youtube.com/channel/_IDHERE_/livestreaming while Advanced Scene Selector runs Macros to start and stop the Youtube stream. Unfortunately, the "Mange broadcast" pop-up still appears and prevents the stream from streaming automatically. I feel so close but so far from getting this to work. Any advice is greatly appreciated.
 

Dnort

New Member
I was looking for something like this.
I found out yesterday, If you disconnect OBS from YT, and reconnect before the stream ends, YT saves it as a separate file
I need this for a 24/7 stream, so YT can save the file every 12 hours (the max length for YT to save).
I sometimes switch between two PC's without cutting the stream.
 
Top