beta/docs
OverviewGuides
Log inSign up
OverviewGuides
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 transcode .ts segments

Before transcoding your stream of .ts segments, be sure to create a stream with defined rendition profiles and gather a list of broadcasters. It may also be helpful to review how to authenticate.

To transcode a video segment, POST your .ts segment to {broadcaster_address}/live/{stream_id}/{media_number}.ts

In the header be sure to Accept: multipart/mixed.

A continuous livestream should start with the media_number set to 1.ts and count upward to 2.ts, 3.ts and so on for each segment.

There is currently a limit of 1 segment at a time per stream. If you encounter a problem uploading a segment, try making a new request for a list of broadcasters and POST to a different broadcaster address. You can still expect the stream to be at the same URL.

Here is an example request:

curl -X POST https://example-broadcaster-url-1.livepeer.live/live/stream_id/100.ts \
-H "Accept: multipart/mixed" \
-H "content-duration: 2050" \
-H "content-resolution: 1920x1080" \
--data-binary "@100.ts" > out.ts

Here is an example response

HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Server: openresty/1.15.8.2
date: Thu, 18 Jun 2020 20:01:54 GMT
Content-Type: multipart/mixed; boundary=83212f107a67f532dbdc
Transfer-Encoding: chunked
Connection: keep-alive
Strict-Transport-Security: max-age=15724800; includeSubDomains
--83212f107a67f532dbdc
Content-Disposition: attachment; filename="1080p_1.ts"
Content-Length: 459284
Content-Type: video/MP2T; name="1080p_1.ts"
Rendition-Name: 1080p
...Data
--83212f107a67f532dbdc
Content-Disposition: attachment; filename="720p_1.ts"
Content-Length: 459284
Content-Type: video/MP2T; name="720p_1.ts"
Rendition-Name: 720p
...Data
--83212f107a67f532dbdc
Content-Disposition: attachment; filename="360p_1.ts"
Content-Length: 459284
Content-Type: video/MP2T; name="360p_1.ts"
Rendition-Name: 360p
Livepeer.com
beta
  • Company
  • Home
  • Contact
  • Team
  • Jobs
  • Livepeer Inc.
  • 16 Vestry Street, Floor 4
    New York, NY 10013
  • [email protected]