Choose what you want to do with a video, set a few options and copy a ready-to-run ffmpeg command. Every flag is explained in plain English, and the command is quoted correctly for macOS/Linux, Command Prompt or PowerShell.
Last updated:
General options
Your ffmpeg command
What each part does
Advertisement
Advertisement
How to use the FFmpeg Command Generator
Pick a task such as Convert, Trim or Make GIF at the top.
Type your file names. The output name is suggested automatically; edit it to override, or click auto to go back.
Set the options for the task: quality, times, size, format or subtitle style. The command updates instantly.
Read the explanation under the command to understand each flag, and check any warnings.
Copy the command and run it in a terminal opened in the folder that contains your video.
How an ffmpeg command is put together
Every FFmpeg command follows the same order: ffmpeg [global options] [input options] -i input [output options] output. Position matters. An option placed before -i changes how the input is read (for example -ss before -i seeks quickly to a time), while the same option after -i applies to the output. Options after the last -i describe the file you are creating: which streams to keep (-map), how to encode them (-c:v, -c:a), and which filters to apply (-vf for video, -af for audio).
The choice between re-encoding and stream copy decides speed and quality. -c copy copies the compressed data untouched: it finishes in seconds and loses nothing, but it cannot resize, filter, cut between keyframes or change codecs. Anything that changes the picture or sound needs a real encoder such as libx264 or aac.
FFmpeg options cheat sheet
Option
What it does
Example
-i
Input file (repeat for several inputs, numbered from 0)
-i video.mp4 -i music.mp3
-ss / -t / -to
Start time / duration / end time
-ss 00:01:00 -t 30
-c:v / -c:a
Video / audio codec, or copy
-c:v libx264 -c:a aac
-crf
Constant quality target (lower is better)
-crf 23
-preset
Encoding speed vs. compression efficiency
-preset slow
-b:v / -b:a
Video / audio bitrate
-b:v 2500k -b:a 128k
-vf
Video filter chain, comma-separated
-vf scale=-2:720,fps=30
-an / -vn / -sn
Drop audio / video / subtitles
-an
-map
Choose which input streams go into the output
-map 0:v -map 1:a
-r
Output frame rate
-r 30
-ar / -ac
Audio sample rate / channel count
-ar 48000 -ac 2
-movflags +faststart
Web-optimized MP4 that starts playing before it fully downloads
Tips for running the commands
Inspect the file first with ffprobe -hide_banner input.mp4. It lists the duration, resolution, frame rate and the codec of every stream, which tells you whether a stream copy will work.
Test on a short piece by adding -t 10 after the input. Encoding ten seconds shows you the quality and speed before you commit to a two-hour file.
Quote names with spaces. The generator does this for you, using double quotes. On macOS and Linux a $ or backtick in a file name is escaped too.
Batch-convert a folder in bash with for f in *.mov; do ffmpeg -i "$f" -c:v libx264 -crf 23 "${f%.mov}.mp4"; done, or in PowerShell with Get-ChildItem *.mov | ForEach-Object { ffmpeg -i $_.Name -crf 23 ($_.BaseName + ".mp4") }.
Hardware encoders such as h264_nvenc (NVIDIA), h264_qsv (Intel) and h264_videotoolbox (Mac) are much faster but use different quality options than -crf. The commands here use the software encoders, which work on every computer.
Frequently asked questions
Does this tool run FFmpeg or upload my video?
No. It only builds the text of the command in your browser. You run the command yourself with FFmpeg installed on your own computer, so your files never leave it.
What CRF value should I use?
For H.264 (libx264), 23 is the default, 18 looks visually lossless to most viewers and 28 gives much smaller files with some softness. H.265 (libx265) defaults to 28 and gives roughly the same quality as x264 at about 23. For VP9, values around 31 are typical for 1080p. Each increase of about 6 roughly halves the file size.
Why does my trimmed clip start a little early or with a frozen frame?
With stream copy (-c copy) FFmpeg can only cut on keyframes, which may be several seconds apart, so the clip starts at the keyframe before your start time. Choose the frame-accurate method to re-encode the clip and start exactly where you asked.
How is the bitrate for a target file size calculated?
Video bitrate in kbps = target size in MB × 8,388.608 ÷ duration in seconds, minus the audio bitrate. The generator also subtracts 3% for container overhead. Two-pass encoding then distributes those bits across the video so the result lands close to the target.
Why use palettegen and paletteuse for GIFs?
A GIF can only show 256 colors per frame. By default FFmpeg uses a generic palette, which causes banding and grain. palettegen analyses your clip and picks the best 256 colors, and paletteuse maps each frame onto them with dithering, giving much cleaner GIFs.
What is the difference between burned-in and soft subtitles?
Burned-in (hard) subtitles are drawn into the picture, so they show on every player but cannot be turned off and require re-encoding. Soft subtitles are stored as a separate track that viewers can switch on or off; adding them is instant because the video is copied, not re-encoded.
How do I install FFmpeg?
On macOS install it with Homebrew (brew install ffmpeg). On Ubuntu or Debian run sudo apt install ffmpeg. On Windows install it with winget install Gyan.FFmpeg (or download a build from ffmpeg.org) and make sure the bin folder is on your PATH. Check the installation with ffmpeg -version.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.