How to Use Mplayer Command Line Options
Use `mplayer [options] filename` at the command prompt to control playback with flags—each option modifies how the player handles video, audio, subtitles, or performance. Options stack together, letting you fine-tune everything from codec behavior to subtitle positioning without touching a GUI.
Understanding Command Line Structure
The basic syntax for how to use mplayer command line options separates the player executable, optional parameters, and the file or stream. On Linux and macOS, you'd type `mplayer -option1 value1 -option2 filename.mp4`. On Windows, the same structure applies from Command Prompt or PowerShell. The order of flags matters occasionally—output-related options should come before the filename, while playback options work either before or after.
MPlayer's command line interface gives it an advantage over graphical players: you can batch-process files, script playback, or control it remotely. This lightweight media player runs on minimal hardware because it skips the resource-heavy GUI components that bog down alternatives like VLC.
Common Playback Options
-fs launches fullscreen mode immediately. -ss 00:05:30 skips to 5 minutes and 30 seconds into the file. -speed 1.5 plays at 150% speed; -speed 0.75 plays at three-quarters speed. The -volume flag adjusts audio level from 0–100.
-loop 0 repeats a file infinitely; -loop 2 plays twice. This matters for video presentations or testing. -playlist filename.txt loads a text file containing one filename per line, useful for sequential playback without manual intervention.
To control frame-by-frame stepping during playback, press the period key (`.`) for forward and comma (`,`) for backward—no command line option needed, but knowing this saves time during debugging or detailed viewing.
Subtitle and Audio Management
The -sub filename.srt option loads an external subtitle file. -subpos 50 adjusts vertical position; higher values move subtitles down. -subcp iso-8859-1 specifies character encoding if subtitles display garbled—UTF-8 is default but older files use different encodings.
For audio, -aid 2 selects the second audio track in multi-track files like MKV. -alang en chooses English audio automatically if multiple language tracks exist. Learn about advanced subtitle positioning for environment-specific adjustments.
Video Output and Performance
-vo x11 or -vo xv selects video output on Linux; -vo directx on Windows. Most systems auto-detect correctly, but specifying it prevents crashes with problematic drivers. -hardframedrop sacrifices quality to maintain sync on slow hardware, critical for an open source video player running on older machines.
-cache 2000 buffers 2000 KB before playback starts—essential for streaming playback over network protocols. Higher values reduce stuttering during poor connections.
The -vf scale=1280:720 option resizes video to 1280×720 pixels, useful for testing responsive layouts or reducing CPU load. Format support includes MP4, AVI, MKV, MOV, WMV, FLV, and MPEG streams directly—no transcoding required.
Advanced Command Line Techniques
-demuxer mkv forces MKV demuxer if detection fails. -ac libfdk_aac specifies audio codec explicitly. -vc ffmpeg12vdpau uses GPU acceleration where available, dramatically improving performance.
Putting It Together
A realistic command combining several options looks like this: `mplayer -fs -sub dialog.srt -aid 2 -cache 5000 movie.mkv`. This launches fullscreen, loads subtitles, selects the second audio track, buffers 5 MB, and plays the file.
Understanding how to use mplayer command line options unlocks why this console video player dominates professional workflows and automated systems. Whether you're on Windows, Linux, or macOS, these flags provide precision control that GUI-only players cannot match. Start with basic options, then layer in advanced flags as your workflow demands.
Related Articles
- best lightweight video player for linux
- top free open source video players
- how to install mplayer on linux
- mplayer alternative lightweight video player
- how to play mkv files mplayer
- portable mplayer windows mac linux support
- mplayer codec support all formats
- mplayer cpu usage low performance resource