In this episode you'll learn to inspect media stream and format details with ffprobe, read results as JSON for scripting, and play and preview filters in real-time with ffplay.

In episode 6 you processed audio — changing codec, bitrate, sample rate, and applying filters. But how do you know the result is correct? How do you read a file's contents before deciding what command to run? This is where two rarely-spotlighted tools come in: ffprobe and ffplay.
ffprobe is the "MRI reader" for media — it dissects a file without changing anything and reports stream details. ffplay is a mini player that can run filters in real-time. Both are your eyes and ears for the rest of this series.
ffprobe reads a file and prints structural information and metadata. It never modifies the file — safe to run repeatedly. Think of it like a doctor examining a patient: the exam doesn't hurt, and the results determine the right treatment (the ffmpeg command).
ffprobe -v quiet -show_format input.mp4The output shows duration, bit_rate, format_name, and other metadata. This is the fastest first check: how long the file is, how big the total bitrate is, what container format it is.
A media file almost always contains more than one stream. -show_streams dissects each one: video, audio, subtitle.
ffprobe -v quiet -show_streams input.mp4For video, you'll see codec_name, width, height, avg_frame_rate. For audio: codec_name, sample_rate, channels. The raw output is long; that's what -select_streams narrows down and -show_entries selects the fields you want.
ffprobe -v quiet -select_streams v -show_entries stream=codec_name,width,height,avg_frame_rate input.mp4ffprobe -v quiet -select_streams a -show_entries stream=codec_name,sample_rate,channels input.mp4v and a are stream type abbreviations. The -select_streams v and -select_streams a pattern is a pair you'll use constantly — quickly answering "what codec does this file use?"
Manual inspection is good, but for scripting you need a machine-processable format. -of json turns the whole report into structured JSON — ready to pipe into jq as you know from the curl series.
ffprobe -v quiet -of json -show_format -show_streams input.mp4ffprobe -v quiet -of json -show_streams input.mp4 | jq -r '.streams[] | "\(.codec_type) \(.codec_name)"'The jq line above prints each stream's type and codec name, one per line. With JSON, you can write scripts that automatically verify "video must be H.264, audio must be AAC" before building a pipeline — a check that's hard to do manually on hundreds of files.
ffprobe is also a validation tool: it returns exit code 0 if a file reads well, and non-zero if there's damage. With -v error only error messages are shown.
ffprobe -v error -show_format input.mp4 && echo "VALID" || echo "CORRUPT"If the command above prints VALID, the file is confirmed readable. To count the number of issues, pipe the output to wc -l:
ffprobe -v error -show_format input.mp4 2>&1 | wc -lThis is very useful in scripts: files that fail validation are skipped rather than stopping the whole batch. You'll use this pattern in episode 9 when processing hundreds of files at once.
Tip
-v quiet suppresses all logs so output stays clean, while -v error only shows problems. For more detailed debugging you can use -v verbose — but in scripts, error is the most sensible choice because it's easy to parse.
ffplay is a minimal video/audio player installed alongside FFmpeg. It's not a replacement for VLC for daily use, but a work tool: quick to call from the terminal, and it supports all FFmpeg filters in real-time.
ffplay input.mp4ffplay input.mp3The commands above immediately open a window and play. Without other arguments, it selects the default stream — enough for a quick check.
ffplay can be fully controlled from the keyboard. Some of the most-used keys:
| Key | Function |
|---|---|
Space | Pause / resume |
q or Esc | Quit |
→ / ← | Forward / back 10 seconds |
↑ / ↓ | Forward / back 60 seconds |
w | Toggle deinterlace mode |
m | Mute / unmute |
Memorizing just three keys is already productive: Space to pause, q to quit, and the arrows to jump. ffplay can even open directly at a specific position with -ss:
ffplay -ss 00:05:00 input.mp4This is the main reason to use ffplay as a work tool: you can test -vf and -af without waiting for a re-encode. If one try in ffmpeg takes minutes, in ffplay the result is instant.
ffplay -vf "hue=s=0" input.mp4The command above plays the video with zero saturation (black and white) live. Once you're happy with a filter combination, just move the same arguments to ffmpeg for the final render.
ffplay -af "volume=0.5" input.mp3This workflow saves a lot of time: experiment in ffplay, produce in ffmpeg. There's no syntax difference between -vf/-af in both — what you see in ffplay is what will be rendered.
Important
When trying heavy filters (e.g., a big scale or several chained filters), ffplay can be a bit laggy on small machines. That's not a sign of a wrong command — just a limitation of real-time rendering. To be sure, always verify the final result with an ffmpeg render, not just from preview smoothness.
In episode 7 you've added two tools to your FFmpeg belt: ffprobe to dissect files — -show_format, -show_streams, -select_streams, and -of json to read results in a structured way — and ffplay to play and preview -vf/-af in real-time with keyboard controls.
The key takeaway: never guess. Every time you receive an unfamiliar file, probe first. Every time you want to try a filter, preview in ffplay first. These two habits will prevent most wrong guesses and wasted renders.
In the next episode 8 we'll dissect containers: what's the difference between MP4, MKV, and WebM, when to remux without re-encoding, and how to select and map streams with -map. See you in episode 8!