Edgio

MMD Live - Live to VOD Developers Reference

This documentation is intended for programmers who are writing client or server applications that interact with MMD Live Recording Schedules and slots.
Specifically, the API permits the following:
  • Query - Retrieve a specific Recording Schedule or all Recording Schedules
  • Create - Create a new Recording Schedule
  • Update - Update a specific Recording Schedule
  • Delete - Delete a specific Recording Schedule
Resources about these bullet points are described further in Data Resources.

Data Resources

The Live to VoD APIs use four Data Resource objects. The method definitions using the Data Resources are defined in API Requests - Query, API Requests - Create and Update, and API Requests - Delete.

Recording Schedule

Property NameRequired On Create?Updatable?TypeDescription
idNo

Automatically set
NoStringA unique ID assigned to the Recording Schedule.
nameYesNoStringRecording Schedule name.

There is no restriction on the number and type of characters. Duplicate schedule names are allowed.

Required when updating a schedule.
startYesNoISO8601 formatted date string without timezoneDesired Recording Schedule start date and time.

Required when updating a schedule.
recurrenceTypeYesYesStringType of Recording Schedule. One of:
- ONCE
- DAILY
- WEEKLY
- MONTHLY
slotIdYesNoStringThe ID of the slot to contain the Recording Schedule.

Required when updating a schedule.
allRenditionsNoNobooleanWhether to record all bitrates of your video.

true: record all bitrates (default).

false: don’t record all bitrates.

Required when updating a schedule.
durationYesYesISO8601 interval format stringRecording duration.

Default: PT4H

Required when updating a schedule.
segmentDurationYesYesISO8601 interval format stringSegment duration.

Default: PT4H

Required when updating a schedule.
timezoneYesYestimezone locality stringTimezone and sub-timezone in which recording should occur.
enabledNoNo, if set to falsebooleanDetermines whether or not the schedule is enabled for recording.
recordingStatusNo

Automatically set
NoStringPossible values:
- SCHEDULED
- RECORDING
- CANCELLING
- FINISHED
callbackUrlNoYesStringURL to which to post recording status.

Slot Status

The Live to VoD API does not support the creation or updating of slot status.
Property NameRequired On Create?Updatable?TypeDescription
idn/an/aStringSlot ID. Use this as the ID of the slot to contain the Recording Schedule.
statusn/an/aStringSlot status. One of:
- active: slot is streaming
- inactive: slot is not streaming

Slot

The Live to VoD API does not support the creation or updating of slots.
Property NameRequired On Create?Updatable?TypeDescription
idn/an/aStringThe slot ID is the unique identifier assigned to the slot upon slot creation. In this version of the API, the Slot ID is the same as the Stream name used in encoders.

This value will remain a unique identifier of the slot in future API versions, but the stream name may be a different field.
typen/an/aStringType of the slot. One of:
576
720
1080
transmux
namen/an/aStringThe title given to the slot when it was created. This is NOT the stream name used by encoders.
staten/an/aStringState of the slot. One of:
Pending
Ready
Failed
publishUrlsn/an/aObjectPublish URLs associated with the slot. Each object contains these String properties:
primary: primary publish URL
backup: backup publish URL
playbackInfon/an/aObjectPlayback URLs for the various output types.

Each object contains these String properties:
dash: playback URL for DASH output
hls: playback URL for HLS output
hds: playback URL for HDS output
rtmp: List of playback URLs for RTMP output
mss: List of playback URLs for MSS output
rtsp: List of playback URLs for RTSP output
mediaVaultTypen/an/aStringType of MediaVault protection. One of:
NONE
COOKIE
URL
URL_WITH_SUB_MANIFESTS
mediaVaultSecretKeyn/an/aStringMediaVault secret key known only to the customer and Edgio.

Null if MediaVault is not configured for the slot
regionn/an/aStringRegion in which to publish Possible values:
north-america
europe
asia-pacific
profilesn/an/aArray of profile objectsSee Profile.

Profile

