LinuxCommandLibrary

ffplay

Play multimedia files

TLDR

Play a media file

$ ffplay [path/to/file]
copy

Play audio from a media file without a GUI
$ ffplay -nodisp [path/to/file]
copy

Play media passed by ffmpeg through stdin
$ ffmpeg -i [path/to/file] -c [copy] -f [media_format] - | ffplay -
copy

Play a video and show motion vectors in real time
$ ffplay -flags2 +export_mvs -vf codecview=mv=pf+bf+bb [path/to/file]
copy

Show only video keyframes
$ ffplay -vf select="[eq(pict_type\,PICT_TYPE_I)]" [path/to/file]
copy

SYNOPSIS

ffplay [options] [input_file | input_url]

PARAMETERS

-f fmt
    Force input format (e.g., mpeg).

-i input
    Input file or stream URL.

-ss position
    Start time (seconds or hh:mm:ss).

-t duration
    Limit playback duration.

-fs
    Start in fullscreen mode.

-noborder
    Disable window border.

-alwaysontop
    Window always on top.

-loop number
    Loop playback (0 for infinite).

-x width
    Force window width.

-y height
    Force window height.

-vf filtergraph
    Video filter graph (e.g., scale=640:480).

-af filtergraph
    Audio filter graph (e.g., volume=2).

-volume n
    Set volume (0-100, default 100).

-pix_fmt format
    Force pixel format (e.g., yuv420p).

-framedrop
    Drop late video frames.

-autoexit
    Exit after EOF.

-vframes number
    Play specified number of frames.

-showmode mode
    Visualization mode (e.g., video, rtt).

-sync type
    Audio-video sync method (e.g., audio, video).

-loglevel level
    Set logging verbosity.

DESCRIPTION

ffplay is a lightweight, portable multimedia player included in the FFmpeg suite for Linux and other platforms. It uses FFmpeg libraries for demuxing, decoding, and filtering audio/video streams, paired with SDL for rendering and playback. Ideal for quick testing of media files or streams from the terminal, it supports nearly all formats FFmpeg handles, such as MP4, MKV, AVI, WebM, MP3, FLAC, and network protocols like HTTP or RTSP.

ffplay offers precise control via command-line options for seeking, duration, loops, filters, volume, and window properties. Keyboard shortcuts provide runtime interaction: pause, seek, fullscreen toggle, and more. While lacking GUI playlists or advanced UI, it's perfect for developers, scripting, debugging encodes, or headless environments with display forwarding. Filters enable real-time effects like scaling, deinterlacing, or overlays. Runs efficiently but depends on SDL for output.

CAVEATS

Requires FFmpeg with SDL support; limited hardware acceleration by default. No native subtitle rendering without filters. High CPU use for complex filters or 4K. Window management basic, may conflict with compositors.

KEYBOARD SHORTCUTS

q, ESC: Quit
space: Pause/Resume
f: Toggle fullscreen
p: Toggle mute
a: Cycle audio stream
v: Cycle video stream
s: Step backward
Left/Right: Seek ±10s
Up/Down: Seek ±1min

EXAMPLE USAGE

ffplay video.mp4: Play file.
ffplay -vf "scale=iw/2:ih/2" input.mkv: Half-size playback.
ffplay -i http://stream.url: Play network stream.

HISTORY

Part of FFmpeg since 2000 (initiated by Fabrice Bellard). Evolved with FFmpeg releases for new codecs, filters, and protocols. Remains minimalistic amid FFmpeg's growth to 500+ contributors.

SEE ALSO

ffmpeg(1), ffprobe(1), SDL(3)

Copied to clipboard