C.W.K.
Stream
Lesson 02 of 10 · published

The Three Tools — ffmpeg, ffprobe, ffplay

~10 min · cli, ffprobe, ffplay

Level 0Viewer
0 XP0/73 lessons0/15 achievements
0/100 XP to next level100 XP to go0% complete

One project, three binaries

When you install FFmpeg, you actually get three command-line programs. Most people only know about the first one, but all three matter:

  • ffmpeg — the workhorse. It transcodes, transmuxes, filters, streams. Almost every chapter of this quest is about ffmpeg.
  • ffprobe — the inspector. It reads a file and tells you what's inside: container, streams, codecs, bit-rates, color space, duration, frame count. It never modifies anything. This is your X-ray.
  • ffplay — a tiny SDL-based player. It's not a competitor to VLC; it's a debugging aid for filtergraphs and weird streams. Most days you won't use it. The days you do, you'll be glad it exists.

Some Homebrew/Linux builds compile ffplay out by default (it depends on SDL2). On macOS via Homebrew it's there. If which ffplay returns nothing on your system, you have ffmpeg and ffprobe only — that's fine, you can preview with open, vlc, or QuickTime instead.

Probe-first, then encode

The single most important habit to build is probe before you encode. The reason a thousand FFmpeg jobs go sideways is that someone guessed at the input — assumed it was 30 fps when it was 29.97, assumed audio was stereo when one channel was muted, assumed the resolution from the filename. Two seconds with ffprobe kills that whole class of bugs.

Code

ffprobe — the four flags you'll use forever·bash
# Human-readable summary of every stream
ffprobe input.mp4

# Just the format-level info (container, duration, bitrate)
ffprobe -show_format input.mp4

# Just the streams (video, audio, subtitles, attachments)
ffprobe -show_streams input.mp4

# Quiet down the banner; output JSON for scripts
ffprobe -v quiet -print_format json -show_format -show_streams input.mp4
ffplay — debug a filter without writing a file·bash
# Preview the result of a scale filter live, no encode
ffplay -vf "scale=1280:720" input.mp4

# Loop a clip while you tweak (Esc to quit)
ffplay -loop 0 input.mp4

# Show an audio waveform to sanity-check levels
ffplay -showmode 1 audio.wav

External links

Exercise

Pick any video file on your machine. Run ffprobe -v quiet -print_format json -show_format -show_streams <file>. Identify: (a) the container format name, (b) the video codec name and pixel format, (c) the audio codec name and sample rate, (d) the duration in seconds. If your file is HDR, also note the color space, color primaries, and color transfer.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.