FFmpeg
$ ffmpeg Foundation Med Riskffmpeg converts, trims, scales, extracts frames/audio from, and remuxes nearly every video and audio format in existence. Agents must pass -y (or -n) and -loglevel error (or -nostats) so interactive overwrite prompts and progress lines never block or flood logs.
brew install ffmpeg Deterministic local media preprocessing (ffmpeg -nostdin -loglevel error) for trimming, resampling audio for Whisper, or extracting keyframes before VLM analysis.
Agent-Readiness Checklist
Local Probe EvidenceCaptured --help excerpt
Universal media converter
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Getting help:
-h -- print basic options
-h long -- print more options
-h full -- print all options (including all format and codec specific options, very long)
-h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter/bsf/protocol
See man ffmpeg for detailed description of the options.
Per-stream options can be followed by :<stream_spec> to apply that option to specific streams only. <stream_spec> can be a stream index, or v/a/s for video/audio/subtitle (see manual for full syntax).
Print help / information / capabilities:
-L show license
-license show license
-h <topic> show help
-version show version
-muxers show available muxers
-demuxers show available demuxers
-devices show available devices
-decoders show available decoders
-encoders show available encoders
-filters show available filters
-pix_fmts show available pixel formats
-layouts show standard channel layouts
-sample_fmts show available audio sample formats
Global options (affect whole program instead of just one file):
-v <loglevel> set logging level
-y overwrite output files
-n never overwrite output files
-print_graphs print execution graph data to stderr
-print_graphs_file <filename> write execution graph data to the specified file
-print_graphs_format <format> set the output printing format (available formats are: default, compact, csv, flat, ini, json, xml, mermaid, mermaidhtml)
-stats print progress report during encoding
Per-file options (input and output):
-f <fmt> force container format (auto-detected otherwise)
-t <duration> stop transcoding after specified duration
-to <time_stop> stop transcoding after specified time is reached
-ss <time_off> start transcoding at specified time
Per-file options (output-only):
-metadata[:<spec>] <key=value> add metadata
Per-stream options:
-c[:<stream_spec>] <codec> select encoder/decoder ('copy' to copy stream without reencoding)
-filter[:<stream_spec>] <filter_graph> apply specified filters to audio/video
Video options:
-r[:<stream_spec>] <rate> override input framerate/convert to given output framerate (Hz value, fraction or abbreviation)
-aspect[:< FCRS-1.0 6-Dimension Breakdown
Scriptable with -nostdin, -y/-n, and -loglevel error, though default runs print verbose banner/progress stderr and prompt interactively if output exists.
- Needs
-nostdin -y/-n -loglevel errorto avoid prompts and noisy stderr
Runs locally; -y silently overwrites existing output files, and malformed inputs/network URLs can decode remote streams.
- Local transcoding;
-yoverwrites destination files without confirmation
Available across macOS (brew), Linux package managers, and static Windows/Linux builds.
- Universally packaged on macOS, Linux, Windows
Unrivaled swiss-army knife for video/audio conversion, frame extraction, and ASR/VLM preprocessing.
- Handles virtually every codec, container, and filtergraph
Foundational FFmpeg Project under LGPL/GPL.
- Official FFmpeg Project
Massive official documentation, though complex filtergraph flags and -i argument ordering trip up scripts.
- Official documentation at ffmpeg.org/ffmpeg.html
Security, Auth & Guardrails
None required; operates on local media files or explicit stream URLs.
Free, LGPL/GPL open-source C binary.
# FFmpeg Agent Rules - Always pass `-nostdin`, `-loglevel error` (or `-nostats`), and either `-n` (never overwrite) or explicit `-y` so `ffmpeg` never blocks waiting on `Overwrite? [y/N]` or stdin `q`. - Use `ffprobe` for JSON metadata inspection rather than parsing `ffmpeg -i` stderr.
Agent-Ready Command Recipes
Safe Read-Only Queries
ffmpeg -nostdin -hide_banner -i input.mp4 -af silencedetect=noise=-30dB:d=0.5 -f null -
Analyzes audio silence intervals using -f null - without creating any output media file.
Controlled Writes & Previews
ffmpeg -nostdin -y -loglevel error -i input.mp4 -vn -ac 1 -ar 16000 audio.wav
Extracts mono 16 kHz audio (-vn strips video), skips overwrite prompts (-y), and suppresses noisy stats.
Strengths for Agents
- + Universal coverage of audio/video codecs, filters, and container remuxing.
- + Essential preprocessor for stripping audio, downscaling frames, and resampling WAV for Whisper/VLMs.
Caveats & Pitfalls
- ! Prompts
[y/N]on existing output files unless-yor-nis passed, and reads stdin unless-nostdinis set. - ! Stderr output is very noisy without
-hide_banner -loglevel error.