Is it necessary to bind a stream to a YouTube broadcast?

60 views Asked by At

I am simply trying to automate live streaming on YouTube, bypassing the need to go to YouTube studio first. I am already able to transmit the video with FFmpeg from a raspberry pi, but the stream needs to be "started" first. I take this to mean begin a broadcast.

If I use the YouTube live streaming api to start broadcasts, can I then immediately begin streaming as normal from FFmpeg to the rtmp url with key, or must I "bind" the stream to the broadcast, and what exactly does this mean?

1

There are 1 answers

0
Fresh Limes On

As per the documentation, it's necessary to bind a stream to a broadcast. A broadcast corresponds to the event you establish for your video content, encompassing elements like the title, description, thumbnails, and scheduled start/end times. On the other hand, a stream relates to the actual content you're transmitting within that broadcast. For example, you can create a broadcast without binding it to a stream; however, this will result in an event posting that delivers no video content.

A broadcast represents an event that can be watched on YouTube as it happens. Each broadcast is a distinct YouTube video. A broadcast can be and needs to be bound to exactly one stream.

A stream enables you to transmit audio-video content to YouTube, and it defines the settings for how you stream your content to YouTube. The same stream can be bound to up to three live broadcasts. It is also common for broadcasters to reuse the same stream for many different broadcasts if those broadcasts occur at different times.

Source: Broadcasts and Streams

As outlined in this guide, you will need to create both a liveBroadcast resource and a liveStream resource, and associate them using the liveBroadcasts.bind method. You need to add the RTMP URL (and other relevant settings) to the liveStream resource, so that it contains the necessary information about where your stream is being transmitted, and the binding ensures that the content from the stream is connected to the event defined in the liveBroadcast resource.