A Profile object specifies the audio and video rendition(s) configured for a slot.
The Live to VoD API does not support the creation or updating of profiles.
Property NameRequired On Create?Updatable?TypeDescription
namen/an/aStringName of profile.
videoBitraten/an/aNumberProfile’s video bitrate in bits/second.
audioBitraten/an/aNumberProfile’s audio bitrate in bits/second.
videoWidthn/an/aNumberProfile’s video width.
videoHeightn/an/aNumberProfile’s video height.

API Requests - Query

The following methods are available for requesting content information for Recording Schedules, slots, and slot status:

Get a recording schedule

URL: https://apis.llnw.com/config-api/v1/live/recording/shortname/{account name}/schedules/{scheduleId}
Formats: JSON
HTTP Method: GET
Requires Authentication: Yes. See Authentication - Signing Requests.
Parameters: No payload parameters required
Response: The retrieved Recording Schedule.
Errors: Invalid value, Missing signature, A schedule does not exist

Get all recording schedules

URL: https://apis.llnw.com/config-api/v1/live/recording/shortname/{account name}/schedules
Formats: JSON
HTTP Method: GET
Requires Authentication: Yes. See Authentication - Signing Requests.
Optional Query Parameter: slotId: If specified, the system will only return a list of Recording Schedules that are configured for the Slot.
Response: A list of the retrieved Recording Schedules.
Errors: - Invalid value
-Missing signature

Get all slots

URL: https://apis.llnw.com/config-api/v1/live/shortname/{account name}/slots
Formats: JSON
HTTP Method: GET
Requires Authentication: Yes. See Authentication - Signing Requests.
Parameters: None
Response: A list of Slots.
Errors: Invalid value, Missing signature

Get the streaming status of a slot

URL: https://apis.llnw.com/config-api/v1/live/shortname/{account name}/slots/{slotId}/status
Formats: JSON
HTTP Method: GET
Requires Authentication: Yes. See Authentication - Signing Requests.
Parameters: None
Response: The slot’s Streaming Status.
Errors: Invalid value, Missing signature, The slot does not exist

API Requests - Create and Update

The following methods are available for creating and updating schedules:

Create a recording schedule

URL: https://apis.llnw.com/config-api/v1/live/recording/shortname/{account name}/schedules
Formats: JSON
HTTP Method: POST
Requires Authentication: Yes. See Authentication - Signing Requests.
Parameters:
KeyValue
nameName of the Recording Schedule

String

Required
startStart time in the specified timezone.

ISO8061 formatted date and time string without timezone.

Example: 2018-10-01T12:00:00

Required
durationDuration of the recording.

ISO8601 interval format string.

Example: PT4H

Required
segmentDurationSegment duration of the recording. Use this value to break up recordings into smaller files.

String

Maximum value: 4 hours (PT4H)

Example: PT4H

Required
slotIdThe ID of the MMD Live Slot to record.

String

Required
recurrenceTypeType of Recording Schedule to create.

One of:
- ONCE
- DAILY
- WEEKLY
- MONTHLY

String

Required
allRenditionsDetermines whether to record all renditions of a slot.

Boolean

If false, the system will only record the highest bitrate rendition of the slot.

Optional.

Default true
enabledDetermines whether or not the Recording Schedule is enabled.

Optional. Default true
callbackUrlURL to which the system will make POST requests to at various points in the recording lifecycle.

Must be a valid http or https URL

String

Optional
timezoneTimezone locality string. The timezone that the system will record is based on the start parameter.

Example: America/New_York

String

Required
Example: The following payload will create a schedule that will record all renditions every Friday for 1 hour at noon in the America/Phoenix timezone starting on March 1, 2019.
1{
2 "name": "my-recording-schedule",
3 "start": "2019-03-01T12:00:00",
4 "recurrenceType": "WEEKLY",
5 "slotId": "<slot_id>",
6 "allRenditions": true,
7 "duration": "PT1H",
8 "segmentDuration": "PT1H",
9 "timezone": "America/Phoenix",
10 "enabled": true,
11 "callbackUrl": "http://www.server.com/api/callback"
12}
Response: The created Recording Schedule with the following additional fields:
KeyValue
idString UUID of the recording schedule
recordingStatusStatus of the recording schedule. One of:
- SCHEDULED
- RECORDING
- CANCELLING
- FINISHED
Errors: Invalid value, Missing signature

