beta/
docs
/
overview
OverviewGuidesAPI Reference
Log inSign up
beta/
docs
/
overview
OverviewGuidesAPI Reference
Sign upLogin
Guides
Getting started with Livepeer.com
Live stream with the Livepeer.com API
Overview
Create a stream
Live stream with the Livepeer.com dashboard
Your Livepeer.com account

How to create a stream with the Livepeer.com API

Send a POST request to https://livepeer.com/api/stream.

This creates a new parent stream object. The id in the POST request response will be the parentId for all future session stream objects for this stream. This guide explains the relationship between parent-config and child-session stream objects.

Use the API key as a part of the authorization header, and use a JSON body to specify the configuration for the stream. The only parameter you are required to set is the name of your stream, but we also highly recommend that you define the profiles parameter with 720p, 480p and 360p renditions.

If you do not define transcoding rendition profiles when creating the stream, no transcoding will happen. Your playback video will have the attributes of the source stream only, will not take advantage of adaptive bitrate streaming and will likely buffer.

Here is an example request:

curl -X POST \
-H 'content-type: application/json' \
-H 'authorization: Bearer {api_key}' \
-d '{
"name": "test_stream",
"profiles": [
{
"name": "720p",
"bitrate": 2000000,
"fps": 30,
"width": 1280,
"height": 720
},
{
"name": "480p",
"bitrate": 1000000,
"fps": 30,
"width": 854,
"height": 480
},
{
"name": "360p",
"bitrate": 500000,
"fps": 30,
"width": 640,
"height": 360
}
]
}' \
https://livepeer.com/api/stream

This is an example stream object response to the request above:

{
"name":"test_stream",
"profiles":[
{"name":"720p","bitrate":2000000,"fps":30,"width":1280,"height":720},
{"name":"480p","bitrate":1000000,"fps":30,"width":854,"height":480}],
{"name":"360p","bitrate":500000,"fps":30,"width":640,"height":360}],
"id":"0bf161f3-95bd-4971-a7b1-4dcb5d39e78a",
"createdAt":1596081229373,
"streamKey":"rlmn-uimq-jtgy-x98v",
"playbackId":"emh3b2mxupongp5k"
}

streamKey, playbackId, and id (a.k.a. the stream ID) are unique to the stream object and important to remember.

Next, learn how to find your ingest and playback base URLs.

Livepeer.com
beta
  • Company
  • Home
  • Contact
  • Team
  • Jobs
  • Livepeer, Inc.
  • 223 Bedford Ave PMB 530
    Brooklyn, NY 11211
  • hello@livepeer.com