>FFmpegLab Sign In
FFmpeg Guide

FFmpeg, ffprobe & ffplay: the complete toolkit explained

Stop copy‑pasting blindly. Understand how the `ffmpeg` command is structured, how stream specifiers let you target individual tracks, how to inspect files with `ffprobe`, and how to preview filters with `ffplay`.

FFmpeg is not one program — it's a suite of tools. The three you'll use daily are:

Under the hood, they all share the same libraries (libavcodec, libavformat, libavfilter). Once you understand the command syntax and stream specifiers, you unlock the full power of FFmpeg.

Key takeaways


Part 1: The `ffmpeg` command syntax

The general structure of every ffmpeg command is:

ffmpeg [global options] [input options] -i input [filter options] [output options] output

But the most important rule is: order is not arbitrary. Options are applied at the moment they are parsed. Let's break it down.

Input options vs. output options

Example: the crucial `-ss` position

This is the most common pitfall for beginners.

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
# Fast seek (input option) — starts at keyframe, instant
ffmpeg -ss 00:10 -i input.mp4 -t 5 -c copy clip.mp4

# Frame‑accurate seek (output option) — decodes from start, slow but precise
ffmpeg -i input.mp4 -ss 00:10 -t 5 -c:v libx264 clip.mp4

When -ss is before -i, FFmpeg uses fast seeking. It jumps to the nearest keyframe (instant, no decoding). When -ss is after -i, FFmpeg decodes everything from the start until it reaches the timestamp (slow, but frame‑accurate). Use the first one for lossless -c copy cuts; use the second only when you need exact frame precision and are re‑encoding.

Common global and output options


Part 2: Stream specifiers — the superpower you've been missing

A stream specifier is a suffix you attach to an option (e.g., -c, -b, -map) to tell FFmpeg which specific streams you want to target.

The syntax is option:stream_specifier.

Basic stream specifier syntax

SpecifierMeaningExample
:vAll video streams-c:v libx264
:aAll audio streams-b:a 128k
:sAll subtitle streams-c:s copy
:dAll data streams-map 0:d
:v:0First video stream (index 0)-c:v:0 libx264
:a:1Second audio stream (index 1)-c:a:1 aac
:s:2Third subtitle stream-c:s:2 mov_text
:v:0,a:0Video 0 and Audio 0 (combined)-map 0:v:0 -map 0:a:0
:m:language:engStreams with English language tag-c:m:language:eng copy

Practical stream specifier examples

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
# Re‑encode video to H.265, but copy audio & subtitles as‑is
ffmpeg -i input.mkv -c:v libx265 -crf 24 -c:a copy -c:s copy output.mkv

# Set a lower bitrate for the second audio stream only
ffmpeg -i input.mkv -c:a:0 copy -b:a:1 96k -c:a:2 copy output.mkv

# Map only the first video and the second audio from input 0
ffmpeg -i input.mkv -map 0:v:0 -map 0:a:1 -c copy output.mp4

# Copy all video streams, but only English subtitles
ffmpeg -i input.mkv -c:v copy -c:s:m:language:eng copy output.mkv

To see which streams are available in a file (and their indexes), use:

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
ffmpeg -i input.mkv

This prints a detailed list of streams with their indices. For example: Stream #0:0[0x1](eng): Video: h264 ... means :v:0 or :a:0 depending on the type.


Part 3: ffprobe — the media inspector

ffprobe is the Swiss Army knife for inspecting media files. It reads the container, streams, packets, and frames without decoding the video, making it incredibly fast.

Basic ffprobe usage

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
# Show all streams, metadata, and format info
ffprobe input.mp4

# Show only the container format
ffprobe -show_format input.mp4

# Show only the streams (video/audio/subtitle)
ffprobe -show_streams input.mp4

# Show frame-by-frame information (can be huge)
ffprobe -show_frames input.mp4

# Show only video streams
ffprobe -select_streams v -show_streams input.mp4