Update an existing recording schedule

Changes to a recording schedule, while a recording schedule is recording, may not take effect until the recording’s next occurrence.
URL: https://apis.llnw.com/config-api/v1/live/recording/shortname/{account name}/schedules/{scheduleId}
Formats: JSON
HTTP Method: PUT
Requires Authentication: Yes. See Authentication - Signing Requests.
Updatable Parameters: You can update the following fields only:
  • start
  • duration
  • recurrenceType
  • enabled May only be set to false. It cannot be changed to true when it is currently false.
  • callbackUrl
  • timezone
‘Schedule’ Object Parameter: A complete recording schedule object is required. PATCH requests are not supported.
KeyValue
nameName of the Recording Schedule

String

Required
startStart time in the specified timezone.

ISO8061 formatted date and time string without timezone.

Example: 2018-10-01T12:00:00

Required
durationDuration of the recording.

ISO8601 interval format string.

Example: PT4H

Required
segmentDurationSegment Duration of the recording. Use this value to break up recordings into smaller files.

String

Maximum value: 4 hours (PT4H)

Example: PT4H

Required
slotIdThe ID of the MMD Live Slot to record.
String

Required
recurrenceTypeType of Recording Schedule to create.

One of:
- ONCE
- DAILY
- WEEKLY
- MONTHLY

String

Required
allRenditionsDetermines whether to record all renditions of a slot.

Boolean

If false, the system will only record the highest bitrate rendition of the slot.

Required
enabledDetermines whether the Recording Schedule is enabled.

Required
callbackUrlURL the system will make POST requests to at various points in the recording lifecycle.

Must be a valid http or https URL

String

Optional
timezoneTimezone locality string. The timezone that the system will record is based on the start parameter.

Example: America/New_York

String

Required
Response: The updated Recording Schedule.
Errors: Invalid value, Missing signature

API Requests - Delete

A Recording Schedule can only be deleted if it is in the FINISHED state.
A Recording Schedule will be in the FINISHED state if:
  • Its recurrenceType is ONCE, and the recording has completed OR
  • Its enabled field is false
URL: https://apis.llnw.com/config-api/v1/live/recording/shortname/{account name}/schedules{scheduleId}
Formats: JSON
HTTP Method: DELETE
Requires Authentication: Yes. See Authentication - Signing Requests.
Parameters: No payload parameters required
Response: The deleted Recording Schedule.
Errors: Invalid value, Missing signature

Authentication - Signing Requests

The Live to VoD APIs use symmetric key cryptography and HMAC (Hashed Message Authentication Code) for message authentication and user identification. To secure all calls to the API, an HMAC digest signature is applied to every request by using the following authentication headers:
X-LLNW-Security-Principal – Name of the user performing the request. Services lookup shared keys by the username to authenticate a message. Since shared keys are stored on a per-user basis, an attacker would have to know both the username and the shared key for that user to impersonate another user.
X-LLNW-Security-Timestamp – Unix time in milliseconds used to prevent replay attacks. If the timestamp is more than X seconds old (usually 300), the message expires, and an error code is returned. Note: System clock skew minimization is an important consideration for message expiration.
X-LLNW-Security-Token – MAC hash-generated with the user’s shared key. It is calculated based on data that is sent to the server. This token is generated twice, once by the client and once by the server - to compare with the one passed by the client. If the token provided by the client matches the token generated by the server, the message is authentic.
The shared key is a large unique key created for use with the HmacSHA256 MAC algorithm. The Control maintains a unique and enciphered shared key for every user in the system. It is stored in HEX format and should be decoded to ASCII before usage. Users may access or regenerate this key at any time by using tools in the Control under My Settings > Edit My Profile. X-LLNW-Security-Token is formed by applying MAC digest for the “data string”; i.e. REQUEST_METHOD + URL + QUERY_STRING (if present) + TIMESTAMP + REQUEST_BODY (if present)

Starting and Stopping Recordings

You can easily start and stop recording.

Start a Recording

