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
Playback a live stream
Live stream with the Livepeer.com dashboard
Your Livepeer.com account

How to playback a live stream with the Livepeer.com API

Once the broadcast session is started, transcoding will automatically happen. To playback a live stream, you’ll need the playbackId from when you created a stream object. You also need to know your playback base URL.

Users can view the live stream with any HLS video player (for example video.js) by using the playback URL: {playback_base_url}/{playbackId}/index.m3u8. The playback URL for RTMP streams is delivered via a content delivery network (CDN).

You can use fetch and examine the playlist by using the playback URL. For example:

curl "https://{region}-cdn.livepeer.com/hls/{playbackId}/index.m3u8"

You should give you the full HLS playlist that includes the source and transcoded renditions. For example:

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2145120,RESOLUTION=1920x1080,FRAME-RATE=30,CODECS="avc1.4d4028,mp4a.40.2"
1_0/index.m3u8?sessId=23351
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2018712,RESOLUTION=1280x720,FRAME-RATE=29.97,CODECS="avc1.4d401f,mp4a.40.2"
2_0/index.m3u8?sessId=23351
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1111792,RESOLUTION=854x480,FRAME-RATE=29.97,CODECS="avc1.4d401f,mp4a.40.2"
3_0/index.m3u8?sessId=23351
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=638672,RESOLUTION=640x360,FRAME-RATE=29.97,CODECS="avc1.4d401e,mp4a.40.2"
4_0/index.m3u8?sessId=23351

If you don't see a response like this, it's likely because the stream is not live.

Next, learn how to record stream sessions.

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