WebsiteTemplate/cheatsheets/mpv.html
2026-01-25 11:33:37 -04:00

475 lines
11 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self'; font-src 'self' data:; img-src 'self' data:; connect-src 'self'; base-uri 'self'; form-action 'self' https://defcon.social https://bsky.app;">
<meta http-equiv="X-Content-Type-Options" content="nosniff">
<link rel="stylesheet" href="../assets/css/style.css">
<link rel="icon" type="image/x-icon" href="../favicon.ico">
<script>
// Apply theme immediately to prevent flash
(function() {
const theme = localStorage.getItem('theme') ||
(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
document.documentElement.setAttribute('data-theme', theme);
})();
</script>
<title>mpv Cheatsheet - Cheatsheets - Launch Pad</title>
</head>
<body>
<button class="theme-toggle" id="themeToggle" aria-label="Toggle dark mode">
<svg class="theme-icon theme-icon-moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
<svg class="theme-icon theme-icon-sun" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: none;"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>
</button>
<br/><br/>
<div class="name">
__ _______________________ _________._________________________
\_ _____/ \______ \ / _ \ / _____/ / _____/ | | \_ _____/
| __) | _/ / /_\ \ / \ ___ / \ ___ | | | __)_
| \ | | \ / | \ \ \_\ \ \ \_\ \ | |___ | \
\___ / |____|_ / \____|__ / \______ / \______ / |_______ \ /_______ /
\/ \/ \/ \/ \/ \/ \/
</div>
<div class="blog-page-header">
<div class="blog-header-content">
<a href="/cheatsheets" class="back-link" title="Back to Cheatsheets">
<svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 24 24" class="home-icon"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>
</a>
<h1 class="blog-page-title">mpv Cheatsheet</h1>
</div>
</div>
<div class="blog-post-container">
<div class="blog-posts-container" style="max-width: 900px; margin: 0 auto;">
<div class="blog-post">
<div class="blog-post-content">
<p><a href="index.html">← Back to cheatsheets</a></p>
<p><a href="../index.html">← Home</a></p>
<hr>
<h2>Basic Playback</h2>
<ul>
<li>mpv &lt;file&gt; - Play a file</li>
</ul>
<ul>
<li>mpv &lt;url&gt; - Play from URL</li>
</ul>
<ul>
<li>mpv &lt;file1&gt; &lt;file2&gt; - Play multiple files</li>
</ul>
<ul>
<li>mpv --playlist=&lt;file&gt; - Play playlist</li>
</ul>
<ul>
<li>mpv --shuffle - Shuffle playlist</li>
</ul>
<ul>
<li>mpv --loop=&lt;N&gt; - Loop N times (0 = infinite)</li>
</ul>
<ul>
<li>mpv --loop-file=inf - Loop current file infinitely</li>
</ul>
<hr>
<h2>Playback Controls</h2>
<h3>Space and Enter</h3>
<ul>
<li>Space - Pause/Resume</li>
</ul>
<ul>
<li>Enter - Pause/Resume (alternative)</li>
</ul>
<h3>Seeking</h3>
<ul>
<li>← - Seek backward 5 seconds</li>
</ul>
<ul>
<li>→ - Seek forward 5 seconds</li>
</ul>
<ul>
<li>↑ - Seek forward 60 seconds</li>
</ul>
<ul>
<li>↓ - Seek backward 60 seconds</li>
</ul>
<ul>
<li>Ctrl+← - Seek backward 1 second</li>
</ul>
<ul>
<li>Ctrl+→ - Seek forward 1 second</li>
</ul>
<ul>
<li>[ - Decrease playback speed</li>
</ul>
<ul>
<li>] - Increase playback speed</li>
</ul>
<ul>
<li>{ - Halve playback speed</li>
</ul>
<ul>
<li>} - Double playback speed</li>
</ul>
<ul>
<li>Backspace - Reset playback speed</li>
</ul>
<ul>
<li>, - Step backward frame</li>
</ul>
<ul>
<li>. - Step forward frame</li>
</ul>
<h3>Volume</h3>
<ul>
<li>- - Decrease volume</li>
</ul>
<ul>
<li>+ or = - Increase volume</li>
</ul>
<ul>
<li>9 - Decrease volume</li>
</ul>
<ul>
<li>0 - Increase volume</li>
</ul>
<ul>
<li>m - Mute/Unmute</li>
</ul>
<h3>Playlist Navigation</h3>
<ul>
<li>&gt; - Next file in playlist</li>
</ul>
<ul>
<li>&lt; - Previous file in playlist</li>
</ul>
<ul>
<li>p - Previous file in playlist (alternative)</li>
</ul>
<ul>
<li>n - Next file in playlist (alternative)</li>
</ul>
<ul>
<li>P - Show playlist</li>
</ul>
<ul>
<li>j - Next entry in playlist</li>
</ul>
<ul>
<li>J - Previous entry in playlist</li>
</ul>
<hr>
<h2>Video</h2>
<ul>
<li>f - Toggle fullscreen</li>
</ul>
<ul>
<li>T - Toggle stay-on-top</li>
</ul>
<ul>
<li>t - Toggle subtitle visibility</li>
</ul>
<ul>
<li>s - Cycle through subtitles</li>
</ul>
<ul>
<li>S - Cycle through subtitles (backward)</li>
</ul>
<ul>
<li>v - Toggle subtitle visibility</li>
</ul>
<ul>
<li>V - Toggle subtitle visibility (alternative)</li>
</ul>
<ul>
<li>z - Adjust subtitle delay backward</li>
</ul>
<ul>
<li>x - Adjust subtitle delay forward</li>
</ul>
<ul>
<li>c - Cycle through audio tracks</li>
</ul>
<ul>
<li># - Cycle through audio tracks (alternative)</li>
</ul>
<ul>
<li>b - Cycle through video tracks</li>
</ul>
<ul>
<li>Ctrl+ - Cycle through video tracks (alternative)</li>
</ul>
<hr>
<h2>Advanced Controls</h2>
<ul>
<li>i - Show file information (press again for extended info)</li>
</ul>
<ul>
<li>I - Show extended file information</li>
</ul>
<ul>
<li>o - Show on-screen display (OSD)</li>
</ul>
<ul>
<li>O - Show OSD (alternative)</li>
</ul>
<ul>
<li>P - Show progress bar</li>
</ul>
<ul>
<li>d - Cycle through deinterlacing modes</li>
</ul>
<ul>
<li>D - Cycle through deinterlacing modes (backward)</li>
</ul>
<ul>
<li>r - Cycle through aspect ratio</li>
</ul>
<ul>
<li>A - Cycle through aspect ratio (backward)</li>
</ul>
<ul>
<li>Ctrl+ - Cycle through video filters</li>
</ul>
<ul>
<li>Ctrl+ - Cycle through video filters (backward)</li>
</ul>
<hr>
<h2>Screenshots</h2>
<ul>
<li>s - Take screenshot (with subtitles)</li>
</ul>
<ul>
<li>S - Take screenshot (without subtitles)</li>
</ul>
<ul>
<li>Ctrl+s - Take screenshot (with subtitles, alternative)</li>
</ul>
<ul>
<li>Ctrl+S - Take screenshot (without subtitles, alternative)</li>
</ul>
<hr>
<h2>Audio</h2>
<ul>
<li>1 - Decrease audio delay</li>
</ul>
<ul>
<li>2 - Increase audio delay</li>
</ul>
<ul>
<li>Ctrl+ - Cycle through audio filters</li>
</ul>
<ul>
<li>Ctrl+ - Cycle through audio filters (backward)</li>
</ul>
<hr>
<h2>Window Management</h2>
<ul>
<li>q - Quit mpv</li>
</ul>
<ul>
<li>Q - Quit mpv (save position)</li>
</ul>
<ul>
<li>ESC - Quit mpv</li>
</ul>
<ul>
<li>Ctrl+q - Force quit</li>
</ul>
<ul>
<li>w - Toggle window decorations</li>
</ul>
<ul>
<li>W - Toggle window decorations (alternative)</li>
</ul>
<hr>
<h2>Command Line Options</h2>
<h3>Playback</h3>
<ul>
<li>--start=&lt;time&gt; - Start at specific time (e.g., --start=30 or --start=0:30)</li>
</ul>
<ul>
<li>--end=&lt;time&gt; - End at specific time</li>
</ul>
<ul>
<li>--length=&lt;time&gt; - Play for specific duration</li>
</ul>
<ul>
<li>--speed=&lt;factor&gt; - Set playback speed (e.g., --speed=1.5)</li>
</ul>
<ul>
<li>--volume=&lt;0-100&gt; - Set initial volume</li>
</ul>
<ul>
<li>--mute - Start muted</li>
</ul>
<ul>
<li>--fullscreen or -fs - Start in fullscreen</li>
</ul>
<ul>
<li>--no-fullscreen - Don&#39;t allow fullscreen</li>
</ul>
<h3>Video</h3>
<ul>
<li>--vo=&lt;driver&gt; - Video output driver (e.g., --vo=gpu, --vo=xv)</li>
</ul>
<ul>
<li>--vf=&lt;filter&gt; - Video filter (e.g., --vf=scale=1920:1080)</li>
</ul>
<ul>
<li>--hwdec=&lt;api&gt; - Hardware decoding (e.g., --hwdec=vaapi, --hwdec=nvdec)</li>
</ul>
<ul>
<li>--no-video - Disable video output</li>
</ul>
<ul>
<li>--video-aspect=&lt;ratio&gt; - Set aspect ratio (e.g., --video-aspect=16:9)</li>
</ul>
<h3>Audio</h3>
<ul>
<li>--ao=&lt;driver&gt; - Audio output driver</li>
</ul>
<ul>
<li>--af=&lt;filter&gt; - Audio filter</li>
</ul>
<ul>
<li>--no-audio - Disable audio</li>
</ul>
<ul>
<li>--audio-channels=&lt;channels&gt; - Set audio channels</li>
</ul>
<h3>Subtitles</h3>
<ul>
<li>--sub-file=&lt;file&gt; - Load subtitle file</li>
</ul>
<ul>
<li>--sub-delay=&lt;sec&gt; - Subtitle delay in seconds</li>
</ul>
<ul>
<li>--sub-scale=&lt;factor&gt; - Subtitle scale factor</li>
</ul>
<ul>
<li>--sub-pos=&lt;0-100&gt; - Subtitle position (0=top, 100=bottom)</li>
</ul>
<ul>
<li>--sub-color=&lt;color&gt; - Subtitle color</li>
</ul>
<ul>
<li>--sub-font=&lt;font&gt; - Subtitle font</li>
</ul>
<h3>Playlist</h3>
<ul>
<li>--playlist-start=&lt;index&gt; - Start at playlist index</li>
</ul>
<ul>
<li>--shuffle - Shuffle playlist</li>
</ul>
<ul>
<li>--loop-file=&lt;N&gt; - Loop file N times</li>
</ul>
<ul>
<li>--loop-playlist=&lt;N&gt; - Loop playlist N times</li>
</ul>
<h3>Advanced</h3>
<ul>
<li>--config-dir=&lt;path&gt; - Use custom config directory</li>
</ul>
<ul>
<li>--input-conf=&lt;file&gt; - Use custom input config</li>
</ul>
<ul>
<li>--script=&lt;file&gt; - Load Lua script</li>
</ul>
<ul>
<li>--ytdl-format=&lt;format&gt; - YouTube-DL format selection</li>
</ul>
<ul>
<li>--cache=&lt;size&gt; - Cache size in KB</li>
</ul>
<ul>
<li>--no-cache - Disable cache</li>
</ul>
<ul>
<li>--profile=&lt;name&gt; - Use profile from config</li>
</ul>
<hr>
<h2>Configuration</h2>
<h3>Config File Location</h3>
<ul>
<li>~/.config/mpv/mpv.conf (main config)</li>
</ul>
<ul>
<li>~/.config/mpv/input.conf (input bindings)</li>
</ul>
<h3>Common Settings</h3>
<pre><code># Video
vo=gpu
hwdec=vaapi
# Audio
audio-device=auto
# Subtitles
sub-auto=fuzzy
sub-file-paths=subs:subtitles
# Playback
save-position-on-quit
watch-later-options=start
# Interface
osd-level=1
osd-duration=2000
# Performance
cache=yes
cache-secs=60</code></pre>
<hr>
<h3>Example Key Bindings</h3>
<pre><code># Custom seek
LEFT seek -5
RIGHT seek 5
UP seek 60
DOWN seek -60
# Custom volume
KP0 add volume -2
KP1 add volume 2
# Custom playlist
Ctrl+LEFT playlist-prev
Ctrl+RIGHT playlist-next</code></pre>
<hr>
<h2>Tips</h2>
<ul>
<li>Use mpv --list-options to see all available options</li>
</ul>
<ul>
<li>Use mpv --list-properties to see all properties</li>
</ul>
<ul>
<li>Use mpv --input-conf=&lt;file&gt; to test input configs</li>
</ul>
<ul>
<li>Use mpv --profile=&lt;name&gt; for different use cases</li>
</ul>
<ul>
<li>Use mpv --ytdl-format=best for YouTube videos</li>
</ul>
<ul>
<li>Use mpv --no-video for audio-only playback</li>
</ul>
<ul>
<li>Use mpv --loop=inf for continuous playback</li>
</ul>
<ul>
<li>Use mpv --shuffle with playlists for random order</li>
</ul>
<hr>
<p><a href="index.html">← Back to cheatsheets</a></p>
<p><a href="../index.html">← Home</a></p>
</div>
</div>
</div>
</div>
<script async type="text/javascript" src="../blog/analytics.js"></script>
<script src="../theme.js"></script>
</body>
</html>