To start a recording, you simply create a new recording schedule and set the start attribute to the current time:
POST a payload like the following to the URL in Create a recording schedule:
1{
2 "name": "my-recording-schedule",
3 "start": "2019-03-01T12:00:00", // it is currently noon on March 1, 2019
4 "recurrenceType": "ONCE", // it is recommended to use ONCE for a one-time recording
5 "slotId": "<slot_id>",
6 "timezone": "America/Phoenix",
7 "duration": "PT1H",
8 "segmentDuration": "PT1H",
9 "callbackUrl": "http://www.server.com/api/callback"
10}

Stop a Recording

To stop a recording, you update the recording schedule’s enabled field to be false.
PUT a payload like the following to the URL in Update an existing recording schedule:
1{
2 "enabled": false
3}
The recording will stop immediately and begin post-processing.

Callbacks

Live to VoD provides the ability to monitor the state of your recordings through callbacks. When you create a recording, you can optionally provide a URL to which Live to VoD sends POST requests for these recording stages:
  • Recording of a segment1 has started
  • The recording has finished, and post-processing has begun
  • Recorded files are now available on the customer storage account
1A segment is a single entity of a recording. For example, if a schedule says to record for two hours every Friday, that 2-hour recording will be a segment. Segments have an upper limit of 4 hours. If a schedule says to record for 5 hours every Friday, there will be two segments: one 4-hour segment and one 1-hour segment.

Payload Received in the POST Requests

Callbacks are valid only for one-time and recurring recordings.
The payload contains a recording segment that includes a list of renditions.

Recording Segment Fields

FieldTypeDescription
idStringThe ID of the recording segment. UUID
schedule_idStringThe ID of the recording schedule. UUID
start_timeISO8601 formatted date stringStart time (UTC) of the recording segment.

Example: 2018-01-01T12:00:00Z
end_timeISO8601 formatted date string.End time (UTC) of the recording segment.

Example: 2018-01-01T12:00:00Z
statusStringStatus of the recording segment. One of:
- RECORDING
- PROCESSING
- FILES_READY
renditionsList of Rendition objectsList of the recorded renditions of the recording segment.

Rendition Object

FieldTypeDescription
bitrateStringThe bitrate of recorded rendition in kbps.
pathStringPath to the recorded file on the storage.
file_sizeLongFile size of the recorded file in bytes.

Response Samples

At various times, callbacks are sent, the payload looks slightly different. For example, when the recording starts and post-processing, the system does not have information about the renditions (as the files have not been fully recorded, converted to mp4, and uploaded). The following sections describe what the payload will look like at the various points.

RECORDING

1{
2 "id": "0e73e1f7-86b7-446f-8283-540dcb92bc08",
3 "schedule_id": "58a3dc1f-a12d-43e0-bb8e-c57201fd329f",
4 "start_time": "2018-10-01T17:00:00Z",
5 "end_time": "2018-10-01T18:00:00Z",
6 "status": "RECORDING",
7 "renditions": []
8}

PROCESSING

1{
2 "id": "0e73e1f7-86b7-446f-8283-540dcb92bc08",
3 "schedule_id": "58a3dc1f-a12d-43e0-bb8e-c57201fd329f",
4 "start_time": "2018-10-01T17:00:00Z",
5 "end_time": "2018-10-01T18:00:00Z",
6 "status": "PROCESSING",
7 "renditions": []
8}

FILES_READY

1{
2 "id": "0e73e1f7-86b7-446f-8283-540dcb92bc08",
3 "schedule_id": "58a3dc1f-a12d-43e0-bb8e-c57201fd329f",
4 "start_time": "2018-10-01T17:00:00Z",
5 "end_time": "2018-10-01T18:00:00Z",
6 "status": "FILES_READY",
7 "renditions": [
8 {
9 "bitrate": "1928000",
10 "path": "/path_prefix/slot_name/schedule_name/segment_start_time/1928000.mp4",
11 "file_size": 14479340
12 },
13 {
14 "bitrate": "1128000",
15 "path": "/path_prefix/slot_name/schedule_name/segment_start_time/1128000.mp4",
16 "file_size": 7807115
17 }
18 ]
19}