Is it possible to use the YouTube Live Stream API to broadcast through my phone camera?

John doe picture John doe · Sep 1, 2016 · Viewed 8.5k times · Source

I want to create a basic app that allow users to simply start to broadcast a video through their phone camera (front and back) just by pressing a button.

Does the YouTube live stream API allow me to handle the video streaming process?

If so, is YouTube Live Stream API totally free of charges and will never ask me to pay something if I reach a certain amount of usage?

Answer

JAL picture JAL · Sep 1, 2016

Creating a Live Event and Live broadcast is language and hardware agnostic, just use YouTube's Live Streaming HTTP API. Read through the Core Concepts and Life of a Broadcast guides.

Your flow might look something like this:

  1. Authenticate the user.
  2. Set up and schedule your Live Broadcast object.
  3. Start your video encoder and create a Live Stream Object.
  4. Bind your Live Stream to your Live Broadcast.
  5. Test to verify your video is going through.
  6. Set your Live Broadcast to Live.
  7. At the conclusion of your event, set your Live Broadcast to Ended.

Note that setting up your encoder is on you. Asking "How do I create an RTMP or DASH video encoder for [hardware or software]" is too broad of a question for Stack Overflow.

The YouTube API is free to use within a specific quota. If you hit that quota limit, there are ways to request additional quota from Google (potentially for a fee).

I answered a similar question about integrating with YouTube's Live Streaming API on iOS here: YouTube live on iOS?