Youtube now has a Live Streaming section that allows users to broadcast their own live stream sessions. In this "Live Streaming" section, there are 2 options: "Live Now [Beta]" and "Events".
Live Now is a fast and easy way to start a streaming session automatically just by pointing your video encoder to te specified RTMP Url and Stream Key. It will automatically detect incomming media and start broadcasting publicly.
Events is pretty much the same thing, but with advance settings, although it will not start automatically to broadcast, and you need to set everything pretty much manually.
I know Youtube API allows you to retrieve Event's ingestion url and streamkey, so you can broadcast to that target, but it also requires to manage many other steps manually (like publishing the stream, binding broadcasts with streams, check the status, start, stop, etc..). On the other hand "Live Now" makes everything automatically.
Question: How can I retrieve "Live Now" ingestion info (rtmp url and streamkey) from the Youtube API v3 ?
RTMP is a widely-used protocol for video streaming that YouTube Live has accepted since the service began. RTMPS is a secure extension to RTMP. RTMPS benefits both content creators and viewers by preventing man-in-the-middle attacks on the ingestion side of livestreams.
Select the Live Tools menu. Scroll to the bottom to find the RTMP Input option. Select Get Link. You will be presented with a Stream Key and a Server URL along with a few additional options.
Under “Stream settings,” in the "Stream URL" field, click the lock icon to show the RTMPS URL. Copy the Stream URL. Paste the URL into your encoder. Copy your YouTube stream key from Live Control Room and paste it into your encoder.
Under “Select stream key,” click Create new stream key. Enter your preferred settings and click Create. Your stream key will show up in the stream key list.
The default broadcast can be retrieved by livebroadcasts.list with broadcastType set to "persistent".
The default livestream can be retrieved by livestreams.list using boundstreamid.
You cannot retrieve "Live Now" ingestion info because the API does not differentiate between "Live Now" and "Events." Those two options are provided as interfaces on top of the API for an end user, so they don't have to write their own application that interfaces with the API.
You will have to manually set up liveBroadcast
and liveStream
objects, bind them with liveBroadcasts.bind
, test your stream, and transition to live on the liveStream
object using status.streamStatus
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With