Playlists Resource

The Playlists resource allows you to obtain a HLS or MPEG DASH playlist for any file encoded in MP4 format or any job with outputs in MP4 format. If you request the playlist for a job ID with multiple outputs in MP4 format, you will receive a playlist including each of the outputs as a representation (e.g. different resolutions or different bitrates).

If you want only a certain subset of the outputs of a job in your playlist (e.g. you encoded also to 4K resolution output as part of the job but you don't want to offer only resolutions below 4K for streaming), you can also select just those file IDs you want in the playlist by providing a comma-separated list of file IDs (note: all the file IDs must belong to the same job though).

In general, the /playlists endpoint works very similar to the /files/downloads API for regular downloads. Most of the query parameters available with /files/downloads also are available for the /playlists endpoint and temporary playlist URLs can be also created via HMAC-signing exactly the same way than for regular file downloads in order to enable access without an auth token.

Available Methods

GET /playlists/hls.m3u8

Allows obtaining a HLS playlist of one or more file(s) encoded in MP4 format by a successfully finished conversion Job.

GET /playlists/dash.mpd

Allows obtaining a MPEG DASH playlist of one or more file(s) encoded in MP4 format by a successfully finished conversion Job.


Authorization Header (optional)

  • Bearer token: OAuth 2.0 API access token. If not provided, a HMAC signature must be used.

Parameters

  • format : json or xml. This will override the Request Accept header.
  • human : true or false. Causes the response to be in a structured, more human-readable form. Useful when calling the API through curl or a browser.
  • file_id: ID specifying one or more file(s) in the Files resource. The specified file must be encoded in MP4 format. More than one file ID can be provided by separating the individual file IDs by "," comma delimiter. All file IDs must belong the same job.
  • job_id: Shortcut for selecting all the output file IDs of a given job. Equivalent to listing all output file IDs of a job comma-separated in the "file_id" parameter. The "file_id" and "job_id" parameters should not be used together. Use either "job_id" or "file_id".
  • autograph_tag: A unique tag to be embedded dynamically with the resulting video stream so it becomes traceable via Xvid AutoGraph watermarking technology (If the file ID you specified does not have the "autograph: true" property, then do not set the "autograph_tag" parameter!)
  • expiry_time: Desired expiry time (in seconds since epoch) to attach to the referenced sub-playlists and/or video segments inside the playlist, if applicable. Note that the time, like all the timestamps used with our API, must be given as UTC time (if your server is configured to a different timezone, make sure you obtain UTC time and not local time).
  • anti_fraud: Enables a set of features to prevent link sharing, to block users behind anonymizing proxies, detect general fraud and block known serial pirates from accessing the playlist.
  • ip: Allows only clients with the specified IP address to use the retrieve the playlist. The IP must be specified as a 32-bit integer (example: 192.168.2.1 -> (192 << 24) | (168 << 16) | (2 << 8) | 1 = 3232236033)

Response

Returns a playlist either in HLS or MPEG DASH format depending on the requested API endpoint.

curl -X GET -H "Authorization: Bearer um9VmyJKTPGFqpkL_THjGE5rkXqfURDYqQ8MTBVidG3PtwkfABIdx6s_z9WlFl4_j" "https://api.xvid.com/v1/playlists/hls.m3u8?autograph_tag=XVID_TEST&file_id=54820cec18bac397e161aebc"
#EXTM3U
#EXT-X-MEDIA:NAME="Xvid MediaHub Video",LANGUAGE="en",AUTOSELECT="yes",DEFAULT="yes",URI="https://autograph.xvid.com:443/api/v1/segments/job_id/5daedac4e4b03303cd50b851/base/547f3eede4b025bcbff38655%3Barchive%3B/tag/XVID_TEST/crypt_tag/O_NyeiFPPpPVZXmqcwEPLZ7vGTrFPMiAwcqMgttOEOlQ/client_id/57fc1561e4b09eea4328115e/user_id/547f3eede4b025bcbff38655/expiry_time/1683296550/sign/2d62b553801640170db28faad5cde5910589ac7d/map/true/url/5dafdac4e4b03703cd50b851/output_0/QIHoEmOnoxv5-0GovkRp66e5qK4fl7dchX_audio.m3u8",CODECS="mp4a.40.2",TYPE="AUDIO",GROUP-ID="audio"
#EXT-X-STREAM-INF:BANDWIDTH=8800000,AUDIO="audio",RESOLUTION=1920x1080,CODECS="avc1.640028,mp4a.40.2"
https://autograph.xvid.com:443/api/v1/segments/job_id/5daedac4e4b03303cd50b851/base/547f3eede4b025bcbff38655%3Barchive%3B/tag/XVID_TEST/crypt_tag/O_NyeiFPPpPVZXmqcwEPLZ7vGTrFPMiAwcqMgttOEOlQ/client_id/57fc1561e4b09eea4328115e/user_id/547f3eede4b025bcbff38655/expiry_time/1683296550/sign/2d62b553801640170db28faad5cde5910589ac7d/map/true/url/5daedac4e4b03703cd50b851/output_0/QIHoEmOnoxv5-0GovkRp66e5qK4fl7dchX_video.m3u8
  • No labels