FFmpeg & Automation Runs Locally in Your Browser

Visual FFmpeg Command Builder & Browser Runner

Assemble copy-ready FFmpeg CLI commands for trimming, codec conversion, CRF rate control, audio muxing, and looping, or run the command directly in your browser via FFmpeg.wasm CDN.

Interactive Workspace: Command & WASM Runner 100% Local Browser Processing (Zero Server Upload)
Valid FFmpeg pipeline ready.
In-Browser Execution (FFmpeg.wasm CDN)

Optional: load a sample video file from disk and run the generated FFmpeg command right inside your browser via jsDelivr CDN (@ffmpeg/ffmpeg 0.12).

Idle: select a local file above if you want to run this FFmpeg command in browser memory.

Methodology, Formulas & Parameter Reference

FFmpeg processes media through a pipeline that demuxes an input container into encoded packets, decodes those packets into uncompressed frames when filtering or re-encoding is required, passes frames through a filtergraph, encodes the resulting frames with the chosen codec, and muxes packets into the target container. Selecting -c:v copy bypasses the decode, filter, and encode stages entirely, copying compressed video packets directly to the output container at disk speed. However, whenever you apply a visual filter such as scaling, cropping, or frame-rate conversion, FFmpeg must decode and re-encode the video stream.

When re-encoding with libx264 or libx265, the Constant Rate Factor (-crf) parameter controls visual quality on a logarithmic scale from 0 (lossless) to 51 (heaviest compression). Each decrease of 6 in the CRF value roughly doubles the resulting bitrate, while each increase of 6 cuts the bitrate in half. For 8-bit web delivery, combining -crf 18 to -crf 23 with -pix_fmt yuv420p ensures hardware decoder compatibility across desktop and mobile browsers. Adding -movflags +faststart relocates the MP4 moov atom to the beginning of the file after muxing so web players can begin playback before downloading the entire file.

For frame-accurate trimming, placing -ss before -i instructs the demuxer to seek to the nearest preceding keyframe (IDR frame), which is fast when combined with re-encoding because modern FFmpeg versions automatically discard decoded frames prior to the exact target timestamp. When paired with -c copy, input seeking cuts only on keyframes; if you need exact frame cuts without re-encoding, that is not possible in inter-frame codecs without re-encoding at least the GOP surrounding the cut point. The in-browser runner loads @ffmpeg/ffmpeg from jsDelivr CDN on demand and executes the same flags inside a WebAssembly virtual filesystem so no media leaves your machine.

Core FFmpeg Video & Container Flags Reference
Parameter Flag Stream Scope Typical Value Engineering Function
-c:v libx264 Video Encoder H.264 / AVC Encodes video using the x264 software encoder for universal playback compatibility.
-crf 18..28 Rate Control 20 (x264) / 24 (x265) Allocates variable bitrate dynamically to maintain constant perceptual quality.
-preset slow Encoder Speed ultrafast to veryslow Trades CPU encoding time for better motion-estimation compression efficiency.
-pix_fmt yuv420p Pixel Format 4:2:0 Planar 8-bit Downsamples chroma from 4:2:2 or 4:4:4 sources so standard web players can decode.
-movflags +faststart MP4 Muxer Header relocation Moves the MP4 index (moov atom) to byte offset 0 for progressive HTTP streaming.
-stream_loop N Input Demuxer Integer count (e.g. 3) Repeats the input stream N additional times without concatenating duplicate files.

Production Workflow Verification & Quality Control

Before committing a full batch transcode or publishing a final master, verify the generated parameters against a five-second test slice of your source timeline. In post-production pipelines, container metadata headers, variable frame rate (VFR) timebases from mobile or screen-capture recordings, and non-square pixel aspect ratios can alter how downstream players interpret stream flags. Running every calculation and file conversion locally in browser memory ensures your production assets remain private while providing deterministic numbers you can paste directly into terminal automation scripts, NLE export presets, or camera prep checklists.

Frequently Asked Questions

Why does FFmpeg fail when I combine -c:v copy with a scaling or crop filter?

Video filters operate on uncompressed pixel frames. Because -c:v copy transfers already-compressed packets without decoding them, FFmpeg cannot modify pixel dimensions unless you choose an encoder such as libx264 or libx265.

What is the practical difference between the encoder preset and the CRF value?

CRF sets the target visual quality ceiling, whereas -preset controls how much CPU effort the encoder spends searching for motion vectors and redundancies. A slower preset at the same CRF produces a smaller file with identical visual fidelity.

How does the in-browser FFmpeg.wasm runner handle large video files?

FFmpeg.wasm stores the input and output files inside an in-memory WebAssembly filesystem (MEMFS) limited by browser tab RAM. Use the in-browser runner for clips under 150 MB, and copy the generated CLI command to run natively in your terminal for multi-gigabyte masters.