FFmpeg Command Generator Prompt
Generate a safe, precise FFmpeg command from media metadata and a plain-language task, with quoting, codec choices, validation, and no-overwrite defaults.
Prompt Template
You are a senior media-pipeline engineer generating an FFmpeg command from the task, media metadata, installed version, and shell context I provide. Prefer explicit, readable commands; preserve the source file; use a no-overwrite default; and never claim the command was tested unless I provide execution output. Task in plain language: [convert, resize, compress, trim, crop, concatenate, extract audio, add subtitles, normalize, inspect, other] FFmpeg and ffprobe versions: [paste version output or unknown] Operating system and shell: [macOS zsh, Linux bash, PowerShell, cmd, other] Input filenames and exact paths: [sanitized paths] ffprobe metadata for every input: [paste streams, duration, dimensions, frame rate, codecs, sample rate, channels, rotation, color data] Required output filename and container: [details] Target video codec or compatibility goal: [details or choose conservatively] Target audio codec or compatibility goal: [details or choose conservatively] Resolution, aspect ratio, crop, padding, and rotation: [requirements] Frame-rate behavior: [preserve, constant target, variable, unknown] Quality or size target: [CRF or quality goal, bitrate cap, file-size limit, unknown] Time range: [start, end, duration, exactness requirement] Subtitle, metadata, chapter, and attachment handling: [requirements] Hardware acceleration: [none, confirmed encoder and device, unknown] Batch or single file: [details] Overwrite policy: [default no overwrite, explicit reviewed replacement workflow] Verification requirements: [duration, stream count, dimensions, sync, loudness, playback targets] Provide: 1. A short interpretation of the requested transformation and any missing metadata. 2. The complete ffprobe inspection command when metadata is missing. 3. The smallest readable FFmpeg command, quoted for the verified shell and using -n unless I explicitly approve replacement. 4. An explanation of input placement, mapping, filters, codecs, quality controls, metadata handling, and output container. 5. A conservative software-encoding fallback when hardware support is unverified. 6. Validation commands for output streams, duration, dimensions, frame rate, audio, and file integrity. 7. Edge cases for rotation, variable frame rate, multiple audio tracks, subtitles, color metadata, odd dimensions, and paths with spaces. 8. A dry-run or short-sample workflow when feasible, writing to a new output path. 9. Version and portability notes for filters or encoders used. 10. A final audit for accidental overwrite, dropped streams, sync drift, incompatible codecs, shell injection, unquoted paths, and unsupported options. Do not use eval, interpolate untrusted filenames into a shell loop, delete source media, invent metadata, assume hardware encoders exist, or promise perceptual quality or exact file size without testing. Ask for ffprobe output when the choice depends on facts not supplied.
Example Output
Interpretation
Create a 1280-pixel-wide H.264 copy in a new MP4 file while preserving aspect ratio and encoding audio as AAC. Exact stream choices still require ffprobe metadata.
Command
ffmpeg -n -i 'input.mov' -map 0:v:0 -map 0:a:0? -vf 'scale=1280:-2' -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k 'output.mp4'
Safety
- -n refuses to overwrite an existing output.
- The optional audio map avoids failure when no audio stream exists.
- The source file is read only.
Validation
Use ffprobe to compare duration, stream count, dimensions, codecs, frame rate, and audio properties, then play the beginning, middle, and end to check sync. Confirm color and rotation metadata before production use.
Tips for Best Results
- ๐กPaste ffprobe output; container extensions alone do not reveal the streams or metadata that the command must preserve.
- ๐กUse -n and a new output filename until the result passes stream, duration, sync, and playback checks.
- ๐กState the shell and quote every path because commands that work in zsh or bash may fail in PowerShell or cmd.
Frequently Asked Questions
What is the FFmpeg Command Generator Prompt prompt?
Generate a safe, precise FFmpeg command from media metadata and a plain-language task, with quoting, codec choices, validation, and no-overwrite defaults. It's a free ChatGPT prompt template from our Coding collection โ copy it, fill in the bracketed variables, and paste it into your AI tool.
Which AI tools work with this prompt?
It's written and tested for ChatGPT, Claude and Gemini. Any AI assistant that accepts free-form text prompts will handle it well.
How do I customize this ChatGPT prompt?
Replace the bracketed variables โ such as [paste version output or unknown], [sanitized paths], [details] โ with your own details before running it. Paste ffprobe output; container extensions alone do not reveal the streams or metadata that the command must preserve.
Is this prompt free to use?
Yes. Every prompt on PromptAtlas is free to copy, customize, and use โ no signup required.
Related Prompts
Code Review Assistant
Get a thorough, senior-level code review with actionable feedback on quality, security, performance, and best practices.
Debugging Detective
Systematically debug errors and unexpected behavior with root cause analysis and fix suggestions.
Code Refactoring Advisor
Transform messy, complex code into clean, maintainable, well-structured code with clear explanations.