Free tool · Video
This ffmpeg command generator builds a command from twelve fixed recipes, so every flag in it is one that ffmpeg documents. Each flag and filter is explained next to the command and linked to its section on ffmpeg.org, which means nothing is invented and you can check any piece yourself. That matters because the failure people report with chatbots is flags that do not exist. Pick a recipe, fill in your file names, copy the command, and run it in your own terminal.
Free, no account required.
Cut a section by start and end time. Stream copy is instant but snaps to keyframes; re-encode is frame accurate.
Command
ffmpeg -ss 00:00:00 -to 00:00:10 -i input.mp4 -c copy clip.mp4What each part does
-ss Start position. Given before -i it seeks in the input. ffmpeg docs-to Stop position, as a timestamp. ffmpeg docs-i Names the input file. ffmpeg docs-c Selects the codec for all streams. The value copy means stream copy: no re-encoding. ffmpeg docsNothing you type leaves your browser. Names with spaces or quotes are quoted for macOS and Linux shells (bash, zsh); on Windows PowerShell or Command Prompt, quote them with double quotes yourself.
Each recipe is a fixed template. You can change the values, never the structure. The command shown is what you get with the default values, and the tool above explains every part of it with a link to the official ffmpeg documentation. The burn subtitles recipe needs an ffmpeg build configured with libass, as the subtitles filter documentation states; run ffmpeg -filters | grep subtitles and if nothing prints, your build lacks it.
| Recipe | What it does | Default command |
|---|---|---|
| Trim a clip | Cut a section by start and end time. Stream copy is instant but snaps to keyframes; re-encode is frame accurate. | ffmpeg -ss 00:00:00 -to 00:00:10 -i input.mp4 -c copy clip.mp4 |
| Compress a video | Shrink a video with H.264 constant quality and AAC audio. | ffmpeg -i input.mov -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k -movflags +faststart output.mp4 |
| Convert MOV, MKV or WebM to MP4 | Re-encode to H.264 video and AAC audio, the combination MP4 players expect. | ffmpeg -i input.mkv -c:v libx264 -crf 23 -c:a aac -movflags +faststart output.mp4 |
| Extract audio | Pull the soundtrack out. M4A copies the AAC track untouched, MP3 encodes with LAME. | ffmpeg -i input.mp4 -vn -c:a copy audio.m4a |
| 16:9 to vertical 1080x1920 with bars | Fit the whole landscape frame inside a 9:16 canvas and pad the rest with black. | ffmpeg -i input.mp4 -vf 'scale=1080:-2,pad=1080:1920:(ow-iw)/2:(oh-ih)/2' -c:a copy vertical.mp4 |
| 16:9 to vertical 9:16 by cropping | Cut a centred 9:16 window from the full height of a landscape video. | ffmpeg -i input.mp4 -vf 'crop=ih*9/16:ih' -c:a copy vertical.mp4 |
| Burn subtitles into a video | Draw subtitles from an SRT or ASS file permanently onto the picture. | ffmpeg -i input.mp4 -vf subtitles=subs.srt -c:a copy subtitled.mp4 |
| Normalize loudness | Single-pass EBU R128 loudness normalization to a target in LUFS. | ffmpeg -i input.mp4 -af loudnorm=I=-16:TP=-1.5:LRA=11 -ar 48000 -c:v copy normalized.mp4 |
| Video to GIF | Make a GIF with a palette built from the clip itself, which avoids the banded default palette. | ffmpeg -i input.mp4 -vf 'fps=12,scale=480:-1:flags=lanczos,split[a][b];[a]palettegen[p];[b][p]paletteuse' output.gif |
| Remove the audio track | Drop audio and copy the video untouched, so it is instant and lossless. | ffmpeg -i input.mp4 -an -c:v copy silent.mp4 |
| Change playback speed | Speed up or slow down video and audio together; audio keeps its pitch. | ffmpeg -i input.mp4 -vf setpts=PTS/2 -af atempo=2.0 speed.mp4 |
| Keep only some segments | Keep chosen time ranges and join them, in video and audio together. Ranges are start-end in seconds, separated by commas. | ffmpeg -i input.mp4 -vf 'select=between(t\,0\,5)+between(t\,8\,12),setpts=N/FRAME_RATE/TB' -af 'aselect=between(t\,0\,5)+between(t\,8\,12),asetpts=N/SR/TB' kept.mp4 |
A thread on r/ffmpeg asks what ffmpeg command an LLM butchered. The original post says a chatbot is usually fine for a basic transcode, but that “the second you try to do a nested -filter_complex or niche audio mapping, it just starts making up flags that don't exist”. A reply in the same thread puts it more bluntly: “Makes up parameters half of the time.” These are two practitioners on one subreddit, not a measurement, but the pattern is consistent with how language models work.
ffmpeg is a hard target for text prediction. Its options are numerous, they are spread across the main tool, the codecs, the formats and several hundred filters, and similar names mean different things in different places. A model that has seen many commands will produce one that looks right. Looking right and being accepted by ffmpeg are different tests, and a plausible but wrong flag usually fails only when you run it, often with an error that does not point back to the cause.
This page takes the opposite approach. The set of flags is closed: a handful of options and filters, each tied to a documentation anchor. If a recipe needs -movflags +faststart, the explanation links to the MOV and MP4 muxer section of the ffmpeg formats documentation. If you need something outside the twelve recipes, the right move is the documentation, not a guess. The prompt button hands a coding agent the exact command and tells it not to add, change or invent flags. For the specific mistakes, with the real errors and fixed commands, see our guide to the ffmpeg commands AI gets wrong.
The most useful distinction in ffmpeg is whether you decode and encode the pictures again. Stream copy (-c copy) rewrites the container and leaves the compressed data alone.
Near instant, no quality loss, no CPU cost. The catches are that cuts can only begin on keyframes, so a trim may start a little early, and that you cannot change anything that requires touching the picture, such as scaling, cropping, burning in subtitles or changing the codec. The trim, mute and audio extract recipes use it where it is safe.
Slower, and each generation of lossy encoding costs a little quality, but it is frame accurate and lets you resize, crop, change speed and pick a different codec. Every recipe that alters the picture, including compress, vertical pad and crop, GIF and speed, re-encodes. Where a recipe re-encodes only the video, it copies the audio so that half stays untouched.
For H.264 the usual way to trade quality against size is the constant rate factor. The ffmpeg wiki guide to H.264 (checked October 2026) says the scale runs from 0, lossless, to 51, the worst quality, that 23 is the default, and that 17 to 28 is the sane range. You choose a quality and the encoder picks the bitrate, so file size is an outcome rather than an input. Compress and convert both expose CRF, limited here to 18 through 32 so a typo cannot produce an unwatchable file.
The preset is a separate dial: slower presets spend more time searching for savings and produce a smaller file at the same CRF. Because the preset changes speed and size but not the CRF target, it is a safe thing to raise if you can wait. If you need to land under a hard size limit instead, work out the bitrate you can afford with the video bitrate calculator and use a target bitrate encode rather than CRF.
Two details are worth knowing. Dimensions passed to H.264 must be even for common pixel formats, which is why the vertical recipes use a height of -2, a documented value for the scale filter that keeps the aspect ratio and rounds to an even number. And the +faststart movflag moves the index to the front of an MP4, so a web player can begin before the download finishes.
ffmpeg is a command-line program, so you install it once and then run the commands from a terminal in the folder that holds your video. Official source code and links to builds are on ffmpeg.org/download.
Homebrew publishes an ffmpeg formula. In Terminal run:
brew install ffmpegThen check it with ffmpeg -version.
ffmpeg.org lists Windows builds from third parties. The gyan.dev builds page gives this package manager command (checked October 2026). In PowerShell run:
winget install ffmpegOpen a new terminal afterwards so the path is picked up, then run ffmpeg -version.
Run a command from the folder that contains the input file, so the short file names in the generator resolve. If a file name contains spaces, the generator quotes it for macOS and Linux shells. Output files are written next to the input, and ffmpeg asks before overwriting one that already exists. For more small utilities, browse the other free tools, or see Linkeddit Studio.
Step 1
Choose the job: trim, compress, convert to MP4, extract audio, crop for vertical video, burn in subtitles, normalize loudness, make a GIF, remove audio, change speed or keep only some segments.
Step 2
Type the input and output file names and any values the recipe needs, such as start and end time or quality. Numbers outside the safe range are pulled back into it.
Step 3
Copy the command into a terminal in the folder that holds your file, or copy the Claude Code and Codex prompt version. The list under the command explains every flag with a link to its ffmpeg documentation.
When you outgrow this tool
This generator is free and complete on its own, with no account. Linkeddit Studio is the desktop editor for the same jobs on files on your own disk. Instead of a raw command line, it gives Claude Code or Codex named edit commands for trimming, cropping, speed changes and exports, and every edit the agent makes can be undone. Studio is a one-time purchase.
FAQ
Direct answers on the commands people search for most, and on why they go wrong.
ffmpeg -ss 00:00:05 -to 00:00:15 -i input.mp4 -c copy clip.mp4 cuts from 5 to 15 seconds without re-encoding. Stream copy is instant, but it can only start on a keyframe, so the cut may land slightly early. Switch the recipe to re-encode for a frame accurate cut. ffmpeg's documentation notes that in most formats it is not possible to seek exactly, which is why the two methods exist.
Re-encode with H.264 and a constant rate factor: ffmpeg -i in.mov -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k -movflags +faststart out.mp4. A higher CRF gives a smaller, softer file. The ffmpeg wiki H.264 guide (checked October 2026) says the CRF scale runs from 0 to 51 with 23 as the default and 17 to 28 as the sane range. This generator limits CRF to 18 through 32.
Use the convert recipe. It re-encodes to H.264 video and AAC audio, which is the pairing MP4 players expect, and adds +faststart so the file can start playing before it has fully loaded. If the streams inside are already H.264 and AAC you can instead stream copy with -c copy, which is faster and lossless.
ffmpeg -i video.mp4 -vn -c:a copy audio.m4a drops the video and copies the audio untouched, which works when the source audio is AAC. For MP3, use -vn -c:a libmp3lame -q:a 2. Lower -q:a values mean higher quality in the libmp3lame encoder.
There are two honest options. Pad keeps the whole frame and adds bars: scale=1080:-2,pad=1080:1920:(ow-iw)/2:(oh-ih)/2. Crop keeps the full height and throws away the sides: crop=ih*9/16:ih. Pad loses no content; crop fills the screen but loses whatever sits outside the window. Pick per clip.
ffmpeg has thousands of options across codecs, filters and muxers, and many look alike. A language model produces plausible text, not a checked lookup, so under complex filtergraphs it can emit a flag or filter option that does not exist. Practitioners on r/ffmpeg describe exactly this. The remedy is to build commands from a fixed set of documented options and read the docs for anything outside it, which is what this tool does.
No. It never asks for a video file and never runs ffmpeg. It only assembles text in your browser from fixed templates. You run the command yourself, on your own machine, against your own files.
The flags are identical on every platform. The quoting is not: the generator quotes file names for macOS and Linux shells, so on Windows Command Prompt or PowerShell wrap names that contain spaces in double quotes yourself. Install ffmpeg first with the steps on this page.
Every tool on the shelf is free, with no card and no trial. Most need no account at all. See all free tools.
Work out file size from bitrate, the bitrate that fits a size limit, or how long a video can run, with audio included.
Pick a resolution, frame rate and SDR or HDR and get YouTube's recommended container, codec, bitrate and audio settings, with the source linked.
Reduce a resolution to its ratio, scale to a width or height with even dimensions, and see the crop or padding needed to reframe, such as 16:9 to 9:16.
Convert SRT to VTT or VTT to SRT, shift subtitle timing by seconds, and see malformed timestamps with their line numbers.