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.The unique identifier of the video item
The media source identifier
The device id of the client requesting
The play session identifier for tracking
The segment container format:
ts- MPEG-TS (default, more compatible)fmp4- Fragmented MP4 (better compression, requires modern clients)
The length of each segment in seconds (typically 3-10 seconds)
The minimum number of segments to generate before starting playback
Specify the video codec:
h264, hevc, vp9, av1Specify the audio codec:
aac, mp3, opus, ac3The video bitrate in bits per second
The audio bitrate in bits per second
Maximum video width in pixels
Maximum video height in pixels
Enable adaptive bitrate streaming with multiple quality variants
Enable trickplay image playlists being added to master playlist for thumbnail previews
Starting position in ticks
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.The unique identifier of the video item
The output container format
The media source identifier
The device id of the client
The play session identifier
The segment container:
ts or fmp4Length of each segment in seconds (default: 6)
Minimum number of segments before playback starts (default: 2)
Video codec to use
Audio codec to use
Video bitrate in bits per second
Maximum width in pixels
Maximum height in pixels
Whether to include subtitle streams in the manifest
Whether to always burn in subtitles when transcoding
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.The unique identifier of the audio item
The media source identifier
The device id of the client
The play session identifier
The segment container format
Length of each segment in seconds
Audio codec to use:
aac, mp3, opusAudio bitrate in bits per second
Maximum streaming bitrate
Maximum number of audio channels
Enable adaptive bitrate streaming
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.The video item identifier
The playlist identifier
The segment identifier
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.The audio item identifier
The segment identifier
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.The device id of the client
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)