OverviewGuidesAPI Reference
Log inSign up
OverviewGuidesAPI Reference
Sign upLogin
Getting started with
Live stream with the API
Your 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 \
-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/
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
Content-Disposition: attachment; filename="1080p_1.ts"
Content-Length: 459284
Content-Type: video/MP2T; name="1080p_1.ts"
Rendition-Name: 1080p
Content-Disposition: attachment; filename="720p_1.ts"
Content-Length: 459284
Content-Type: video/MP2T; name="720p_1.ts"
Rendition-Name: 720p
Content-Disposition: attachment; filename="360p_1.ts"
Content-Length: 459284
Content-Type: video/MP2T; name="360p_1.ts"
Rendition-Name: 360p
  • Company
  • Home
  • Contact
  • Team
  • Jobs
  • Livepeer, Inc.
  • 223 Bedford Ave PMB 530
    Brooklyn, NY 11211
  • [email protected]