Output formats for scripting

ffprobe shines when you need to parse its output programmatically. Use -of (or -print_format) to choose the output format.

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
# JSON output (excellent for Python/Node.js)
ffprobe -v quiet -print_format json -show_format -show_streams input.mp4

# XML output
ffprobe -v quiet -print_format xml -show_format input.mp4

# CSV output (for spreadsheets)
ffprobe -v quiet -of csv -select_streams v -show_entries stream=codec_name,width,height input.mp4

# Compact, human‑friendly
ffprobe -v quiet -of default=noprint_wrappers=1 -show_entries format=format_name,duration input.mp4

Common ffprobe tasks

Use ffprobe when you need to build automated workflows — it's the foundation of FFmpegLab's media analysis.


Part 4: ffplay — the interactive player and filter debugger

ffplay is a simple media player built on top of FFmpeg. It's not meant to replace VLC or MPC‑HC. Instead, it's a debugging and prototyping tool for filters, seeking, and raw stream analysis.

Basic playback

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
# Play a video with sound
ffplay input.mp4

# Play only audio
ffplay -nodisp input.mp3

# Play at half speed
ffplay -vf "setpts=2.0*PTS" input.mp4

Previewing filters in real‑time

This is where ffplay truly shines. Instead of encoding a file to test a complex filter chain, you can preview it instantly.

ShareRenders{ } CodeConfig
Generated CodeLogsCustomize
# Test a scale + crop + fade filter live
ffplay -vf "scale=640:-1,crop=640:360,format=gray,fade=t=in:st=0:d=2" input.mp4

# Test audio filters (speed up audio)
ffplay -af "atempo=2.0" input.mp4

ffplay keyboard shortcuts

KeyAction
fToggle fullscreen
sStep frame‑by‑frame (pause first)
SpacePause / resume
Left / RightSeek backward / forward 10 seconds
Down / UpSeek backward / forward 1 minute
mMute / unmute
q or ESCQuit

ffplay is also useful for testing stream selection and raw YUV/PCM data. For example, to play the raw video stream without audio: ffplay -vn -nodisp input.mp4 (audio only).


Cheat sheet: quick reference

TaskCommand
Remux MP4 → MKV (lossless)ffmpeg -i input.mp4 -c copy output.mkv
Encode H.265 with CRF 24ffmpeg -i input.mov -c:v libx265 -crf 24 -c:a aac output.mp4
Copy only first video + second audioffmpeg -i input.mkv -map 0:v:0 -map 0:a:1 -c copy output.mkv
Fast lossless cut from 1:05 to 1:35ffmpeg -ss 00:01:05 -i input.mp4 -to 00:01:35 -c copy clip.mp4
Frame‑accurate cut (re‑encode)ffmpeg -i input.mp4 -ss 00:01:05 -to 00:01:35 -c:v libx264 -crf 18 clip.mp4
Inspect file in JSONffprobe -v quiet -print_format json -show_format -show_streams input.mp4
Preview grayscale + fade with ffplayffplay -vf "format=gray,fade=t=out:st=5:d=3" input.mp4

Putting it all together

Once you understand the syntax, the stream specifiers, and the positioning of options, you stop guessing. You know exactly why a command works—or why it fails.

These fundamentals power every tutorial on this site. Pair this knowledge with our Complete Codecs Guide to choose the right encoder, and the Complete Formats Guide to pick the right container.

Ready to put this into practice with a visual interface? FFmpegLab gives you a timeline and property panels that generate these exact commands for you — while running entirely offline.

✦  Fresh from the render queue

Better FFmpeg workflows, delivered.

Get practical commands, new templates, and deep-dive guides for the edits that are usually hardest to get right.

✓  Copy-pasteable commands    ✓  Editor templates    ✓  No noise
One useful email at a time.

Master the toolkit on a real timeline — offline.

Free in your browser — nothing to install, nothing uploaded.