Below are two small playlists you can copy as they are: a master playlist that offers two qualities, and a media playlist that lists three segments. Each is followed by the meaning of every line.
A master playlist
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=800000,RESOLUTION=640x360,CODECS="avc1.42c01e,mp4a.40.2"
360p/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2800000,RESOLUTION=1280x720,CODECS="avc1.64001f,mp4a.40.2"
720p/index.m3u8
#EXTM3U— must be the first line. A file that starts with anything else is not a playlist.#EXT-X-VERSION:3— the revision of the format the file is written for. Version 3 covers everything used here, including decimal segment durations.#EXT-X-STREAM-INF:BANDWIDTH=800000,...— one quality level.BANDWIDTHis the bitrate in bits per second (about 800 kbps here),RESOLUTIONis the picture size, andCODECSnames the video and audio codecs so a player can skip a variant it cannot decode.360p/index.m3u8— the address of that variant's own playlist. It belongs to the#EXT-X-STREAM-INFline directly above it and is resolved against this file's address.- The second pair of lines is the same thing at 720p and about 2.8 Mbps. The player picks one by comparing
BANDWIDTHto the connection it measures, and can switch while playing.
There is no duration anywhere in this file, and that is correct: the length belongs to the media playlists it points at.
A media playlist
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:6.000,
seg-00000.ts
#EXTINF:6.000,
seg-00001.ts
#EXTINF:4.200,
seg-00002.ts
#EXT-X-ENDLIST
#EXT-X-TARGETDURATION:6— no segment is longer than 6 seconds once rounded to a whole number. Every#EXTINFbelow must fit under it.#EXT-X-MEDIA-SEQUENCE:0— the number of the first segment in the list. It stays at 0 here because nothing has been dropped; on a live stream it climbs as old segments leave the top.#EXTINF:6.000,— the length of the segment on the next line, in seconds. The part after the comma is an optional title, empty here.seg-00000.ts— the segment itself, an address relative to this file.- The last segment is shorter (
4.200), which is normal: a recording rarely ends on an exact multiple of the segment length. #EXT-X-ENDLIST— the list is complete. Add up the#EXTINFvalues and you get the running time: 6.000 + 6.000 + 4.200 = 16.2 seconds.
A line you will meet in real playlists
If the segments are encrypted, a line like this appears above the first one it covers:
#EXT-X-KEY:METHOD=AES-128,URI="key.bin",IV=0x00000000000000000000000000000001
METHOD names the encryption and URI says where the key file lives. It applies to every segment after it until another #EXT-X-KEY line replaces it. This site only reads the line: the tools here do not request keys or decrypt anything.
Try them
Check the two examples. Copy each block into a text file, save it with a .m3u8 extension and open it in the m3u8 playlist reader. The first reads as a master playlist with two variants; the second as a media playlist with three segments and 16 seconds of media.
Play a real stream. The examples point at no real files, so they will not play. For something that does, paste this public test address, published by Mux for testing players, into the m3u8 player:
https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8
It is a master playlist with five variants, from 320×184 up to 1920×1080. Paste the same address into the playlist reader to see the five lines laid out, or open it in the HLS player to switch between levels by hand.
What to do with your own
If your playlist is the one that fails, reading why an m3u8 will not play is the faster route. If it works and you want one file out of it, the m3u8 to MP4 tool re-wraps the segments, and the MP4 player checks the result.
Rights holders can reach us through the notice procedure.