Skip to content
Projects

About

Cross-Platform, modern and powerful stream downloader for MPD/M3U8/ISM. English/简体中文/繁體中文.

Design & Media

How these counts are measured

Measured star growth

in 24h
+5
in 7 days
+39
in 15 days
+72
in 1 month
+137

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.en.md

Original

N_m3u8DL-RE [EN]

Cross-platform DASH/HLS/MSS download tool. Supports on-demand and live streaming (DASH/HLS).

img img img img img

If you encounter a bug, please first confirm whether you are using the latest version of the software. (If you are using a release version, it is recommended to go to the Actions page to download the latest automatically built version and check if the issue has already been fixed.) If you are using the latest version and the issue still exists, you can check the Issues section to see if someone else has encountered a similar problem. If not, feel free to open a new issue.


The built-in terminal in older versions of Windows may not support this program. As an alternative, try running it in cmder.

Arch Linux users can install from AUR: n-m3u8dl-re-bin, n-m3u8dl-re-git

# Install N_m3u8DL-RE release version on Arch Linux and its derivatives (not maintained by the author)
yay -Syu n-m3u8dl-re-bin

# Install N_m3u8DL-RE development version on Arch Linux and its derivatives (not maintained by the author)
yay -Syu n-m3u8dl-re-git

PowerShell completion

Supports Windows PowerShell 5.1 and PowerShell 7. The completion script is embedded in the executable. Add N_m3u8DL-RE to PATH, then load it in PowerShell:

N_m3u8DL-RE --generate-completion powershell | Out-String | Invoke-Expression

Type N_m3u8DL-RE --sub- and press Tab to complete option names. Options such as --sub-format, --log-level and --ui-language also complete their accepted values. Files and directories use PowerShell's default path completion. Calling the executable with ./N_m3u8DL-RE or its full path also works.

Loading applies to the current session. To enable completion on startup, add the command above to $PROFILE. Use --generate-completion powershell on its own to view or save the script.

Cookie files

Use --cookies cookies.txt to load a browser export in Netscape cookie format:

N_m3u8DL-RE "https://example.com/video.m3u8" --cookies "cookies.txt"

Cookies are matched by domain, path, HTTPS requirement and expiration for manifests, keys, initialization files and segments, including VOD and live streams. A custom -H "Cookie: ..." header takes precedence. Server cookie updates are kept in memory and are not written back to the file.

Configuration file

Save common options in a UTF-8 text file. The program automatically reads:

  • Linux / macOS: ~/.config/N_m3u8DL-RE/config.conf, or $XDG_CONFIG_HOME/N_m3u8DL-RE/config.conf when XDG_CONFIG_HOME is an absolute path.
  • Windows: %APPDATA%\N_m3u8DL-RE\config.conf.

The program does not create this file automatically. A missing default file uses the built-in defaults. Configuration files use command-line argument syntax, support comment lines starting with #, and accept double-quoted values containing spaces:

# Common download options
-mt
--no-log
--auto-select
--thread-count 16
--save-dir "Downloads/My Videos"

Precedence is command line > configuration file > built-in defaults. Short and long aliases identify the same option. Command-line values replace configured values for single-value options; replaced values are not converted or read by download option parsers. Repeatable options such as --key, --ad-keyword and --mux-import are combined with configuration values first and command-line values last. -H / --header values are merged by case-insensitive header name: distinct headers are retained, and command-line values override configured headers with the same name. Use false to disable a configured boolean, for example --no-log false. A configured HTTP timeout counts as an explicit timeout and disables automatic live timeout adjustment.

N_m3u8DL-RE "https://example.com/video.m3u8" --thread-count 8
N_m3u8DL-RE "https://example.com/video.m3u8" --config "custom.conf"
N_m3u8DL-RE "https://example.com/video.m3u8" --no-config

--config FILE loads only the specified file instead of the default configuration; missing or invalid files are errors. --no-config disables configuration loading and cannot be combined with --config. Configuration files may contain download options only, not input URLs, configuration-loading options, help, version or completion actions. Relative paths use the current working directory. The executable directory and working directory are not searched automatically.

