What is a manifest file?
A video manifest gets its name from the third definition of manifest (according to Merriam-Webster):
- a list of passengers or an invoice of cargo for a vehicle (such as a ship or plane)
In HTTP Live Streaming (HLS) video streaming, the manifest files have the extension
Video manifest files in HLS streaming
There are often multiple manifest files per video stream; a single primary playlist (historically called a 'master' playlist), and multiple media playlists.
The primary manifest is the first file that is requested by the player when video playback begins. This file will list all of the available streaming versions of the video that are available. There are 2 lines per version, and they typically look like this:
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=4400000,RESOLUTION=3840x2160, CODECS="avc1.42e030,mp4a.40.2" /processing_video/2160/manifest.m3u8
The first line of this manifest entry says here is some stream information: it requires bandwidth of 4.4 MBPS, has 4k video resolution(3840x2160), and it describes the codecs (so the player can find a compatible version for the browser).
The second line is a link to where this version of the video can be found. You may notice that this is also a m3u8 manifest file - it is a media manifest file.
The primary manifest has links pointing to each media manifest.. The media manifest files generally have the following appearance:
#EXTM3U #EXT-X-VERSION:3 #EXT-X-ALLOW-CACHE:NO #EXT-X-TARGETDURATION:4 #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-PLAYLIST-TYPE:VOD #EXT-X-KEY:METHOD=AES-128,URI="aes.key",IV=0x07B1D7401B75CA2937353EC4550FEE5D #EXTINF:4.000000, 0000.ts #EXTINF:4.000000, 0001.ts #EXTINF:4.000000, 0002.ts #EXTINF:4.000000, 0003.ts #EXTINF:4.000000, 0004.ts #EXTINF:0.120000, 0005.ts #EXT-X-ENDLIST
This file lists all of the video segments available for the video stream. Each segment is 4 seconds long (EXTINF), and there is a link to the file.
How players use the manifest files
The video player uses the primary playlist to decide which quality of video should be played. There are several considerations made by the player: the available network speed, and the size of the playback window. If either of these parameters change, the player can adjust the stream to a different quality video - request the media manifest, and switch immediately to requesting the media files at a given time in the video playback.
api.video and manifest files
At api.video, every video uploaded is encoded as an HLS video stream with up to 6 different quality/bitrates, and API responds with 3 links: the primary manifest, the player url, and an iframe embed. (the video player & iframe embed links use the primary manifest to begin playback). With just a simple upload, all your HLS streaming and manifest needs are taken care of for you.