DevTools Logo

FFmpeg Command Builder

FFmpeg Command Builder

Assemble exact ffmpeg commands with every flag annotated — no media is uploaded or processed.

Runs in your browser
Try an example

Command inputs

1 input
Video
Audio

Command preview

one-liner

Flag legend

  • -iInput file; repeat for multiple inputs.
  • -c:vVideo codec (libx264, libx265, libvpx-vp9, copy…).
  • -crfConstant Rate Factor: lower is higher quality; 18–28 is typical.
  • -presetEncoder speed/efficiency trade-off: ultrafast … placebo.
  • -pix_fmtPixel format; yuv420p maximises player compatibility.
  • -c:aAudio codec (aac, libmp3lame, flac, copy…).
  • -b:aAudio bitrate, e.g. 128k.

Examples

MOV → H.264 MP4

Input
input.mov · libx264 · CRF 23 · medium · aac 128k
Output
ffmpeg -i 'input.mov' -c:v libx264 -crf 23 -preset medium -pix_fmt yuv420p -c:a aac -b:a 128k output.mp4

A general-purpose conversion with visually good quality and broad player compatibility.

Aspect-safe scale

Input
width 1280, height -2
Output
-vf scale=1280:-2

-2 computes an even height preserving the source aspect ratio, avoiding yuv420p codec errors.

Two-pass GIF

Input
gif template, fps 15, width 800
Output
pass 1: palettegen → palette.png; pass 2: paletteuse with the generated palette

A generated palette produces sharper colours than converting to GIF in a single pass.

About this tool

The FFmpeg Command Builder turns a friendly form into an exact ffmpeg CLI command. Choose a task template — convert, compress, trim, scale, extract audio, GIF or screenshot — then edit inputs, codecs, bitrates and filters. The command is assembled in canonical order: global flags, inputs, filters, output options, output file.

Every flag has an annotation in the legend, so -crf 23 is explained as Constant Rate Factor (lower is higher quality), -preset as an encoder speed/efficiency trade-off, and -movflags +faststart as a web-playback optimisation. Hover-free and keyboard-friendly, the legend is a visible list rather than a tooltip-only detail.

Validation catches the classic mistakes: CRF together with bitrate, FLAC in an MP4 container, an odd scale height that breaks yuv420p, and an empty output name. GIF tasks emit the canonical two-pass palettegen/paletteuse pipeline. Nothing is uploaded or processed — the tool only emits command text you can run anywhere.

What this tool does not do

  • Emits commands only; it does not execute ffmpeg or validate against the binary installed on your machine.
  • Task templates cover common workflows, not the full ffmpeg filter graph language.
  • Shell quoting is POSIX single-quote style by default; PowerShell users should adapt paths before running.

How to use this tool

  1. Choose a template

    Click Convert, Compress, Trim, Scale, Audio, GIF or Screenshot to seed a correct baseline command.

  2. Edit the model

    Set input and output files, codecs, CRF or bitrate, scale dimensions and trim times; the command updates live.

  3. Read the legend

    Each emitted flag is listed with its meaning, so you learn what the command does instead of copying blind.

  4. Copy and run

    Copy the one-liner or the multi-line version with shell continuations, then run it in your own terminal.

Use cases

Transcode pipelines

Get a correct baseline command for a server-side conversion job, then wire it into your worker.

Batch conversions

Build once with the right quality flags and reuse the command across files.

Learning ffmpeg

Read the annotated legend to understand what each opaque-looking flag actually does.

Canonical flag order

StageFlags
Global-y (only when overwrite is enabled)
Inputs-ss seek before -i for fast seeking; repeated -i per file
Output timing-ss / -to after inputs for accurate trimming
Streams-map 0:v:0 / -map 0:a:0 when selected
Filters-vf scale=W:H,fps=N
Video-c:v, -crf or -b:v, -preset, -pix_fmt
Audio-c:a, -b:a, -ac, -ar or -vn / -an
Output-movflags +faststart for MP4, then the output filename

Paths are POSIX single-quoted by default; filenames with quotes use the standard '\'' splice.

Common mistakes

Mistake:Setting CRF and a bitrate together.

Fix:They are different rate-control modes. The builder warns and emits CRF only; choose one deliberately.

Mistake:Using scale height -1 with yuv420p.

Fix:Odd dimensions fail with 4:2:0 chroma subsampling. Use -2 to get the nearest even height.

Mistake:Expecting the browser to run ffmpeg.

Fix:This tool assembles command text only — no media is read, processed or uploaded. Run the copied command in your own terminal.

Frequently asked questions

What does -crf mean and which value should I use?

-crf is Constant Rate Factor, ffmpeg's quality-first rate control: lower numbers mean higher quality and bigger files. 18 is roughly visually lossless, 23 is the libx264 default and a good starting point, and 28 is a small-file/low-quality choice. Do not combine -crf with -b:v — they are alternative rate-control modes, and the builder warns if both are set.

Why does the GIF template use two passes?

GIF supports a limited palette, so converting directly gives muddy colours and banding. The first pass runs palettegen over the sampled frames to build an optimal global palette; the second applies it with paletteuse and dithering. The builder emits both commands with matching fps/scale filters so the palette fits the final output.

What is the difference between input-side and output-side -ss?

Before -i, ffmpeg seeks in the input file to a keyframe near the timestamp, which is fast but can be less precise. After -i, it decodes from the start and discards frames until the timestamp, which is slower but frame-accurate. The builder lets you set both: Input seek goes before -i, Trim start/end go after inputs.

How do I keep quality when converting?

Use a modern codec (libx264 or libx265), a moderate CRF such as 18–23, a slow-enough preset like medium or slow, and -pix_fmt yuv420p for compatibility. Avoid double transcoding by keeping an intermediate if you can, and use -movflags +faststart for web MP4 so playback can begin before the whole file downloads.

Does this run ffmpeg in my browser?

No. The tool assembles command text from your form choices; no media is read, uploaded or processed. Copy the one-liner (or the multi-line version with shell continuations) and run it in your own terminal. Generating the command never touches your files, and no -y is added unless you explicitly enable overwrite.

References & standards