Help uses the configured UI language. Completion script generation and Tab completion do not read configuration files. Existing @args.txt response files remain supported and their arguments have command-line precedence.

For Docker, mount the file read-only at /config/config.conf and pass --config /config/config.conf, independently of the container's HOME or runtime user.

IPTV channel lists

# Select HTTP TS live channels interactively and record for 3 minutes
N_m3u8DL-RE channels.m3u --live-record-limit 00:03:00

# Select by channel name; for=all records all matching channels in separate files
N_m3u8DL-RE channels.m3u -sv "name=^Channel A$:for=best" --live-record-limit 00:03:00
N_m3u8DL-RE channels.m3u -sv "name=^Channel:for=all" --live-record-limit 00:03:00

Utility commands

Command Purpose
concat Append file bytes in order without parsing containers or requiring FFmpeg; use merge for complete MP4 files
merge Join media in sequence using FFmpeg stream copy without transcoding; codecs and track layouts must be compatible
mux Put video, audio and subtitles into separate tracks in one file, without joining inputs in sequence
doctor Check external tool paths, versions and the system environment; --json produces a diagnostic report

All three file tools accept -i FILE, -i DIR, or --input-dir DIR. Repeat -i to set input order; --input-dir cannot be combined with -i.

  • Automatic directory discovery prioritizes directories with RE track names, init files or parts layouts, selecting matching init and decrypted segments. Use mux for multi-track task directories. Single-part parts layouts are supported; multi-part VOD still needs separate handling.
  • Ordinary directories accept common audio/video formats such as TS, MP4, MKV, M4A, AAC and MP3; mux also accepts subtitles such as SRT, VTT and ASS. Discovery is non-recursive and uses natural filename order: clip1.mp4, clip2.mp4, clip10.mp4.
  • Use --pattern "*.mp4" with either directory syntax to select files explicitly, bypassing RE track discovery. This can override automatic track discovery and treat each file as a separate mux input. Use automatic discovery for RE init/media segments.
  • merge automatically uses DEMUXER for complete containers such as MP4, MKV and M4A, and LOCAL_HTTP for TS and init-based segment tracks. Explicit or configured --ffmpeg-concat-mode values take precedence.
  • Add --dry-run to preview the final input order, selected segments and merge mode without writing files or requiring FFmpeg. Outputs cannot overwrite input files; keep outputs outside input directories so later scans do not include old outputs.
# Concatenate file bytes without FFmpeg
N_m3u8DL-RE concat -i 1.ts -i 2.ts -o combined.ts

# Select files explicitly in natural filename order; --pattern also works with -i DIR
# --input-dir cannot be combined with -i
N_m3u8DL-RE concat --input-dir segments --pattern "*.ts" -o combined.ts

# Discover and merge MP4 or other media files in sequence, selecting the input mode automatically
N_m3u8DL-RE merge -i clips -o merged.mp4
# Select only MP4 files and preview their order and merge mode
N_m3u8DL-RE merge --input-dir clips --pattern "*.mp4" -o merged.mp4 --dry-run

# Mux video, audio and subtitles
# Subtitle timing is adjusted automatically, preserving source files; disable with --auto-subtitle-fix false
N_m3u8DL-RE mux -i video.mp4 -i audio.m4a -i subtitle.srt -o output.mp4
# Discover media and subtitles in an ordinary directory, treating each file as a separate input
N_m3u8DL-RE mux --input-dir tracks -o output.mkv

# Merge tracks and mux a single-part VOD download or live recording; original segments are preserved
N_m3u8DL-RE mux -i index_2026-10-10_23-56-12 -o recording.mkv

# Track directories also accept language and title metadata
N_m3u8DL-RE mux -i video_segments -i "path=audio_segments:lang=eng:name=English" -i "path=subtitle_segments:lang=chi:name=Chinese" -o recording.mkv

# Merge one track (automatically selecting matching init and decrypted segments)
N_m3u8DL-RE merge -i video_segments -o video.mp4
# Binary concatenation also supports encrypted segments for later decryption or processing
N_m3u8DL-RE concat -i video_segments -o video.mp4

