Zencoder Encoding Settings: Live Streaming

Product(s)
Zencoder
Role(s)
API Developer
Topic(s)
Encoding Settings
Live Streaming
API(s)
Zencoder API

This topic contains details for encoding settings related to live streaming jobs.

Limitations

There is a default limit of 5 waiting live streams per account. If you reach this limit, you will need to cancel or start streaming to one of the waiting streams in order to create a new live job. You can increase this limit by contacting support.

live_stream

live_stream:Boolean

API Versions: V2

Parent: outputs

Default: false

Valid Values: true or false

Compatible Job Types: live

Example: true

Description:

For HLS outputs on Live Streaming jobs, setting live_stream to true on an output will create the output as the input is streamed to Zencoder. If live_stream is false, or is not set, the HLS output will be transcoded and uploaded once the input has finished streaming.

See our Live streaming guide for more information.

{
  "live_stream": true,
  "output": [
    {
      "live_stream": true,
      "type": "segmented"
    }
  ]
}

See Also: source and event

reconnect_time

reconnect_time:Integer

API Versions: V2

Parent: input

Default: 30

Valid Values: 0-1800

Compatible Job Types: live

Example: 45

Description:

The time, in seconds, to wait for a stream to reconnect.

Note: The live stream will remain available for the remainder of event_length or reconnect_time, whichever is greater. You can end a job at any time with a finish API request.

{
  "live_stream": "true",
  "event_length": 1800,
  "reconnect_time": 120,
  "outputs": [ ... ]
}

Given this API request, the following scenarios would be true:

  • Disconnect at 15 minutes: Job finishes at 30 minutes
  • Disconnect at 29 minutes: Job finishes at 31 minutes
  • Disconnect at 50 minutes: Job finishes at 52 minutes

 

{
  "live_stream": true,
  "reconnect_time": 45
}

See Also: event_length

event_length

event_length:Integer

API Versions: V2

Parent: input

Valid Values: 0-93600

Compatible Job Types: live

Example: 18000

Description:

The minimum time, in seconds, to keep a live stream available. At any point within the specified event_length you may reconnect to your stream. The event_length setting goes into effect as soon as streaming begins.

Note: The live stream will remain available for the remainder of event_length or reconnect_time, whichever is greater. You can end a job at any time with a finish API request.

{
  "live_stream": "true",
  "event_length": 1800,
  "reconnect_time": 120,
  "outputs": [ ... ]
}

Given this API request, the following scenarios would be true:

  • Disconnect at 15 minutes: Job finishes at 30 minutes
  • Disconnect at 29 minutes: Job finishes at 31 minutes
  • Disconnect at 50 minutes: Job finishes at 52 minutes
{
  "live_stream": true,
  "event_length": 18000
}

See Also: reconnect_time

live_sliding_window_duration

live_sliding_window_duration:Integer

API Versions: V2

Parent: outputs

Default: 7200

Valid Values: Greater than combined duration of 4 segments

Compatible Job Types: live

Example: 300

Description:

The time, in seconds, to keep in the manifest. Setting this affects the number of segments that will be included in the manifest. Once the stream duration is longer than the set window duration, segment references will be removed from the top of the manifest.

Recommendations

Default is 2 hours (7200 seconds). For delivery over a static HTTP server this works very well. For a live stream over a CDN, it is usually good to set a shorter window. For CDNs we recommend between 40 (assuming 10 second segments) and 300 (5 minutes).

Considerations

The amount of video that can be scrubbed (rewound) will be limited to the size of the window.

The smaller the window, the faster the manifest will load and less bandwidth is needed to begin streaming.

{
  "live_stream": true,
  "output": [
    {
      "live_stream": true,
      "type": "segmented",
      "live_sliding_window_duration": 300
    }
  ]
}

redundant_transcode

redundant_transcode:Boolean

API Versions: V2

Parent: input

Default: false

Valid Values: true or false

Compatible Job Types: live

Example: true

Description:

Extracts secondary_urls from outputs and uses them to create outputs in a backup job with the same transcoding settings. Setting redundant_transcode to true will return two stream names along with primary and redundant stream urls. The redundant url endpoint is hosted in the nearest transcoding region powered by a different service provider. For example, if the Amazon AWS backed "us-virginia" region is requested, the redundant transcode will run in the Google GCE backed "us-central-gce" region.

Considerations

This will double the client bandwidth requirement, as the client will broadcast to both the stream_url and redundant_stream_url

Only outputs with "secondary_urls" will be selected for the redundant job, at least one output with a secondary_url is required.

The backup job will be billed as an additional live job at standard live rates.

{
  "live_stream": true,
  "redundant_transcode": true,
  "output": [
    {
      "live_stream": true,
      "url": "rtmp://primary.example.com/live/stream",
      "secondary_url": "rtmp://backup.example.com/live/stream"
    }
  ]
}

See Also: source and event