ffmpeg-command-syntax
This skill covers FFmpeg's position-sensitive command structure, explaining where global, input, and output options must appear and how their meaning shifts based on placement. It addresses stream specifiers, multi-input/output handling, and the critical behaviors of options like -ss, -t, -r, and -c that work differently before versus after -i.
ffmpeg-command-syntax teaches the position-sensitive rules for placing FFmpeg options correctly before or after inputs.
AI-generated summary based on this skill's SKILL.md
Install
JosiahSiegel/claude-plugin-marketplace/ffmpeg-command-syntax · repository language: Shell
git clone https://github.com/JosiahSiegel/claude-plugin-marketplace
cp -r claude-plugin-marketplace/plugins/ffmpeg-core/skills/ffmpeg-command-syntax ~/.claude/skills/ffmpeg-command-syntaxnpx skillfed install JosiahSiegel/claude-plugin-marketplace/ffmpeg-command-syntaxFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How to place ffmpeg options correctly in a command?
ffmpeg-command-syntax teaches that option placement is critical: global options come first, then -i input_file, then output options, then output_file. Options before -i apply to input decoding; options after -i apply to output encoding. For example: ffmpeg -ss 10 -i input.mp4 -c:v libx264 output.mp4 seeks 10 seconds during input, while ffmpeg -i input.mp4 -ss 10 output.mp4 seeks after loading the full file. This position-dependent behavior applies to -ss, -t, -r, -c, and many others.
What's the difference between ffmpeg input vs output options?
ffmpeg-command-syntax clarifies that input options (placed before -i) control how FFmpeg reads and decodes the input file—like -ss for seeking, -r for frame rate during input, or -c:v for input codec. Output options (placed after -i) control encoding and writing—like -c:v for output codec, -b:v for bitrate, or -vf for filters. Misplacing them changes behavior: -ss before -i is fast but less accurate; -ss after -i is slow but frame-accurate.
Why is my ffmpeg command not working—what syntax errors occur?
ffmpeg-command-syntax identifies common errors: placing output options before -i (they're ignored), using -ss after -i when you need speed, forgetting stream specifiers like :v or :a for multi-stream files, and mixing -vf (simple filter) with -filter_complex (advanced routing). Check your -i position: it must come after global/input options and before output options. Verify codec and format options match their target (video vs audio). Use -vf for single-input filtering; use -filter_complex for multi-input or complex graphs.
What are ffmpeg stream specifiers and when do you use them?
ffmpeg-command-syntax explains that stream specifiers target specific streams in files with multiple audio, video, or subtitle tracks. Use :v for video, :a for audio, :s for subtitles, or :0:v for stream 0's video. Example: ffmpeg -i input.mp4 -c:v libx264 -c:a aac output.mp4 encodes video with libx264 and audio with aac. Without specifiers, FFmpeg applies options to all matching streams. For multi-input/output, specify which input feeds which output using -map input_index:stream_specifier.
How does ffmpeg -ss placement affect seeking—before or after -i?
ffmpeg-command-syntax emphasizes that -ss before -i seeks during input decoding (fast, keyframe-based, less accurate), while -ss after -i seeks after loading (slow, frame-accurate). Use -ss before -i for rough cuts or live streams; use -ss after -i when precision matters. Combine both for speed and accuracy: ffmpeg -ss 10 -i input.mp4 -ss 0.5 -t 5 output.mp4 fast-seeks to ~10s, then frame-accurate seeks 0.5s more, capturing 5 seconds.
What's the difference between ffmpeg -t vs -to duration options?
ffmpeg-command-syntax distinguishes -t (duration in seconds from start) from -to (absolute end timestamp). Example: ffmpeg -i input.mp4 -t 10 output.mp4 outputs 10 seconds; ffmpeg -i input.mp4 -to 30 output.mp4 outputs up to the 30-second mark. Combine them: ffmpeg -ss 5 -i input.mp4 -t 10 output.mp4 starts at 5s and captures 10 seconds total. Position matters: place both after -i for output control.
SKILL.md
rendered from the published skill — quoted content, verbatim
CRITICAL: FFmpeg Option Ordering Rules
The most common FFmpeg mistake is putting options in the wrong place. Options in FFmpeg are position-sensitive and apply to the NEXT file specified after them.
The Golden Rule
ffmpeg [global_options] {[input_options] -i input}... {[output_options] output}...
Key principle: Options are applied to the next file. They are reset between files.
Option Categories at a Glance
| Category | Where it goes | Notable members
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 6 files
plugins/ffmpeg-core/skills/ffmpeg-command-syntax/SKILL.md
plugins/ffmpeg-core/skills/ffmpeg-command-syntax/references/complete-option-reference.md
plugins/ffmpeg-core/skills/ffmpeg-command-syntax/references/format-specific-options.md
plugins/ffmpeg-core/skills/ffmpeg-command-syntax/references/hardware-device-init.md
plugins/ffmpeg-core/skills/ffmpeg-command-syntax/references/stream-specifiers.md
plugins/ffmpeg-core/skills/ffmpeg-command-syntax/references/timestamps-bitstream-metadata.md