# Set track language (lang), track title (name) and movie title (--title)
# --mux-import appends external audio or subtitles; lang and name are optional
N_m3u8DL-RE mux -i video.mp4 -i "path=audio.m4a:lang=eng:name=English" --mux-import "path=subtitle.srt:lang=zh-Hans:name=Simplified Chinese" --title "Movie Title" -o output.mkv
# Escape colons within compound values as \:, e.g. path=C\:\media\audio.m4a:lang=eng

# Check tool versions and system environment
N_m3u8DL-RE doctor
N_m3u8DL-RE doctor --json > doctor.json

Command line parameters

Long automatic names, custom save names and expanded filename patterns are shortened with a hash suffix to reduce collisions. Limits use UTF-8 bytes without splitting Chinese characters or emoji, with space reserved for automatic timestamps and media extensions.

Description:
  N_m3u8DL-RE 0.6.0 20261012

Usage:
  N_m3u8DL-RE <input> [options]

Arguments:
  <input>  Input Url or File

Options:
  --config <FILE>                                         Read a configuration file instead of the user default; command-line options take precedence
  --no-config                                             Disable configuration loading; cannot be combined with --config
  --tmp-dir <tmp-dir>                                     Set temporary file directory
  --save-dir <save-dir>                                   Set output directory
  --save-name <save-name>                                 Set output filename
  --save-pattern <save-pattern>                           Set output filename pattern. Use "--morehelp save-pattern" for variables and examples
  --log-file-path <log-file-path>                         Set log file path, Example: C:\Logs\log.txt
  --base-url <base-url>                                   Set BaseURL
  --thread-count <number>                                 Set download thread count [default: 10]
  --download-retry-count <number>                         Retries per segment; live segments retry separately within a bounded recovery window [default: 7]
  --http-request-timeout <seconds>                        HTTP timeout in seconds; live segment waits are capped at twice the segment duration, including manual settings; bounds read stalls, not total download time [default: 100]
  --http-version <1.1|2>                                 HTTP version; defaults to 1.1; selecting 2 prefers HTTP/2 and allows fallback to HTTP/1.1 [default: 1.1]
  --force-ansi-console                                    Force assuming the terminal supports ANSI output
  --no-ansi-color                                         Remove ANSI colors
  --auto-select                                           Automatically selects the best tracks of all types [default: False]
  --skip-merge                                            Skip segments merge [default: False]
  --skip-download                                         Skip download [default: False]
  --check-segments-count                                  Check if the actual number of segments downloaded matches the expected number [default: True]
  --binary-merge                                          Binary merge [default: False]
  --ffmpeg-concat-mode <DEMUXER|LOCAL_HTTP|PROTOCOL>      FFmpeg merge input: LOCAL_HTTP local virtual input (default), PROTOCOL opens all segments directly, DEMUXER uses a file list [default: LOCAL_HTTP]
  --use-ffmpeg-concat-demuxer                             Merge with the concat demuxer; equivalent to --ffmpeg-concat-mode DEMUXER, taking precedence when both are supplied at the same level [default: False]
  --del-after-done                                        Delete temporary files when done [default: True]
  --no-date-info                                          Date information is not written during muxing [default: False]
  --no-log                                                Disable log file output [default: False]
  --write-meta-json                                       Write meta json after parsed [default: True]
  --append-url-params                                     Append input URL query parameters to segments; local manifests use --base-url parameters [default: False]
  -mt, --concurrent-download                              Concurrently download the selected audio, video and subtitles [default: False]
  -H, --header <header>                                   Pass custom header(s) to server, Example:
                                                          -H "Cookie: mycookie" -H "User-Agent: iOS"
  --cookies <FILE>                                        Load cookies from a Netscape cookie file; a custom Cookie header takes precedence
  --sub-only                                              Select only subtitle tracks [default: False]
  --sub-format <SRT|VTT>                                  Subtitle output format [default: SRT]
  --auto-subtitle-fix                                     Automatically fix subtitles [default: True]
  --ffmpeg-binary-path <PATH>                             Path to the ffmpeg binary, like C:\Tools\ffmpeg.exe
  --log-level <DEBUG|ERROR|INFO|OFF|WARN>                 Set log level [default: INFO]
  --ui-language <en-US|zh-CN|zh-TW>                       Set UI language
  --urlprocessor-args <urlprocessor-args>                 Give these arguments to the URL Processors.
  --key <key>                                             Set decryption key(s) to mp4decrypt/shaka-packager/ffmpeg. format:
                                                          --key KID1:KEY1 --key KID2:KEY2
                                                          or use --key KEY if all tracks share the same key.
                                                          KID and KEY accept 16-byte HEX or Base64; trailing Base64 padding (=) is optional.
  --key-text-file <key-text-file>                         Set the kid-key file, the program will search the KEY with KID from the file.(Very large file are not recommended)
  --decryption-engine <FFMPEG|MP4DECRYPT|SHAKA_PACKAGER>  Set the third-party program used for decryption [default: MP4DECRYPT]
  --decryption-binary-path <PATH>                         Path to the tool used for MP4 decryption, like C:\Tools\mp4decrypt.exe
  --mp4-real-time-decryption                              Decrypt MP4 segments in real time [default: False]
  -R, --max-speed <SPEED>                                 Set speed limit, Mbps or Kbps, for example: 15M 100K.
  -M, --mux-after-done <OPTIONS>                          Mux the downloaded streams after all tasks finish. Use "--morehelp mux-after-done" for more details
  --custom-hls-method <METHOD>                            Set HLS encryption method (AES_128|AES_128_ECB|CENC|CHACHA20|NONE|SAMPLE_AES|SAMPLE_AES_CTR|UNKNOWN)
  --custom-hls-key <FILE|HEX|BASE64>                      Set the HLS decryption key. Can be file, HEX or Base64
  --custom-hls-iv <FILE|HEX|BASE64>                       Set the HLS decryption iv. Can be file, HEX or Base64
  --custom-hls-scope <SCOPE>                              Apply custom HLS method, key and IV to selected media type (ALL|VIDEO|AUDIO) [default: ALL]
  --use-system-proxy                                      Use system default proxy [default: True]
  --custom-proxy <URL>                                    Set web request proxy, like http://127.0.0.1:8888
  --interface <INTERFACE>                                 Use the specified network interface or local IP address, e.g. eth1 or 192.168.1.10
  --custom-range <RANGE>                                  Download only part of the segments. Use "--morehelp custom-range" for more details
  --task-start-at <yyyyMMddHHmmss>                        Task execution will not start before this time
  --live-perform-as-vod                                   Download live streams as vod [default: False]
  --live-real-time-merge                                  Real-time merge into file when recording live [default: False]
  --live-keep-segments                                    Keep segments when recording a live (liveRealTimeMerge enabled) [default: True]
  --live-pipe-mux                                         Real-time muxing to TS file through pipeline + ffmpeg (liveRealTimeMerge enabled) [default: False]
  --live-fix-vtt-by-audio                                 Correct VTT sub by reading the start time of the audio file [default: False]
  --live-record-limit <HH:mm:ss>                          Recording time limit when recording live
  --live-wait-time <SEC>                                  Manually set the live playlist refresh interval
  --live-idle-timeout <SEC>                               Stop recording when a live playlist has no new segments for this many seconds (disabled by default)
  --live-take-count <NUM>                                 Manually set the number of segments downloaded for the first time when recording live [default: 16]
  --live-catchup <TIME>                                   Download live history from a lookback duration or date/time; overrides --live-take-count
  --mux-import <OPTIONS>                                  Import external media files when muxing. Use "--morehelp mux-import" for more details
  -sv, --select-video <OPTIONS>                           Select video streams by regular expressions. Use "--morehelp select-video" for more details
  -sa, --select-audio <OPTIONS>                           Select audio streams by regular expressions. Use "--morehelp select-audio" for more details
  -ss, --select-subtitle <OPTIONS>                        Select subtitle streams by regular expressions. Use "--morehelp select-subtitle" for more details
  -dv, --drop-video <OPTIONS>                             Drop video streams by regular expressions. Accepts the same options as --select-video, use "--morehelp select-video" for more details
  -da, --drop-audio <OPTIONS>                             Drop audio streams by regular expressions. Accepts the same options as --select-video, use "--morehelp select-video" for more details
  -ds, --drop-subtitle <OPTIONS>                          Drop subtitle streams by regular expressions. Accepts the same options as --select-video, use "--morehelp select-video" for more details
  --ad-keyword <REG>                                      Set URL keywords (regular expressions) for AD segments
  --vod-select-parts                                      Control VOD section selection: omitted = automatic, true = always prompt, false = disable (Space/Enter)
  --vod-list-parts                                        List VOD sections grouped by media configuration, with IDs and total durations, then exit [default: False]
  --vod-drop-parts <IDS>                                  Exclude VOD sections and matching audio/subtitles by --vod-list-parts IDs, e.g. 0,2-4
  --disable-update-check                                  Disable version update check [default: False]
  --allow-hls-multi-ext-map                               Allow multiple #EXT-X-MAP in live HLS (experimental; enabled for VOD) [default: False]
  --morehelp <OPTION>                                     Show detailed help for an option
  --generate-completion <SHELL>                           Print the embedded completion script (powershell)
  -?, -h, --help                                          Show help and usage information
  --version                                               Show version information

