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
Your Livepeer.com account

Back to Video Segment Based Transcoding Guide

How to create a stream and define renditions

The first step to live transcoding .ts segments is creating a stream.

Create a stream by sending POST to https://livepeer.com/api/stream with name and profiles.

You can define the stream name parameter and the rendition profiles.

Each rendition profile includes name, bitrate, fps, width and height. If you need guidance setting up your rendition profiles, Apple's recommended settings for HLS ladders is a good starting point.

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

The json response includes the stream id parameter. You'll need that later.

Here is an example response.

{
"name":"my-stream",
"profiles": [
{
"name":"1080p",
"bitrate":6000000,
"fps":30,
"width":1920,
"height":1080
},
{
"name":"720p",
"bitrate":2000000,
"fps":30,
"width":1280,
"height":720
},
{
"name":"360p",
"bitrate":500000,
"fps":30,
"width":640,
"height":360
}
],
"kind":"stream",
"userId":"47b70bb7-4887-4481-8ec5-f2ee6b623a00",
"renditions":{},
"id":"cb433497-7947-4859-9606-f46c7d5ee89e",
"createdAt":1592272441370
}
Livepeer.com
beta
  • Company
  • Home
  • Contact
  • Team
  • Jobs
  • Livepeer, Inc.
  • 223 Bedford Ave PMB 530
    Brooklyn, NY 11211
  • [email protected]