Skip to main content
DARKPC.NET

Terminal Handbook

A terminal-first handbook for GhostBSD, FreeBSD and NetBSD. Start by playing local media with MPlayer, then explore the BSD software guides as they are added.

001 MPlayer — Mastering Multimedia from the Terminal

MPlayer is a lightweight, long-established command-line multimedia player. It plays local audio and video in many formats without requiring a full media-center interface. Video normally opens in a separate window under X11; audio can run entirely in a terminal.

Installation

On FreeBSD and GhostBSD, search your configured repository first. Install only if the results include the mplayer package.

FreeBSD’s package listing includes binary builds for several releases and architectures. The GhostBSD stable amd64 catalogue for the FreeBSD 15 ABI lists MPlayer 1.5.0.20260404_1. Check your own catalogue with the command below, since available versions depend on your system and update branch.

pkg search -e mplayer
sudo pkg install mplayer

On NetBSD, the official pkgsrc listing includes binary builds for several releases and architectures. With pkgin configured for your release, search before installing.

pkgin search mplayer
sudo pkgin install mplayer

Use su and run the installation command without sudo if sudo is unavailable. Run playback as your ordinary user. Package availability and compiled drivers vary by release and architecture. Run mplayer -help to see the version banner and man mplayer for the options available in your build.

First playback commands

Open a terminal in the folder containing your media. Replace example filenames with your own; quote paths containing spaces.

mplayer video.mp4
mplayer music.mp3
mplayer -fs video.mp4
mplayer -novideo video.mp4
mplayer -loop 0 video.mp4
mplayer -shuffle -playlist playlist.m3u
mplayer -speed 1.5 video.mp4

In order: play video, play audio, start fullscreen, disable video, repeat indefinitely, shuffle a playlist, and play at 1.5 times normal speed. Press q to stop.

Keyboard controls

Key Action
Space or p Pause or resume
Left / Right Seek backward / forward 10 seconds
Down / Up Seek backward / forward 1 minute
Page Down / Page Up Seek backward / forward 10 minutes
9 / 0 Lower / raise volume
m Mute
f Toggle fullscreen (supported video outputs)
o Cycle on-screen display
v Toggle subtitles
q or Esc Quit

Defaults can vary with configuration; see the local manual.

Audio and video output

mplayer -ao help
mplayer -vo help
mplayer -ao oss music.mp3
mplayer -ao pulse music.mp3
mplayer -vo xv video.mp4
mplayer -vo x11 -zoom video.mp4
mplayer -vo null -ao oss video.mp4

List available audio and video drivers first. OSS is common on FreeBSD/GhostBSD; PulseAudio requires a running server and compiled support. NetBSD may offer a native audio driver such as sun; select only a listed driver. ALSA is primarily a Linux option. Xv and X11 require a working X display. The null video driver discards pictures. For true text-console video, investigate listed caca or aa drivers; Linux fbdev examples are not portable BSD instructions.

Subtitles and playlists

mplayer -sub movie.srt movie.mp4
mplayer -ss 60 movie.mp4
mplayer -volume 40 music.mp3

Load external subtitles, start one minute into a file, or set initial volume to 40%. Create a plain-text playlist named playlist.m3u with one local filename per line, then run mplayer -playlist playlist.m3u. Use trusted playlists only.

Terminal jukebox with tmux

tmux new -s jukebox
mplayer -shuffle -loop 0 -playlist playlist.m3u

Press Ctrl+B then D to detach; reconnect with tmux attach -t jukebox. Playback continues while the session runs, not across reboot. For authorized downloadable media, yt-dlp can save a supported file for local playback. MPlayer does not replace a DRM-capable browser for Netflix or Foxtel.

Troubleshooting

Symptom Checks and fixes
Command not found Check command -v mplayer and package installation.
No sound Check mute, desktop output selection, mplayer -ao help; on FreeBSD inspect cat /dev/sndstat and mixer.
HDMI sound missing Select HDMI in desktop sound settings; inspect available sound devices before changing defaults.
Black video window Try -vo x11 -zoom under X11, or another listed driver.
Cannot open display Run from a graphical session or use -novideo for audio.
File not found Check pwd, ls and quoted filenames.
Stuttering Try a smaller local file, close heavy applications, check USB throughput.
Unsupported codec Check verbose output with mplayer -v video.mp4; try mpv if available.

Avoid running MPlayer as root or changing device permissions broadly.

Practical challenge

References

Future handbook chapters

Chapter Software Status
002 tmux and terminal layouts Planned
003 mpv and FFmpeg Planned
004 NeoMutt and terminal email Planned
005 IRC and SSH Planned
006 BSD audio and HDMI Planned
007 Xfce, MATE and KDE Plasma Planned
008 Wireshark and authorized network diagnostics Planned