Use --playlist=<file> to load a playlist file. Supported formats include M3U, PLS, and plain text files with one path or URL per line. XML playlist formats are not supported.
mpv --playlist=my-playlist.m3umpv --playlist=playlist.plsmpv --playlist=files.txt # plain text, one file per line
Only use --playlist with files you trust. Playlist files can reference
arbitrary protocols, including unsafe ones. If you need to load an untrusted
playlist, review its contents first. Unsafe entries require
--load-unsafe-playlists to open.
You can also open many playlist files directly (without --playlist) and mpv will detect the format automatically. The --playlist option forces the playlist demuxer.
# Start at the 4th entry (0-indexed)mpv --playlist-start=3 playlist.m3u# Start at entry 123mpv playlist.m3u --playlist-start=123
The default value of auto defers to the playback resume mechanism — if a watch-later resume file exists for an entry in the list, playback begins there automatically.
# Loop the entire playlist forevermpv --loop-playlist episode1.mkv episode2.mkv episode3.mkvmpv --loop-playlist=inf --playlist=show.m3u# Loop the playlist a specific number of timesmpv --loop-playlist=3 *.mkv
--loop (alias for --loop-file) counts the number of additional seeks to
the beginning. --loop=1 plays the file twice. In contrast, --loop-playlist
counts full playthroughs, so --loop-playlist=2 plays the whole playlist
twice.
--loop-playlist=force is like inf but does not skip entries that fail to play, which can be useful for internet radio streams under poor network conditions.
Matroska files can contain ordered chapters that reference segments in other files. mpv supports this by default, automatically loading referenced files from the same directory:
# Ordered chapters are enabled by defaultmpv series_ep01.mkv# Disable ordered chapter supportmpv --no-ordered-chapters series_ep01.mkv
If the referenced files are in a different location, provide an explicit playlist of segment files:
Press Ctrl+v during playback to append the file path or URL in the clipboard to the current playlist. If nothing is playing, the file starts immediately.You can also reload the current file (clearing the network cache) with Ctrl+r.
Load a file or URL into the playlist at runtime. The flags argument controls the behavior:
Flag
Effect
replace
Replace the current playlist (default)
append
Append to the playlist without changing what is playing
append-play
Append and immediately play if nothing is currently playing
insert-next
Insert after the current entry
insert-next-play
Insert after the current entry and play immediately
-- Append a file to the playlistmp.commandv("loadfile", "/path/to/video.mkv", "append")-- Replace the playlist and start playingmp.commandv("loadfile", "https://example.com/stream.m3u8", "replace")
Load an entire playlist file into the internal playlist:
-- Replace the playlist with a filemp.commandv("loadlist", "/path/to/playlist.m3u", "replace")-- Append all entries from a playlist filemp.commandv("loadlist", "/path/to/more.m3u", "append")
local count = mp.get_property_number("playlist-count")local pos = mp.get_property_number("playlist-pos")mp.msg.info(string.format("Playing entry %d of %d", pos + 1, count))-- Jump to the next entrymp.commandv("playlist-next")-- Jump to the previous entrymp.commandv("playlist-prev")-- Jump to a specific index (0-based)mp.set_property_number("playlist-pos", 2)