Overview of the Three Tools

The FFmpeg package includes three command-line tools (official About).

ToolPrimary rolePrimary use
ffmpegConversion, encoding, filtering, and streamingFile conversion, video processing
ffprobeAnalysis and display of media stream informationChecking file info, scripting integration
ffplayMedia playback using SDLVerification and development testing

ffmpeg — The Main Tool for Conversion and Processing

ffmpeg is the most feature-rich of the three tools. According to the official documentation, it handles decoding, encoding, transcoding, mux/demux, streaming, and filtering.

Basic Syntax

ffmpeg [global options] {[input options] -i input_url} ... {[output options] output_url} ...

For details, see “FFmpeg Command Basic Syntax”.

Representative Usage Examples

Container conversion (stream copy):

ffmpeg -i input.mkv -c copy output.mp4

Codec conversion (transcode):

ffmpeg -i input.avi -c:v libx264 -c:a aac output.mp4

Filter application (resize):

ffmpeg -i input.mp4 -vf scale=1280:720 output.mp4

ffprobe — Tool for Analyzing File Information

ffprobe is a tool for retrieving stream information and container information from media files. The official documentation describes it as collecting information from multimedia streams and printing it in a human- and machine-readable format.

ffprobe gathers information from multimedia streams and prints it in human- and machine-readable fashion.

Basic Syntax

ffprobe [options] input_url

Key Options

OptionDescription
-show_streamsDisplay detailed information for each media stream
-show_formatDisplay container format information
-print_format jsonOutput in JSON format (for scripting)
-select_streams v:0Select a specific stream only (e.g., first video stream)
-v quietSuppress verbose logs and output only data

Usage Examples

Check basic file information (the most common approach):

ffmpeg -i can display similar information as well (without actually processing).

ffmpeg -i input.mp4 -hide_banner

Get stream information in JSON format (for scripting):

ffprobe -v quiet -show_streams -print_format json input.mp4

Display only the video stream:

ffprobe -v quiet -show_streams -select_streams v input.mp4

Display only container information:

ffprobe -v quiet -show_format -print_format json input.mp4

Note: ffprobe commands are not subject to CI verification in this article (commands starting with ffprobe are not ffmpeg). The commands above have been verified on a real machine, but please also verify in your own environment.

Sample ffprobe Output

{
  "streams": [
    {
      "index": 0,
      "codec_name": "h264",
      "codec_type": "video",
      "width": 1920,
      "height": 1080,
      "r_frame_rate": "30/1"
    },
    {
      "index": 1,
      "codec_name": "aac",
      "codec_type": "audio",
      "sample_rate": "48000",
      "channels": 2
    }
  ]
}

ffplay — Media Player for Testing

ffplay is a simple media player using the SDL library. The official documentation describes it as “mostly used as a testbed for the various FFmpeg APIs.”

FFplay is a very simple and portable media player using the FFmpeg libraries and the SDL library. It is mostly used as a testbed for the various FFmpeg APIs.

Basic Syntax

ffplay [options] [input_url]

Main Keyboard Shortcuts

KeyAction
q / ESCQuit
fToggle fullscreen
p / SpacePause / Resume
mToggle mute
9 / 0Decrease / Increase volume
/ Seek 10 seconds
/ Seek 1 minute
sStep one frame forward

Primary Use Cases

Note: ffplay requires a GUI display and will not work in headless environments (servers, CI).


Guidelines for Choosing the Right Tool

Want to check file information
  → ffprobe -show_streams input.mp4
     or ffmpeg -i input.mp4 -hide_banner

Want to convert or encode a file
  → ffmpeg -i input.mp4 output.mkv

Want to play back the conversion result on the spot
  → ffplay output.mp4

A Common Workflow

  1. Inspect: Use ffmpeg -i input.mp4 -hide_banner to check the source file information
  2. Convert: Use ffmpeg to convert to the desired format
  3. Verify: Use ffplay output.mp4 to play back and verify the conversion result

Note on Displaying Information with ffmpeg

ffmpeg -i input.mp4 displays file information, but it exits with an error (exit code 1) if no output file is specified. If your only goal is to display information, it is appropriate to either use -hide_banner and ignore the error, or use ffprobe.


Tested with: ffmpeg 6.1.1 / Ubuntu 24.04 (GitHub Actions runner) Primary sources: ffmpeg.org/ffmpeg.html / ffmpeg.org/ffprobe.html / ffmpeg.org/ffplay.html