--interface accepts a network interface name (e.g. eth1, en0 or Wi-Fi) or a local IP address. A name constrains the outgoing interface; an IP binds the connection source address. With a proxy, it applies to the connection to the proxy. DNS uses the system resolver. Binding failures are reported without falling back to another interface. Linux binding by name may require additional permissions; the diagnostic includes the system error.

--custom-hls-scope VIDEO applies --custom-hls-method, --custom-hls-key, and --custom-hls-iv only to video renditions in a master playlist; AUDIO selects audio renditions. Audio-only variants can be identified through CODECS; variants without enough type information still use the video scope. The default ALL preserves the existing behavior. A standalone media playlist has no rendition type, so the custom settings apply to that playlist.

Interactive VOD downloads group repeated sections by actual media configuration. Use Space to toggle groups and Enter to confirm; all groups are kept by default. A clear gap in section durations further separates groups without classifying ads automatically. HLS inspects each distinct init for codecs, resolution and audio configuration; init URLs are omitted from the UI. Omitting --vod-select-parts keeps automatic detection; --auto-select and stream filters do not trigger this prompt automatically. Use --vod-select-parts (or --vod-select-parts true) to force the prompt, or --vod-select-parts false to disable section selection. Ads with the same configuration and similar durations still require URL rules or explicit section IDs.

