Overview of the Three Tools
The FFmpeg package includes three command-line tools (official About).
| Tool | Primary role | Primary use |
|---|---|---|
ffmpeg | Conversion, encoding, filtering, and streaming | File conversion, video processing |
ffprobe | Analysis and display of media stream information | Checking file info, scripting integration |
ffplay | Media playback using SDL | Verification 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
| Option | Description |
|---|---|
-show_streams | Display detailed information for each media stream |
-show_format | Display container format information |
-print_format json | Output in JSON format (for scripting) |
-select_streams v:0 | Select a specific stream only (e.g., first video stream) |
-v quiet | Suppress 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:
ffprobecommands are not subject to CI verification in this article (commands starting withffprobeare notffmpeg). 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
| Key | Action |
|---|---|
q / ESC | Quit |
f | Toggle fullscreen |
p / Space | Pause / Resume |
m | Toggle mute |
9 / 0 | Decrease / Increase volume |
← / → | Seek 10 seconds |
↓ / ↑ | Seek 1 minute |
s | Step one frame forward |
Primary Use Cases
- When you want to immediately check a file after encoding
- When you want to preview the result of a filter application
- Live stream reception testing
Note:
ffplayrequires 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
- Inspect: Use
ffmpeg -i input.mp4 -hide_bannerto check the source file information - Convert: Use
ffmpegto convert to the desired format - Verify: Use
ffplay output.mp4to 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