Download HLS Streams with FFmpeg: Step-by-Step
Step-by-Step HLS Download
- Install FFmpeg — from ffmpeg.org or your package manager.
- Get the M3U8 URL — usually ends in
.m3u8. - Open a terminal — Command Prompt, PowerShell, Terminal, or shell.
- Run:
ffmpeg -i "https://example.com/stream.m3u8" -c copy output.mp4
- Wait for progress — time, speed, and size update until complete.
Encrypted Streams (AES-128)
If the playlist includes #EXT-X-KEY and the key is public, FFmpeg often decrypts automatically while downloading. If not, ensure the key URI is reachable (network/auth). DRM-protected streams cannot be decrypted with generic tools. Related: complete FFmpeg convert guide.
Live vs VOD
VOD playlists end with #EXT-X-ENDLIST and download to completion. Live playlists never end — use -t for duration or stop with Ctrl+C. Guide: download M3U8 with FFmpeg.
Automating Multiple Downloads
#!/bin/bash
urls=(
"https://example.com/stream1.m3u8"
"https://example.com/stream2.m3u8"
)
i=1
for url in "${urls[@]}"; do
ffmpeg -i "$url" -c copy "out-$i.mp4"
i=$((i+1))
doneOr use yt-dlp with a URL list. Batch ideas: batch download M3U8.
When FFmpeg Is Overkill
For one-off downloads without a terminal, use our free browser downloader — multi-threaded segment fetch and merge, no install.
Frequently Asked Questions
How do I download HLS with FFmpeg?ffmpeg -i "url.m3u8" -c copy out.mp4
Does it work on Windows?
Yes — install FFmpeg and run the same command in PowerShell or CMD.
Can it download encrypted HLS?
AES-128 if the key is reachable; not DRM.
How do I stop a live capture?
Ctrl+C, or set -t seconds in advance.