For scripts, --vod-list-parts lists grouped original section IDs and --vod-drop-parts 0,2-4 removes specified sections across video, audio and subtitles. DASH IDs are original Period positions starting at 0; HLS uses original discontinuity sequence numbers. All MAPs within a discontinuity section stay together. For MAP changes without discontinuities, use --ad-keyword to match init/media URLs. --custom-range retains source segment indices after selection.

Click to view "More Help" section
More Help:

  --mux-after-done

Mux the downloaded streams after all tasks finish. OPTIONS is a colon separated list of:

* format=FORMAT: set container. mkv, mp4, ts
* muxer=MUXER: set muxer. ffmpeg, mkvmerge (Default: ffmpeg)
* bin_path=PATH: set binary file path. (Default: auto)
* skip_sub=BOOL: skip downloaded subtitles; externally imported subtitles are still muxed (Default: false)
* keep=BOOL: keep track files after successful muxing; external imports are always preserved (Default: false)

The format= prefix is optional, e.g. -M mp4. Use mkvmerge for MKV output only. Escape colons in values as \: and quote the entire argument if it contains spaces.

Examples:
# mux to mp4
-M format=mp4
# use mkvmerge, auto detect bin path
-M format=mkv:muxer=mkvmerge
# use mkvmerge, set bin path
-M "format=mkv:muxer=mkvmerge:bin_path=C\:\Program Files\MKVToolNix\mkvmerge.exe"
More Help:

  --mux-import

Import local media files when muxing; repeat for multiple files. Requires -M in the main command; also available in the mux subcommand.
Pass a file path directly, or use these colon-separated options (directories are not supported):

