Media Utility

FFmpeg Command Generator

Configure high-performance media tasks visually. Scale, compress, or convert video and audio with zero syntax errors.

Video Parameters

ffmpeg -i input.mp4 output.mp4

Understanding CRF

Constant Rate Factor (CRF) is the standard for x264/x265 encoding. The range is 0 to 51. Lower is better quality.

  • 18-20: Visually lossless.
  • 23: Default (Standard).
  • 28: Noticeable quality drop, but very small file size.

Why use "Stream Copy"?

Setting the codec to Copy is like a file transfer. It doesn't re-calculate any pixels; it just moves the video data into a new container (e.g., MKV to MP4). It is nearly instantaneous and results in zero quality loss. Use this whenever you don't need to change the resolution or quality.

Professional Tip

When trimming, placing the -ss (start time) flag before the -i (input) flag tells FFmpeg to use "Fast Seek." This jumps to the timestamp without decoding the whole video first, saving massive amounts of CPU time on large files.

Reference Note

FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge.

Building FFmpeg commands without memorising flags

FFmpeg can do almost anything to a media file, which is precisely why its command line is intimidating. There are hundreds of flags, the argument order is significant, and a small mistake can silently re-encode a file you meant to copy. This generator assembles the correct command from choices rather than recall.

Concepts that explain most commands

Container versus codec. MP4 and MKV are containers, which hold streams. H.264 and AAC are codecs, which describe how those streams are compressed. Changing the container is often instant; changing the codec means re-encoding.

Copy versus re-encode. Adding -c copy repackages streams without touching them, which is near-instantaneous and lossless. Any change to resolution, bitrate or codec forces a real re-encode and costs processing time and quality.

CRF. The Constant Rate Factor controls quality for H.264 and H.265. Lower means better and larger; 18 is close to visually lossless, 23 is the default, and 28 is noticeably compressed. Adjusting CRF is almost always a better approach than targeting a fixed bitrate.

Practical advice

Argument order matters more than newcomers expect. Options before -i apply to the input, options after it apply to the output. Putting an output option in the input position is a classic source of confusion.

Test on a short segment before committing to a long job. Adding -t 30 processes only the first thirty seconds, letting you confirm the settings in a moment rather than discovering a problem after an hour of encoding.

For web delivery, add -movflags +faststart to MP4 output. It relocates the file index to the beginning so playback can start before the whole file has downloaded.

Preset trades time for size

The -preset flag ranges from ultrafast to veryslow. Slower presets produce smaller files at identical quality.

Check your audio

Re-encoding video while copying audio with -c:a copy saves time and avoids a needless quality loss.

Never overwrite the source

Always write to a new filename. FFmpeg will happily destroy your only copy if you point output at input.

Frequently asked questions

What CRF value should I use?

Start at 23 for general use. Drop to 18 for archival quality, or raise to 28 when file size matters more than fine detail.

Why is my conversion so slow?

You are re-encoding rather than copying streams. If you only need a different container, -c copy finishes in seconds.

How do I convert without losing quality?

Use -c copy where possible, since it repackages without decoding. Any codec change involves generational loss, though a low CRF keeps it imperceptible.

What does faststart actually do?

It moves the MP4 metadata index to the start of the file so a browser can begin playback before the download completes.