AI Tools Free

FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale)

Construct production-ready, shell-escaped `ffmpeg` commands for H.264 (`libx264`), H.265 (`libx265`), and AV1 (`libsvtav1`) transcoding, even-dimension scaling (`scale=-2:1080`), EBU R128 loudness normalization, and `-movflags +faststart` web streaming.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Generate FFmpeg Command.

Source video or audio file path (automatically quoted for POSIX/PowerShell safety).

Target output filename (extension should match your chosen container/codec).

Choose libx264 for universal browser/mobile playback or copy for zero-loss container remuxing.

Lower CRF means higher visual quality and larger file size (18-23 for H.264; 24-28 for H.265/AV1).

Uses -2 width so FFmpeg automatically rounds the aspect-ratio width to an even integer required by yuv420p.

Select AAC for MP4 compatibility, EBU R128 loudnorm for podcasts/YouTube, or -an for silent loops.

Optional: enter '00:00:05, 00:01:30' (or leave blank for full duration). Places -ss before -i for fast keyframe seeking.

Your result
Enter your details

Result will appear here

How the FFmpeg Command Builder Prevents Common CLI Errors

Hand-written FFmpeg commands often fail in production due to odd scaling dimensions, missing QuickTime pixel formats, incompatible stream-copy filters, or unquoted spaces in filenames.

ffmpeg -hide_banner [-ss START -to END] -i 'INPUT' [-c:v CODEC -preset medium -crf CRF -pix_fmt yuv420p] [-vf 'scale=-2:H'] [-c:a ACODEC] [-movflags +faststart] 'OUTPUT'

Need to batch-discover media files or transfer finished renders over SSH? Pair this tool with our Find Command Generator (/tools/find-command-generator) and Rsync Command Generator (/tools/rsync-command-generator).

FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale) workflow overview
Workflow overview for FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale).

FFmpeg Codec, CRF Quality & Filter Flags Reference Table

Essential FFmpeg flags, recommended CRF ranges, and compatibility guardrails included automatically by this generator.

Task / Codec LayerFFmpeg Flag PatternRecommended Production SettingWhy It Matters
Universal Web MP4 (H.264)`-c:v libx264 -crf 23 -pix_fmt yuv420p``CRF 18–23`, `-preset medium``yuv420p` prevents black screens in QuickTime/Safari
Apple / Modern HEVC (H.265)`-c:v libx265 -crf 26 -tag:v hvc1``CRF 24–28`, `-tag:v hvc1`Apple requires `hvc1` fourcc tag (rejects default `hev1`)
Aspect-Safe Scaling`-vf "scale=-2:1080"``-2` width auto-calculationGuarantees width is divisible by 2 for 4:2:0 chroma
Web Streaming Start`-movflags +faststart`Always enable on `.mp4` / `.mov`Relocates `moov` atom to byte 0 for instant `<video>` seek
Podcast / Video Loudness`-af "loudnorm=I=-16:TP=-1.5:LRA=11"``-16 LUFS` stereo targetMatches YouTube, Spotify, and Apple Podcasts loudness

How to Build an FFmpeg Command in 3 Steps

Configure your input/output paths, codec quality, and filters in seconds.

Enter your input and output filenames

Type your source path (e.g. 'input.mov') and target path (e.g. 'output.mp4'). Paths with spaces or special characters are POSIX-quoted automatically.

FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale) step 1: Enter your input and output filenames
Step 1 workflow overview for FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale).

Select your video codec, CRF quality, and resolution scale filter

Pick H.264 (libx264), H.265 (libx265 with -tag:v hvc1), AV1 (libsvtav1), or lossless stream copy (-c:v copy), and adjust CRF between 0 and 51.

FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale) step 2: Select your video codec, CRF quality, and resolution scale filter
Step 2 workflow overview for FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale).

Choose audio processing and optional trim timestamps, then copy

Add optional EBU R128 audio normalization or start/end trim timestamps, then copy the single-line or multi-line command.

FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale) step 3: Choose audio processing and optional trim timestamps, then copy
Step 3 workflow overview for FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale).

Worked FFmpeg Command Examples

Compare three real-world media workflows generated by this tool.

Baseline example

Free interactive FFmpeg command generator. Build shell-escaped ffmpeg commands for H.264, H.265/HEVC, AV1, VP9, CRF compression, resolution scaling, trimming, and audio normalization.

FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale) example 1: Baseline example
Worked example 1 for FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale).

Comparison scenario

ffmpeg -hide_banner [-ss START -to END] -i 'INPUT' [-c:v CODEC -preset medium -crf CRF -pix_fmt yuv420p] [-vf 'scale=-2:H'] [-c:a ACODEC] [-movflags +faststart] 'OUTPUT'

FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale) example 2: Comparison scenario
Worked example 2 for FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale).

Boundary check before exporting

Need to batch-discover media files or transfer finished renders over SSH? Pair this tool with our Find Command Generator (/tools/find-command-generator) and Rsync Command Generator (/tools/rsync-command-generator).

FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale) example 3: Boundary check before exporting
Worked example 3 for FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale).

How to Choose Between CRF Values, Codecs, and Presets

Balance encoding speed, browser compatibility, and storage bandwidth.

For H.264 (`libx264`), `CRF 23` is the standard balance; lower it to `CRF 18` for archival master quality or raise it to `CRF 26–28` for mobile messaging previews.

When using H.265 (`libx265`) or AV1 (`libsvtav1`), you can use a numerically higher CRF (`26` to `30`) to achieve the same perceptual sharpness as H.264 at `CRF 23` with 35% to 50% smaller files.

How to interpret FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale) results
Result interpretation guide for FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale).

Safety Guardrails & Related Developer CLI Tools

Review these shell and container constraints before running batch scripts.

1. Never Overwrite In-Place: FFmpeg cannot read from and write to the exact same file path simultaneously; always specify a distinct output filename.

2. Container Compatibility: WebM outputs require VP9 (`libvpx-vp9`) or AV1 (`libsvtav1`) video and Opus/Vorbis audio; MP4 supports H.264, H.265, and AV1 with AAC or MP3 audio.

Scope limits and assumptions for FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale)
Assumptions and input boundaries for FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale).

Frequently Asked Questions About FFmpeg Commands

Answers about using FFmpeg Command Generator (H.264, H.265, AV1, Trim & Scale) and understanding its results.

Why does the generator use 'scale=-2:1080' instead of 'scale=-1:1080'?

Chroma-subsampled 4:2:0 codecs (H.264, H.265, AV1 with yuv420p) require both width and height to be divisible by 2. Using -1 can produce an odd width (e.g., 1919 px) and crash the encoder with 'width not divisible by 2', whereas -2 tells FFmpeg to preserve aspect ratio and round to the nearest even integer.

What does '-movflags +faststart' do on MP4 files?

By default, FFmpeg writes the MP4 'moov' atom (the index table of frames and timestamps) at the very end of the file after encoding finishes. Adding '-movflags +faststart' performs a quick second pass that moves the moov atom to the front of the file so web browsers can start streaming playback before the full file downloads.

How much does file size change per 6 units of CRF?

In x264 and x265, Constant Rate Factor (CRF) is logarithmic: decreasing CRF by 6 (for example, from 23 to 17) roughly doubles the output bitrate and file size, while increasing CRF by 6 (from 23 to 29) roughly halves the file size.

Can I use '-vf scale' together with '-c:v copy'?

No. Video filters (-vf scale, crop, fps) require decoding and re-encoding uncompressed frames, so they are incompatible with stream copying (-c:v copy). If you select '-c:v copy', this generator automatically omits '-vf' and '-crf' so your remux succeeds.

Try your own values

Choose another tool for your next calculation, conversion, or text task.

Generate FFmpeg Command