Overview
HTTP Live Streaming (HLS) is an adaptive bitrate streaming protocol developed by Apple. Jellyfin generates dynamic HLS playlists and serves media segments for smooth, adaptive streaming across diverse network conditions and devices.HLS Architecture
HLS streaming consists of:- Master Playlist (
.m3u8) - Lists available quality variants - Media Playlists (
.m3u8) - Lists segments for a specific quality - Media Segments (
.tsor.mp4) - Actual video/audio data chunks
Video HLS Endpoints
Get Master HLS Video Playlist
Retrieves the master playlist containing all available video stream variants.string
required
The unique identifier of the video item
string
required
The media source identifier
string
The device id of the client requesting
string
The play session identifier for tracking
string
The segment container format:
ts- MPEG-TS (default, more compatible)fmp4- Fragmented MP4 (better compression, requires modern clients)
integer
The length of each segment in seconds (typically 3-10 seconds)
integer
The minimum number of segments to generate before starting playback
string
Specify the video codec:
h264, hevc, vp9, av1string
Specify the audio codec:
aac, mp3, opus, ac3integer
The video bitrate in bits per second
integer
The audio bitrate in bits per second
integer
Maximum video width in pixels
integer
Maximum video height in pixels
boolean
default:"false"
Enable adaptive bitrate streaming with multiple quality variants
boolean
default:"true"
Enable trickplay image playlists being added to master playlist for thumbnail previews
integer
Starting position in ticks
string
M3U8 master playlist with available stream variants
200 OK- Master playlist returned401 Unauthorized- Authentication required404 Not Found- Item not found
Example Request
Example Response
Get Live HLS Video Stream
Generates a live HLS stream with on-demand transcoding.string
required
The unique identifier of the video item
string
The output container format
string
The media source identifier
string
The device id of the client
string
The play session identifier
string
The segment container:
ts or fmp4integer
Length of each segment in seconds (default: 6)
integer
Minimum number of segments before playback starts (default: 2)
string
Video codec to use
string
Audio codec to use
integer
Video bitrate in bits per second
integer
Maximum width in pixels
integer
Maximum height in pixels
boolean
default:"true"
Whether to include subtitle streams in the manifest
boolean
default:"false"
Whether to always burn in subtitles when transcoding
string
M3U8 media playlist with segment URLs
200 OK- HLS live stream playlist returned401 Unauthorized- Authentication required
Example Request
Get Variant HLS Video Playlist
Retrieves a specific quality variant playlist.200 OK- Variant playlist returned401 Unauthorized- Authentication required
Audio HLS Endpoints
Get Master HLS Audio Playlist
Retrieves the master playlist for audio streaming.string
required
The unique identifier of the audio item
string
required
The media source identifier
string
The device id of the client
string
The play session identifier
string
The segment container format
integer
Length of each segment in seconds
string
Audio codec to use:
aac, mp3, opusinteger
Audio bitrate in bits per second
integer
Maximum streaming bitrate
integer
Maximum number of audio channels
boolean
default:"false"
Enable adaptive bitrate streaming
string
M3U8 master playlist for audio streaming
200 OK- Master playlist returned401 Unauthorized- Authentication required
Example Request
HLS Segment Endpoints
Get HLS Video Segment
Retrieves a specific video segment.string
required
The video item identifier
string
required
The playlist identifier
string
required
The segment identifier
string
required
The segment container extension:
ts or mp4200 OK- Segment returned404 Not Found- Segment not found
Get HLS Audio Segment (Legacy)
Retrieves a specific audio segment.string
required
The audio item identifier
string
required
The segment identifier
string
required
The file extension:
mp3 or aac200 OK- Segment returned400 Bad Request- Invalid segment
Stopping Active Encoding
Stop Encoding Process
Stops an active encoding/transcoding process.string
required
The device id of the client
string
required
The play session identifier
204 No Content- Encoding stopped successfully401 Unauthorized- Authentication required
Example Request
HLS Best Practices
Segment Length
Recommended Values:- Low Latency: 2-3 seconds
- Standard: 6 seconds (Jellyfin default)
- High Efficiency: 10 seconds
- Shorter segments: Lower latency, faster quality switching, higher overhead
- Longer segments: Better compression, less overhead, slower adaptation
Segment Container
MPEG-TS (ts)
- ✅ Maximum compatibility
- ✅ Works with older devices
- ❌ Less efficient compression
- ❌ Larger file sizes
fmp4)
- ✅ Better compression
- ✅ Smaller file sizes
- ✅ Supports more codecs (including FLAC)
- ❌ Requires FFmpeg 7.0+ for certain features
- ❌ May not work with older clients
Adaptive Bitrate Streaming
WhenenableAdaptiveBitrateStreaming=true, Jellyfin generates multiple quality variants:
Playlist Types
VOD (Video on Demand)Trickplay Thumbnails
WhenenableTrickplay=true, the master playlist includes thumbnail image playlists for seek previews:
Client Implementation Tips
- Segment Buffering: Buffer at least 3 segments ahead of playback position
- Quality Switching: Switch quality variants at segment boundaries
- Error Handling: Retry failed segments with exponential backoff
- Bandwidth Estimation: Track download speed to predict optimal quality
- Playlist Refresh: Refresh live playlists periodically (every target duration)