Websocket: Start/Stop Stream

asqwhy

New Member
We use Websocket extensively to manage our 8 scenes for live broadcasts. We can do almost everything except for start/stop stream, because we first have to go to Manage Stream to select the previously configured stream on YouTube for broadcast.

Is there a way to tell StartStream in websocket to use a specific YouTube ID like that at the end of this URL: https://youtube.com/live/Z5XcFUYOEnw ?

Also, is this the only documentation? Or is there a more complete documentation available for Websocket API?
 
Couple of possibilities you might look at:
1) We have YouTube stream keys set up for various sorts of events. When streams are scheduled in YouTube Studio, we specify the appropriate key. For each key, we have created an OBS profile configured to use that key. A script in OBS, or a separate app using websocket, can command OBS to change profile, thus changing the key.

2) Within the folder for each profile (on Windows, something like C:\Users\{username]\AppData\Roaming\obs-studio\basic\profiles\{profilename}) the stream protocol and key are stored in service.json. You could have your app write this file with the appropriate key before it starts the stream. Caution: I don't know whether OBS reads this file when you start a stream, or if it is read when you select a profile. If the latter, you would need to write serivce.json and then change to that profile.

Note: your Z5XcFUYOEnw specifies a particular instance of stream. The YouTube keys I have described above have four groups of four letters and numbers: xyzw-1234-abcd-9876. We schedule our streams in advance, set the key, and harvest the URL for the stream to distribute to our members.
 

asqwhy

New Member
Couple of possibilities you might look at:
1) We have YouTube stream keys set up for various sorts of events. When streams are scheduled in YouTube Studio, we specify the appropriate key. For each key, we have created an OBS profile configured to use that key. A script in OBS, or a separate app using websocket, can command OBS to change profile, thus changing the key.

2) Within the folder for each profile (on Windows, something like C:\Users\{username]\AppData\Roaming\obs-studio\basic\profiles\{profilename}) the stream protocol and key are stored in service.json. You could have your app write this file with the appropriate key before it starts the stream. Caution: I don't know whether OBS reads this file when you start a stream, or if it is read when you select a profile. If the latter, you would need to write serivce.json and then change to that profile.

Note: your Z5XcFUYOEnw specifies a particular instance of stream. The YouTube keys I have described above have four groups of four letters and numbers: xyzw-1234-abcd-9876. We schedule our streams in advance, set the key, and harvest the URL for the stream to distribute to our members.
Thanks, John. I undersatnd that use case, and can see why that works for you.

In our case, we have thumbnails, live stream start dates/times, a description, and other stream/video attributes that are configured in YouTube through an App I wrote that uses YT's API. Our team has been trained to go to
OBS->Controls Panel->Manage Broadcast->Select Existing Broadcast, and then select the preconfigured YouTube broadcast for that service which was created by the App. The YT API returns the live stream ID (the example I sent) during the preconfiguration process.

What I am seeking is an ability to tell OBS to use that YT live stream ID through Websocket or other means so that they no longer need to go to the Manage Broadcasts dialog.
 
Top