* path=PATH: media file path
* lang=CODE: track language code, e.g. eng or zh-Hans (optional)
* name=NAME: track title (optional)

Escape colons in option values as \: (including Windows drive letters). Direct file paths do not need colon escaping. Quote the entire argument when it contains spaces.

Examples:
# Import a subtitle file directly
--mux-import "D:\media\subtitle.srt"
# Set subtitle language and title
--mux-import "path=en-US.srt:lang=en-US:name=English (Original)"
# Import audio and subtitles
--mux-import "path=D\:\media\audio.m4a:lang=eng:name=English Audio" --mux-import "path=D\:\media\subtitle.srt:lang=eng:name=English Subtitles"
More Help:

  --select-video

Select video streams by regular expressions. OPTIONS is a colon (:) separated list of the following sub-keys.
The same sub-keys also work for --select-audio/-sa, --select-subtitle/-ss and the matching --drop-video/--drop-audio/--drop-subtitle options.

* id=REGEX: match by group/stream id
* lang=REGEX: match by language code
* name=REGEX: match by stream name
* codecs=REGEX: match by codecs (e.g. hvc1, avc1, mp4a)
* res=REGEX: match by resolution (e.g. ^1920x, ^3840x)
* frame=REGEX: match by frame rate
* channel=REGEX: match by audio channel count (e.g. 6, 2)
* range=REGEX: match by video range (e.g. SDR, HDR, PQ)
* url=REGEX: match by stream URL
* period=REGEX: match by DASH Period id (multi-Period MPD, e.g. ads/chapters)
* segsMin=number: keep streams with at least number segments
* segsMax=number: keep streams with at most number segments
* plistDurMin=hms: keep streams whose playlist duration >= hms (e.g. 1h20m30s, 90s)
* plistDurMax=hms: keep streams whose playlist duration <= hms
* bwMin=int: keep streams with bandwidth >= int Kbps
* bwMax=int: keep streams with bandwidth <= int Kbps
* role=string: match by DASH role (Subtitle, Main, Alternate, Supplementary, Commentary, Dub, Description, Sign, Metadata, ForcedSubtitle)
* for=FOR: keep best[number] or worst[number] by bandwidth per base language, or all matched streams (Default: best)

Examples:
# select best video
-sv best
# select 4K+HEVC video
-sv res="^3840x":codecs=hvc1:for=best
# Select best video with duration of at least 1 hour 20 minutes 30 seconds
-sv plistDurMin="1h20m30s":for=best
-sv role="main":for=best
# Select video with bandwidth between 800Kbps and 1Mbps
-sv bwMin=800:bwMax=1000
# Drop subtitle streams that have at most 2 segments (e.g. trick-play/ad playlists)
-ds segsMax=2:for=all --auto-select
# Keep only the main content Period (exclude ad Periods)
-sv period="main":for=best
# Drop video from the ad Period
-dv period="ad":for=all
More Help:

  --select-audio

Select audio streams by regular expressions. Use --morehelp select-video for all filter options.

Examples:
# select all
-sa all
# select best eng audio
-sa lang=en:for=best
# select the best 2 audio tracks for each language, Japanese and English
-sa lang="ja|en":for=best2
-sa role="main":for=best
More Help:

  --select-subtitle

Select subtitle streams by regular expressions. Use --morehelp select-video for all filter options.

Examples:
# select all subs
-ss all
# select all subs containing "English"
-ss name="English":for=all
More Help:

  --custom-range

Download only part of the segments when downloading vod content.

Use MM:SS or HH:MM:SS. Omit the start to download from the beginning, or omit the end to download to the end.
Time ranges select segments by their start times, including both boundaries. Whole segments are retained; no precise trimming is performed.

Examples:
# Download [0,10], a total of 11 segments
--custom-range 0-10
# Download subsequent segments starting from index 10
--custom-range 10-
# Download the first 100 segments
--custom-range -99
# Download content from the 05:00 to 20:00
--custom-range 05:00-20:00
# Skip the first 26 seconds and download the remaining content
--custom-range 00:26-
# Download only the first 26 seconds (whole segments may extend beyond 26 seconds)
--custom-range -00:26
More Help:

  --save-pattern

