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_url]

ffplay usually takes one input URL or file path. Options can precede or follow the input.

PARAMETERS

-i input_url
    Specifies the input file or URL. Often optional, as the first non-option argument is taken as input.

-fs
    Toggles full screen playback.

-an
    Disables audio playback.

-vn
    Disables video playback.

-ss position
    Seeks to position (in seconds or H:M:S[.milli]) from the start of the input.

-t duration
    Plays for a maximum duration (in seconds or H:M:S[.milli]).

-loop count
    Loops playback count times. 0 for infinite loop.

-vf filter_graph
    Applies a video filter graph (e.g., `crop=1280:720`, `scale=640:-1`).

-af filter_graph
    Applies an audio filter graph (e.g., `volume=0.5`, `equalizer=f=1000:g=10`).

-window_title title
    Sets the window title of the player.

-x width
    Sets the initial video window width.

-y height
    Sets the initial video window height.

-noborder
    Disables window borders for the video display.

-autoexit
    Exits automatically when playback finishes.

-volume volume
    Sets the initial audio volume (0 to 100).

-stats
    Shows playback statistics (fps, bitrate, etc.) on the console.

-sync type
    Sets the master clock synchronization source (e.g., `audio`, `video`, `external`). Default is `audio`.

-loglevel level
    Sets the logging level for console output. Common levels include `info`, `warning`, `error`, `verbose`, `debug`.

-hide_banner
    Suppresses printing the FFmpeg banner information on startup.

DESCRIPTION

ffplay is a simple, portable media player that uses the FFmpeg libraries (libavformat, libavcodec, libavutil, libswresample, libswscale, and libpostproc) to play virtually any media file or stream that FFmpeg can decode. While not a full-featured media player with an extensive graphical user interface, ffplay excels as a quick and efficient tool for testing FFmpeg features, debugging codecs, verifying streams, or simply for quick playback of media files from the command line. It supports a vast array of audio and video formats, including network streams, and allows for real-time application of audio and video filters. Its minimalist design prioritizes speed and direct interaction with FFmpeg's core capabilities, making it an invaluable tool for developers, media professionals, and power users who need to inspect or play media content without the overhead of a larger application.

CAVEATS

ffplay is not intended as a replacement for full-featured media players like VLC or MPV. Its graphical user interface is minimal, relying heavily on keyboard shortcuts for controls. While powerful for its intended purpose of testing and quick viewing, it may lack advanced playback features, extensive playlist management, or comprehensive error recovery present in dedicated consumer media players. It also requires FFmpeg libraries to be installed.

<B>KEYBOARD CONTROLS</B>

ffplay relies on a set of simple keyboard shortcuts for interactive control during playback:
q or ESC: Quit playback.
f: Toggle full screen.
p or SPACE: Pause/resume playback.
m: Toggle mute.
9 / 0: Decrease/increase volume.
LEFT / RIGHT: Seek backward/forward by 10 seconds.
DOWN / UP: Seek backward/forward by 1 minute.
s: Step forward one frame (when paused).
a: Cycle through available audio streams.
v: Cycle through available video streams.
t: Cycle through available subtitle streams.
w: Show audio waves.
c: Show video component colors.
z: Show stream information (codec, fps, bitrate).
h: Show help overlay with key bindings.

HISTORY

ffplay has been an integral part of the FFmpeg project since its early stages. Developed primarily by FFmpeg's core contributors, it serves as a lightweight, command-line-driven player built directly upon the same powerful decoding and filtering libraries that power ffmpeg and ffprobe. Its evolution mirrors that of the FFmpeg project itself, continuously gaining support for new codecs, formats, and filtering capabilities. It remains a key tool for developers and users needing a direct interface to FFmpeg's playback functionalities without the overhead of a complex GUI.

SEE ALSO

ffmpeg(1), ffprobe(1), mpv(1)

Copied to clipboard