Set each track's output filename stem using variables. The output extension is appended automatically.

* <SaveName>: name specified by --save-name, or empty when omitted
* <Id>: track download task ID
* <Codecs>: codec information (e.g. avc1.64001f, mp4a.40.2)
* <Language>: language code (e.g. en, zh-CN)
* <Resolution>: video resolution (e.g. 1920x1080)
* <Bandwidth>: bitrate value in bit/s (e.g. 5000000)
* <MediaType>: media type (VIDEO, AUDIO, SUBTITLES)
* <Channels>: audio channel information
* <FrameRate>: video frame rate
* <VideoRange>: video dynamic range (e.g. SDR, HDR10)
* <GroupId>: stream group identifier
* <Name>: stream name or IPTV channel name

Variables are case-sensitive. Missing values become empty strings. Do not include the output extension in the pattern.

Examples:
# Name video tracks by resolution
--save-name video --save-pattern "<SaveName>_<Resolution>"
# Include bitrate (bit/s)
--save-name video --save-pattern "<SaveName>_<Resolution>_<Bandwidth>bps"
# Name audio tracks by language and channels
--save-name audio --save-pattern "<SaveName>_<Language>_<Channels>"
# Use task IDs to distinguish tracks with the same configuration
--save-name video --save-pattern "<SaveName>_<Id>_<Codecs>"

FFmpeg segment merging

With FFmpeg 9 or newer, Dolby Vision content can be merged and muxed normally. Older or unrecognized FFmpeg versions retain the compatibility safeguards: binary merging and disabled FFmpeg muxing. Explicit binary merging and mkvmerge muxing remain available.

The default, --ffmpeg-concat-mode LOCAL_HTTP, serves a seekable byte stream through a temporary input listening only on 127.0.0.1. Segments are opened one at a time without writing a full intermediate file or hitting file-handle and command-line limits caused by segment counts.

  • LOCAL_HTTP: the default local virtual input, preserving byte concatenation through the concat protocol.
  • PROTOCOL: fall back to concat:file1|file2|…, opening all segments directly; large inputs can still exhaust file handles.
  • DEMUXER: use a concat file list, processing each file's media timeline; results can differ from byte concatenation.

The existing --use-ffmpeg-concat-demuxer remains supported. Command-line choices override configuration defaults; when both forms are supplied at the same level, the enabled legacy option takes precedence. The mode only affects FFmpeg segment merging; binary merging, independently initialized sections, and live pipe muxing keep their respective processing flows.

Live catch-up

# Start one hour ago, download 30 minutes and mux to MKV
N_m3u8DL-RE "URL" --live-catchup "01:00:00" --live-record-limit "00:30:00" --live-real-time-merge -M mkv

# Start at a specific date/time; uses the local timezone when none is specified
N_m3u8DL-RE "URL" --live-catchup "2026-10-10T21:00:00+08:00" --live-record-limit "00:30:00" --live-real-time-merge -M mkv

# Requires reliable manifest timing and a start within the server's catch-up window.
# Downloads whole segments, so boundaries may differ slightly; without a recording limit, continues until stopped.

Others

From v0.1.5, you can try to enable live-pipe-mux instead of the above command

[!NOTE] If the network environment is not stable, do not enable live-pipe-mux. The data read in the pipeline is handled by ffmpeg, and it is easy to lose live data in some environments.

From v0.1.8, you can set the environment variable RE_LIVE_PIPE_OPTIONS to change some options of ffmpeg when live-pipe-mux is enabled: https://github.com/nilaoda/N_m3u8DL-RE/issues/162#issuecomment-1592462532


Disclaimer

This software is open-sourced under the MIT License and is provided "as is", without any express or implied warranties (including but not limited to the warranties of merchantability and fitness for a particular purpose). In no event shall the authors be liable for any direct or indirect damages arising from the use of this software.

Legal Use

This software is intended for learning and technical research purposes only. Users shall comply with applicable laws and regulations in their country or region, and only download streaming content for which they have legal permission. Any illegal or infringing use is unrelated to the original author, and users shall bear all legal responsibilities themselves.


Donate

Buy Me A Coffee

Explore related projects

Loading…