TechEarl

The ffmpeg Command Cheat Sheet

A scannable ffmpeg reference: stream-copy without re-encoding, trim and cut, resize, crop and cropdetect, black and white (grayscale and sepia), extract or remove audio, normalize loudness with loudnorm, high-quality GIFs with palettegen, WebM to MP4 and back, change speed with setpts and atempo, reverse a clip, concat, subtitles, and the fixes for the errors you actually hit.

Ishan KarunaratnePublished ⏱️ 34 min readUpdated
Share thisCopied
ffmpeg cheat sheet: -c copy remux, trim, crop and cropdetect, palettegen GIFs, WebM to MP4, reverse, loudnorm volume, x264/x265/AV1 -crf, speed, concat, fixes.

ffmpeg converts a file with ffmpeg -i in.mov out.mp4, remuxes without re-encoding with ffmpeg -i in.mkv -c copy out.mp4, cuts losslessly with ffmpeg -ss 00:00:05 -t 12 -i in.mp4 -c copy out.mp4, and resizes with -vf scale=1280:-2. -c copy means no re-encode; -crf is the quality knob for x264, x265, and AV1. Below the quick reference, this page walks through cropping, black and white conversion, extracting and removing audio, normalizing loudness, high-quality GIFs, WebM to MP4, changing speed, and reversing a clip in full.

ffmpeg Cheat Sheet

The canonical 2026 command for each common task. -c copy means no re-encode (instant, lossless); -crf is the quality knob for x264/x265/AV1.

Basics

ffprobe -hide_banner in.mp4Show streams, codecs, duration, and resolution of a file.
ffprobe -v error -show_entries format=duration -of csv=p=0 in.mp4Print just the duration in seconds, script-friendly.
ffmpeg -i in.mov out.mp4Convert container (re-encodes with sane defaults).
ffmpeg -i in.mkv -c copy out.mp4Remux MKV to MP4 with no re-encode: instant, lossless, if codecs are MP4-compatible.
ffmpeg -y -hide_banner -i in.mp4 out.mp4-y overwrites without prompting; -hide_banner trims the version preamble.

Trim & cut

ffmpeg -ss 00:00:05 -t 12 -i in.mp4 -c copy out.mp4Fast lossless cut: seek 5s in, take 12s, copy streams. Cuts land on keyframes.
ffmpeg -ss 00:00:05 -to 00:00:17 -i in.mp4 -c copy out.mp4Cut to an absolute end timestamp instead of a duration.
ffmpeg -i in.mp4 -ss 00:00:05 -t 12 -c:v libx264 -crf 18 out.mp4Frame-accurate cut: -ss after -i and a re-encode (slower, no keyframe rounding).

Resize & crop

ffmpeg -i in.mp4 -vf scale=1280:-2 out.mp4Scale to 1280px wide, height auto (-2 keeps it even, required by most codecs).
ffmpeg -i in.mp4 -vf scale=-2:720 out.mp4Scale to 720px tall, width auto.
ffmpeg -i in.mp4 -vf crop=500:500:0:0 -c:a copy out.mp4crop=w:h:x:y. Top-left 500x500 box; copy audio so it is untouched.
ffmpeg -i in.mp4 -vf crop=in_w:in_w*9/16 out.mp4Center-crop to 16:9 using input dimensions; omitting x:y auto-centers.
ffmpeg -i in.mp4 -vf "crop=in_h:in_h" -c:a copy out.mp4Centered square crop sized to the frame height, for 1:1 social posts.
ffmpeg -i in.mp4 -vf cropdetect -f null -Scan for black bars and print a suggested crop=... string without writing video.

Black & white

ffmpeg -i in.mp4 -vf hue=s=0 -c:a copy out.mp4Grayscale by zeroing saturation; keeps a standard color pixel format.
ffmpeg -i in.mp4 -vf format=gray -c:a copy out.mp4True single-channel gray pixel format, no chroma planes.
ffmpeg -i in.mp4 -vf colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131 -c:a copy out.mp4Sepia tone with the documented colorchannelmixer matrix.

Audio

ffmpeg -i in.mp4 -vn -c:a copy out.m4aExtract audio with no re-encode (works when the codec fits the container, e.g. AAC to .m4a).
ffmpeg -i in.mp4 -vn -c:a libmp3lame -q:a 2 out.mp3Extract and re-encode to MP3. -q:a 2 is VBR ~190 kbps, a better default than fixed CBR.
ffmpeg -ss 00:01:05 -t 30 -i in.mp4 -vn -c:a copy clip.m4aExtract just a 30-second segment of the audio, copied untouched.
ffmpeg -i in.mp4 -c:v copy -an out.mp4Remove audio: -an drops it, -c:v copy keeps video untouched. Instant.
ffmpeg -i in.mp4 -af "volume=enable='between(t,5,10)':volume=0" -c:v copy out.mp4Mute only seconds 5 to 10 and keep the rest of the audio.
ffmpeg -i in.mkv -map 0:v -map 0:a:0 -c copy out.mkvKeep the video and only the first audio track; drop the others.
ffmpeg -i video.mp4 -i audio.m4a -c:v copy -c:a copy -map 0:v:0 -map 1:a:0 -shortest out.mp4Replace/add an audio track by muxing; -shortest stops at the shorter input.
ffmpeg -i in.mp3 -af loudnorm=I=-16:TP=-1.5:LRA=11 -ar 44100 out.mp3Normalize loudness to -16 LUFS (EBU R128) in one pass; -ar avoids a 192 kHz output.
rsgain easy ~/MusicTag a whole library with ReplayGain 2.0 without touching the audio data.

Video to GIF

ffmpeg -i in.mp4 -vf "fps=15,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" out.gifHigh-quality GIF in one pass: build an optimal 256-color palette, then map frames to it.
ffmpeg -ss 2 -t 3 -i in.mp4 -vf "fps=15,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" clip.gifSame, but trim to a 3-second clip first (fast seek with -ss before -i).

Codecs & quality

ffmpeg -i in.mp4 -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 192k out.mp4H.264, the universal default. -crf 23 is the baseline; lower for better quality.
ffmpeg -i in.mp4 -c:v libx265 -crf 28 -preset medium -c:a aac -b:a 192k out.mp4HEVC/H.265: ~half the size of x264 at the same quality, slower to encode.
ffmpeg -i in.mp4 -c:v libsvtav1 -crf 30 -preset 6 -c:a libopus -b:a 128k out.mp4AV1 via SVT-AV1: best compression, free codec. -preset is numeric (lower = slower/smaller).
ffmpeg -i in.webm -c:v libx264 -crf 23 -preset medium -pix_fmt yuv420p -c:a aac -b:a 192k -movflags +faststart out.mp4WebM to MP4. Re-encode to H.264/AAC for playback everywhere (VP8 cannot be stream-copied into MP4 at all); yuv420p fixes the QuickTime black screen.
ffmpeg -i in.mp4 -c:v libvpx-vp9 -crf 31 -b:v 0 -c:a libopus -b:a 128k out.webmMP4 to WebM with VP9 + Opus. -b:v 0 is required for VP9 constant-quality mode.

Reverse

ffmpeg -i in.mp4 -vf reverse -af areverse out.mp4Play picture and sound backwards. Always write to a new file, never onto the input.
ffmpeg -i in.mp4 -vf reverse -an out.mp4Reverse the picture and drop the audio (loops, boomerang effects).

Speed

ffmpeg -i in.mp4 -filter:v "setpts=0.5*PTS" -an out.mp42x faster, video only. setpts scales timestamps: smaller multiplier = faster.
ffmpeg -i in.mp4 -filter:v "setpts=2.0*PTS" -an out.mp4Half speed (slow motion), video only.
ffmpeg -i in.mp4 -filter_complex "[0:v]setpts=PTS/4[v];[0:a]atempo=2.0,atempo=2.0[a]" -map "[v]" -map "[a]" out.mp44x with audio in sync: the video divides by 4, the atempo chain multiplies to 4.
ffmpeg -i in.mp4 -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" out.mp42x with audio in sync. atempo accepts 0.5 to 100.0, but above 2.0 it skips samples, so chain it (atempo=2.0,atempo=2.0) for clean 4x.

Concat & merge

ffmpeg -f concat -safe 0 -i list.txt -c copy out.mp4Join files with identical codecs, no re-encode. list.txt holds: file 'a.mp4' lines.
ffmpeg -i a.mp4 -i b.mp4 -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" out.mp4Join files with differing codecs; re-encodes via the concat filter. Scale differing resolutions to one size first.

Subtitles

ffmpeg -i in.mp4 -i subs.srt -c copy -c:s mov_text out.mp4Soft subtitles: a selectable track the player can toggle on or off.
ffmpeg -i in.mp4 -vf subtitles=subs.srt out.mp4Hard subtitles (burned in): re-encodes the video with text painted on every frame.

Common fixes

ffmpeg -i in.mp4 -c copy -movflags +faststart out.mp4Move the MP4 moov atom to the front so it streams/seeks before fully downloaded.
ffmpeg -i in.mp4 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" out.mp4Fix 'height not divisible by 2' encode errors by forcing even dimensions.
ffmpeg -i in.mp4 -vf "transpose=1" out.mp4Rotate 90 degrees clockwise (transpose=2 for counter-clockwise).

ffmpeg does almost anything to a media file from one command line: convert a container, cut a clip, resize, strip or swap the audio, build a GIF, re-encode at a target quality. The flag surface is enormous and the documentation is a wall, so this page is the reference I actually keep open: the canonical 2026 command for each common task, grouped by what you are trying to do, with a one-line "why" on each. Every command below uses the current spellings, not the legacy aliases that still float around old blog posts.

If the source file is online, the yt-dlp command reference covers fetching it (yt-dlp calls ffmpeg for the muxing); everything after the download is on this page.

The modern syntax in one minute

Old ffmpeg tutorials are full of -vcodec, -acodec, -ab, and -vframes. Those still work as aliases, but they are the legacy form and they make examples harder to read. The current spellings, and the few knobs that matter, are short enough to learn in a minute:

  • -c:v and -c:a set the codecs, not -vcodec / -acodec. So -c:v libx264 -c:a aac. Bitrate is -b:a 192k (audio) or -b:v 2M (video), and -frames:v 1 grabs a single frame, not -vframes 1.
  • -c copy is stream copy: remux with no re-encode. It is instant and lossless because the audio and video bytes are passed through untouched. Reach for it any time you are only changing the container or cutting on keyframes. The opposite is a re-encode, which is slow but lets you change codec, quality, resolution, or do frame-accurate cuts.
  • -crf is the quality knob for libx264 and libx265 (constant rate factor: lower is better quality and a bigger file). For x264 the sane range is 18 to 28, default 23; x265 defaults to 28; the AV1 encoder libsvtav1 uses a wider 0 to 63 scale (its own default is 35, but a CRF around 30 is a common starting point). -preset trades encode speed for compression efficiency (ultrafast to veryslow on x264/x265; a numeric -preset 6 style on SVT-AV1): a slower preset gives a smaller file at the same quality, not better quality.
  • -y overwrites the output without asking, -n never overwrites. -hide_banner drops the version preamble so the useful output is not buried. Put input options like -ss before -i, and output options after the last -i. That ordering is not cosmetic: ffmpeg applies options to the next file on the command line, so where they sit changes what they do.

That is the whole mental model. The cheat sheet below is those rules applied to each task.

Jump to: Basics | Trim and cut | Resize | Crop a video | Black and white | Audio | Extract audio | Remove audio | Normalize audio volume | Video to GIF | Codecs and quality | WebM to MP4 | Speed | Reverse a video | Concat and merge | Subtitles | Common fixes

The rest of this page is the detail behind the rows: the gotchas that turn a command that "runs" into one that does what you meant.

Basics

Before transforming a file, look at it. ffprobe reports the streams, codecs, resolution, and duration:

bash
ffprobe -hide_banner in.mp4

That tells you whether -c copy is even an option (you cannot stream-copy a codec the target container does not support) and what the audio and video tracks actually are. For a single value in a script, ask for one field:

bash
ffprobe -v error -show_entries format=duration -of csv=p=0 in.mp4

A plain container change re-encodes by default. If the existing codecs already fit the target container, skip the re-encode entirely with -c copy. Remuxing an MKV to MP4 this way takes a second and loses nothing:

bash
ffmpeg -i in.mkv -c copy out.mp4

Trim and cut

There are two ways to cut, and the difference is the single most common ffmpeg confusion. With -ss before -i and -c copy, the cut is fast and lossless but lands on the nearest keyframe, so the start can be a fraction of a second early or late:

bash
ffmpeg -ss 00:00:05 -t 12 -i in.mp4 -c copy out.mp4

Use -t for a duration or -to for an absolute end timestamp. When you need a frame-accurate cut, drop -c copy, move -ss after -i, and let ffmpeg re-encode:

bash
ffmpeg -i in.mp4 -ss 00:00:05 -t 12 -c:v libx264 -crf 18 out.mp4

It is slower, but the cut lands exactly where you asked. For the full treatment of keyframe alignment and splitting one file into segments, see trim and cut a video with ffmpeg.

Resize and crop

Scaling takes a scale filter. Set one dimension and use -2 for the other so ffmpeg keeps the aspect ratio and rounds to an even number (most codecs reject odd dimensions):

bash
ffmpeg -i in.mp4 -vf scale=1280:-2 out.mp4

Cropping is the other half of reframing, and it has enough gotchas to get its own section next.

Crop a video

To crop a video with ffmpeg, run the crop filter and give it the output size plus where the box sits:

bash
ffmpeg -i in.mp4 -vf "crop=w:h:x:y" -c:a copy out.mp4

crop=w:h:x:y reads as width:height:x-offset:y-offset. The origin (0,0) is the top-left corner of the frame, x grows to the right and y grows downward. So a 500x500 crop anchored at the top-left of a 1920x1080 clip is:

bash
ffmpeg -i in.mp4 -vf "crop=500:500:0:0" -c:a copy out.mp4

I add -c:a copy on every crop. Crop is a video filter, and without it ffmpeg re-encodes the audio for no reason.

Center the crop and crop relative to the input

Give crop only a width and height and omit x:y, and ffmpeg centers the box (internally x = (in_w - out_w) / 2, y = (in_h - out_h) / 2):

bash
# 1280x720 cut from the middle of the frame
ffmpeg -i in.mp4 -vf "crop=1280:720" -c:a copy out.mp4

Hardcoded pixels mean redoing the math for every source resolution. The filter exposes the input size as in_w and in_h (aliases iw/ih), so write the crop relative to the frame instead. This shaves 100px off each side at any resolution, and crop=in_w:in_h-200 does the same to top and bottom:

bash
ffmpeg -i in.mp4 -vf "crop=in_w-200:in_h" -c:a copy out.mp4

For a 1:1 square (Instagram and most social embeds), crop to the height, the shorter side on a landscape clip, and let ffmpeg center it:

bash
ffmpeg -i in.mp4 -vf "crop=in_h:in_h" -c:a copy out.mp4

If you need a specific off-center area, note the pixel coordinates of its top-left corner in a player and feed them as x:y. ffmpeg has no preview, so I crop once, eyeball the result, and nudge x/y by a few dozen pixels until it lands.

Strip black bars with cropdetect

For letterbox or pillarbox bars, let cropdetect measure them. It is a metadata filter: it writes no video, it just prints a suggested crop=... string to the log:

bash
ffmpeg -i in.mp4 -vf cropdetect -f null -

Let it run over a chunk of the video until the value settles (something like crop=1920:800:0:140), then paste that into a real crop pass. The default threshold handles standard black letterboxing; loosen it only when the bars are not pure black.

Cropping always re-encodes

You cannot pair a crop with -c:v copy. Stream copy passes compressed frames through without decoding, and a crop has to decode, change the pixels, and encode again. So set the quality yourself, and chain scale after crop with a comma when you also need a fixed output size, so ffmpeg decodes once:

bash
ffmpeg -i in.mp4 -vf "crop=1280:720" -c:v libx264 -crf 18 -preset medium -c:a copy out.mp4

# Crop a centered square, then downscale it to 1080x1080
ffmpeg -i in.mp4 -vf "crop=in_h:in_h,scale=1080:1080" -c:v libx264 -crf 18 -c:a copy out.mp4

-crf 18 is visually near-lossless for libx264. Crop first to pick the region, then scale; one chain avoids the second generation-loss encode you get from cropping to a file and scaling that file. This is the difference from a trim with -c copy, which can be instant because it cuts on keyframes without decoding.

Convert a video to black and white

The fastest way to convert a video to grayscale with ffmpeg is to zero the saturation with the hue filter, copying the audio through untouched:

bash
ffmpeg -i in.mp4 -vf hue=s=0 -c:a copy out.mp4

There are two kinds of "grayscale" here, and they look the same on screen but differ on disk:

  • hue=s=0 desaturates within a color format. The file keeps its original YUV pixel format; the chroma planes stay, they just carry no color. Pick it when a later filter, an editor, or a player expects a normal color video.
  • format=gray is a true single-channel gray file. It converts the pixel format itself, so there are no chroma planes at all, just luma, and the encoded file is often a little smaller.
bash
ffmpeg -i in.mp4 -vf format=gray -c:a copy out.mp4

Not every encoder and container combination accepts a gray pixel format. If ffmpeg errors on the pixel format, fall back to hue=s=0, or chain a standard format after the conversion: -vf format=gray,format=yuv420p.

A custom mix or sepia with colorchannelmixer

colorchannelmixer is a matrix of how much red, green, and blue feed each output channel. The neutral gray from the official docs gives every output channel the same blend; bias the weights to decide how bright reds or greens land, which changes how skin tones and foliage read:

bash
ffmpeg -i in.mp4 -vf colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3 -c:a copy out.mp4

For sepia, the documented matrix uses different rows so the image warms toward brown instead of staying neutral:

bash
ffmpeg -i in.mp4 -vf colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131 -c:a copy out.mp4

Grayscale always re-encodes the video

Like a crop, every one of these is a video filter, so the video is decoded and re-encoded and you cannot pair -vf with -c:v copy (ffmpeg rejects a filtergraph combined with codec copy). The audio is untouched by the filter, so keep -c:a copy; without it ffmpeg re-encodes the soundtrack for no reason. Set the video quality yourself while you are at it:

bash
ffmpeg -i in.mp4 -vf hue=s=0 -c:v libx264 -crf 20 -preset medium -c:a copy out.mp4

If the video is only for the web and only needs to look gray in one place, the CSS filter: grayscale(1) desaturates a <video> element at display time and leaves the source in full color. For stills, see convert an image to grayscale from the command line.

Audio

The audio jobs are extracting the sound, removing it, and replacing it. To replace or add a track, give ffmpeg two inputs and map explicitly so it does not guess. -shortest stops at the shorter of the two so you do not get a long silent tail:

bash
ffmpeg -i video.mp4 -i audio.m4a -c:v copy -c:a copy -map 0:v:0 -map 1:a:0 -shortest out.mp4

Extract audio from a video

-vn drops the video stream. The single decision that matters is whether to copy the audio stream untouched or re-encode it. If the audio codec already fits the target container, copy it out with no quality loss; it finishes in the time it takes to read the file:

bash
ffmpeg -i in.mp4 -vn -c:a copy out.m4a

The output container has to support the codec you copy. Check the source codec first with ffprobe, which lists every audio stream with its codec, channel count, and sample rate:

bash
ffprobe -v error -select_streams a -show_entries stream=index,codec_name,channels,sample_rate -of default=noprint_wrappers=1 input.mp4

Then match the extension to codec_name:

  • AAC (a typical MP4) copies cleanly to .m4a or .aac.
  • Opus (common in WebM) copies to .opus, .ogg, or .mka.
  • MP3 copies straight to .mp3.
  • AC-3 / E-AC-3 (movie soundtracks) copies to .ac3 or .eac3.

Copy AAC into a .mp3 and ffmpeg refuses with an error like Could not find tag for codec ... in stream, because MP3 files only hold MPEG audio. When you need a format the source is not in, re-encode. -q:a 2 is libmp3lame variable bitrate around 190 kbps on a 0 (best) to 9 (worst) scale, a better default than a fixed CBR rate:

bash
# MP3, VBR (recommended)
ffmpeg -i in.mp4 -vn -c:a libmp3lame -q:a 2 out.mp3

# MP3, CBR, only if a device needs a constant bitrate
ffmpeg -i in.mp4 -vn -c:a libmp3lame -b:a 192k out.mp3

# AAC from a non-AAC source
ffmpeg -i input.mkv -vn -c:a aac -b:a 192k output.m4a

# Uncompressed WAV for an editor (large)
ffmpeg -i input.mp4 -vn -c:a pcm_s16le output.wav

Re-encoding a lossy source (AAC to MP3, say) decodes and re-compresses, so quality drops a little even at high settings. Only re-encode when you genuinely need the other format. MP3 is the universal-compatibility choice; AAC and Opus are better quality per kilobyte; WAV is for editing, not distribution.

To take only part of the soundtrack, seek with -ss before -i and set -t (duration) or -to (absolute end). With -c:a copy the cut lands on a packet boundary, so the start may be a fraction off; re-encode for a tight cut:

bash
# 30 seconds starting at 1:05, copied untouched
ffmpeg -ss 00:01:05 -t 30 -i input.mp4 -vn -c:a copy clip.m4a

# Same window, re-encoded to MP3
ffmpeg -ss 00:01:05 -to 00:01:35 -i input.mp4 -vn -c:a libmp3lame -q:a 2 clip.mp3

A file with several audio streams (a director's commentary, a second language) numbers them from zero, and -map picks one. 0:a:1 reads as "input 0, audio stream index 1". Without -map, ffmpeg does not simply take the first track: its automatic selection picks the audio stream with the most channels, and only breaks a tie by taking the lowest index. A 5.1 commentary track can win over a stereo main mix that way, so whenever the track matters, name it with -map 0:a:N:

bash
ffmpeg -i input.mkv -map 0:a:1 -c:a copy commentary.m4a

If ffmpeg reports Output file does not contain any stream, the video is silent and ffprobe will show zero audio streams. -vn never touches the source file; it only leaves the video out of the new output. If the source is a YouTube URL, download the audio directly with yt-dlp instead of downloading the video and extracting.

Remove audio from a video

To mute a video, drop every audio stream with -an ("no audio") and copy the video through byte for byte with -c:v copy, so it is instant and the picture is identical to the source:

bash
ffmpeg -i in.mp4 -an -c:v copy out.mp4

ffmpeg -i in.mp4 -c copy -an out.mp4 is the same thing. Leave -c:v copy off and ffmpeg re-encodes the video to its default codec, which is slower and slightly lossy for no gain. Stream copy only works when the output container accepts the source video codec, which never comes up when you keep the same format.

Removing the track and silencing it produce different files. -an leaves no audio stream at all, which is what you want for a background loop or a GIF-style clip. If a downstream tool insists on an audio stream being present, keep the track but make it silent:

bash
ffmpeg -i in.mp4 -af "volume=0" -c:v copy out.mp4

To silence only a section, give the volume filter an enable window. t is the timestamp in seconds; this mutes seconds 5 to 10 and plays the rest normally. Add windows with +, for example enable='between(t,5,10)+between(t,30,35)':

bash
ffmpeg -i in.mp4 -af "volume=enable='between(t,5,10)':volume=0" -c:v copy out.mp4

Any -af filter re-encodes the audio stream; the video still copies through. To drop only one of several audio tracks, do not use -an (it removes them all). Inspect the streams with ffmpeg -i in.mkv, then -map the ones to keep; anything not mapped is left out:

bash
# Keep the video and only the first audio track
ffmpeg -i in.mkv -map 0:v -map 0:a:0 -c copy out.mkv

If the extracted or replaced track comes out too quiet or uneven across files, the next section covers normalizing it.

Normalize audio volume

The modern way to normalize audio volume from the command line is loudness normalization (EBU R128, measured in LUFS), not peak normalization. For one file, ffmpeg's built-in loudnorm filter does it. For a whole music library, rsgain writes ReplayGain tags that players honor without touching the audio.

bash
# Normalize one file to -16 LUFS (one pass)
ffmpeg -i in.mp3 -af loudnorm=I=-16:TP=-1.5:LRA=11 out.mp3

# Tag a whole library with ReplayGain (non-destructive, recursive)
rsgain easy ~/Music

Why loudness, not peak

Peak normalization scales a file so its loudest sample hits a ceiling. A quiet, even track and a punchy, compressed track can share the same peak and sound nothing alike, because one loud transient pins the peak while the rest stays quiet. Loudness normalization measures perceived loudness over the whole file (EBU R128 / ITU BS.1770) and adjusts to a target, so two files at the same LUFS sound equally loud. Streaming platforms switched to this model years ago.

loudnorm: one pass and the accurate two pass

In loudnorm=I=-16:TP=-1.5:LRA=11, I is the target integrated loudness in LUFS, TP the maximum true peak in dBTP (-1.5 leaves headroom so lossy re-encoding does not clip), and LRA the loudness range (the filter's default is 7; 11 is the looser value from the loudnorm author's example). One gotcha: loudnorm upsamples to 192 kHz internally to measure true peaks, and that rate carries into the output unless you add -ar 44100 or -ar 48000.

One pass is fast but can land a little off the I you asked for on dynamic material. For accuracy, measure first:

bash
ffmpeg -i in.mp3 -af loudnorm=I=-16:TP=-1.5:LRA=11:print_format=json -f null -

That prints input_i, input_tp, input_lra, input_thresh, and target_offset. Feed the four input_* values back as measured_*, pass target_offset as offset, and set linear=true (the numbers below are an example; use your own):

bash
ffmpeg -i in.mp3 -af loudnorm=I=-16:TP=-1.5:LRA=11:measured_I=-19.3:measured_TP=-5.2:measured_LRA=6.4:measured_thresh=-29.8:offset=0.5:linear=true:print_format=summary out.mp3

When linear mode can run, ffmpeg applies one fixed gain that hits the target instead of landing near it. It only runs when two conditions hold: the measured loudness range is no wider than your LRA target, and the measured true peak plus the gain you need stays at or under TP. In this example the gain is 3.3 dB (from -19.3 to -16), and -5.2 + 3.3 = -1.9 dBTP, which clears the -1.5 ceiling. If your file measured a true peak of -3.1, the same gain would push it to +0.2 dBTP, so loudnorm silently falls back to its dynamic mode. Check the Normalization Type line in the summary (or normalization_type in the JSON) to see which one you got; if it says Dynamic and you need a pure gain change, lower the I target or raise TP. The Python wrapper ffmpeg-normalize automates this two-pass flow over one file or a batch.

rsgain for a library (mp3gain is dead)

For a music collection you usually do not want to rewrite every file. rsgain easy scans a directory recursively and stores track gain and album gain as ReplayGain tags; any ReplayGain-aware player (foobar2000, VLC, mpv, Rhythmbox, Kodi) adjusts playback on the fly. Album mode keeps the quiet intro and loud chorus of a record in their intended relationship. It handles MP3, FLAC, Opus, Ogg, M4A/MP4, WAV and more. Older guides reach for mp3gain -r *.mp3, but mp3gain is unmaintained, MP3-only, and built on ReplayGain 1.0; rsgain is its successor, using ReplayGain 2.0 with the same LUFS measurement as loudnorm.

Which LUFS target

TargetLUFSUse it for
General / podcasts-16Apple Podcasts' recommendation; a safe all-round default
Music streaming-14Spotify and YouTube normalize playback to about -14 LUFS
EBU R128 broadcast-23TV and radio delivery specs

For one master that plays "everywhere," -14 LUFS with a true peak around -1 dBTP suits Spotify and YouTube. rsgain uses the ReplayGain 2.0 reference of -18 LUFS by default, which you do not normally override. Keep the roles clear: loudnorm rewrites the audio to a fixed level (a podcast episode, a video soundtrack), rsgain tags files and lets the player adjust.

Convert a video to GIF

The high-quality way to turn a video into a GIF with ffmpeg is a two-pass palette: build an optimal 256-color palette from the clip, then encode the GIF against it.

bash
# Pass 1: build a palette tuned to this specific clip
ffmpeg -i in.mp4 -vf "fps=15,scale=480:-1:flags=lanczos,palettegen" palette.png

# Pass 2: encode the GIF using that palette
ffmpeg -i in.mp4 -i palette.png -lavfi "fps=15,scale=480:-1:flags=lanczos[x];[x][1:v]paletteuse" out.gif

A bare ffmpeg -i in.mp4 out.gif works, but GIF is palette-indexed and capped at 256 colors per frame, and with no palette ffmpeg falls back to a generic fixed one. It spends its slots on colors your clip never uses, so gradients band into stripes and the dithering noise bloats the file. Adding -b 2048k does nothing useful: GIF is indexed color plus LZW, not a bitrate-controlled codec. The palette is the lever.

In pass two, the source runs through fps and scale and is labelled [x], then [x] and [1:v] (the palette, the second input) feed paletteuse. Keep fps and scale identical in both passes, or the palette describes a different image than the one you encode. To skip the temp palette.png, split forks the stream inside one command:

bash
ffmpeg -i in.mp4 -vf "fps=15,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" out.gif

The two-file version is easier to debug and lets you reuse one palette across several clips.

Trim, fps and scale: the size levers

Trim first, with -ss before -i so ffmpeg seeks fast. A 3-second GIF is a tenth the size of a 30-second one:

bash
ffmpeg -ss 00:00:02 -t 3 -i in.mp4 -vf "fps=15,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" clip.gif

Frame rate is next: every GIF frame is its own LZW-compressed image (often just the rectangle that changed since the previous frame), so going from 30 to 15 fps halves the number of frames to encode and usually cuts the file by close to half. Use 20 to 24 fps for fast motion and 10 to 12 for a slow UI walkthrough. scale=480:-1 sets the width and computes the height to keep the aspect ratio (use -2 if a downstream tool wants even dimensions), and flags=lanczos gives a noticeably sharper downscale than the default bilinear.

Squeeze it smaller

palettegen=max_colors=128 (or 64) shrinks the palette; flat UI captures survive it, photographic footage bands sooner. paletteuse=dither=bayer:bayer_scale=5 uses ordered dithering, which compresses far better than the default error diffusion (sierra2_4a), and dither=none is smallest of all for flat-color screen recordings:

bash
ffmpeg -i in.mp4 -i palette.png -lavfi "fps=15,scale=480:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=5" out.gif

If it is still huge, GIF is the wrong format: a short MP4 or WebM is a fraction of the size and plays inline everywhere. When you must ship a .gif, optimize and compress it with gifsicle (--lossy, --colors), and converting it to WebP is usually a bigger win than any GIF tweak.

Codecs and quality

For H.264, the universal default, the quality knob is -crf (lower is better, 23 is the baseline) and -preset trades encode time for a smaller file at the same quality:

bash
ffmpeg -i in.mp4 -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 192k out.mp4

libx265 (HEVC) gets you roughly half the file size at the same visual quality, at the cost of slower encoding and patchier playback support; its CRF scale runs a little different (default 28):

bash
ffmpeg -i in.mp4 -c:v libx265 -crf 28 -preset medium -c:a aac -b:a 192k out.mp4

AV1 through libsvtav1 compresses best of the three and is royalty-free. Its -crf runs 0 to 63 (the encoder's own default is 35; a CRF around 30 is a common starting point for 1080p) and -preset is numeric from 0 to 13, where a lower number is slower and smaller:

bash
ffmpeg -i in.mp4 -c:v libsvtav1 -crf 30 -preset 6 -c:a libopus -b:a 128k out.mp4

Note -c copy cannot bridge codecs a container does not accept, so converting between MP4 and WebM usually means a re-encode, as the next section shows.

Convert WebM to MP4

To convert WebM to MP4 with ffmpeg for broad playback, re-encode: WebM holds VP8 or VP9 video and Vorbis or Opus audio, and the MP4 every player opens is H.264 plus AAC.

bash
ffmpeg -i in.webm -c:v libx264 -crf 23 -preset medium -pix_fmt yuv420p -c:a aac -b:a 192k -movflags +faststart out.mp4

The fast path, ffmpeg -i in.webm -c copy out.mp4, depends on what is inside. Stream copy only lifts existing streams into a new container. A VP8 WebM fails outright: ffmpeg's MP4 muxer has no tag for VP8 and stops with "Could not find tag for codec vp8". A VP9 plus Opus WebM does copy into MP4 (both have official MP4 mappings), but the result only plays where the player decodes VP9 and Opus, which rules out a lot of QuickTime, older Safari, and hardware players. If the file has to open everywhere, budget for the transcode above.

Fastest WebM to MP4 without a bigger file (measured)

The usual question is how to convert a 1080p WebM to MP4 in the least time without the file ballooning. I measured it on 24 November 2026: a 29.6-second, 1080p60 VP9 and Opus clip (17.2 MB, from Blender's Big Buck Bunny, CC BY), ffmpeg 9.0.2 on an Apple M1 Max, AAC 192k audio and -pix_fmt yuv420p -movflags +faststart on every run. Quality is VMAF against the WebM source (higher is better, out of 100):

CommandTimeOutputVMAF
-c copy (VP9 and Opus kept)0.1 s16.4 MBsame as source
-c:v libx264 -crf 23 -preset medium13.8 s16.4 MB85.3
-c:v libx264 -crf 20 -preset veryfast5.2 s16.2 MB83.9
-c:v libx264 -crf 23 -preset veryfast5.0 s10.3 MB80.1
-c:v libx264 -crf 23 -preset ultrafast3.0 s97.3 MB85.2
-c:v h264_videotoolbox -b:v 5M (hardware)5.1 s19.3 MB65.0

What I take from it:

  • -preset veryfast is the sweet spot. About 2.7 times faster than medium. At the same CRF it makes a smaller but visibly softer file, so drop the CRF by about 3 (CRF 20) to land near medium's size and quality.
  • ultrafast is the trap. It was the quickest encode and produced a file nearly six times bigger than the source, because it switches off most of x264's compression tools. Never use it for files you keep.
  • The hardware encoder is fast but spends bytes badly. At 5 Mbit/s it was bigger than the CRF encodes and scored lowest. On Windows the equivalents are h264_nvenc (NVIDIA), h264_qsv (Intel) and h264_amf (AMD); they behave similarly, so raise the bitrate if you use them.
  • Try -c copy first when the file only has to play in a browser or VLC. It is instant and lossless. Fall back to the transcode when QuickTime, an iPhone or a TV has to open it.

So for a fast 1080p WebM to MP4 conversion that does not balloon (the same command works in Windows cmd, PowerShell, macOS and Linux):

bash
ffmpeg -i in.webm -c:v libx264 -crf 20 -preset veryfast -pix_fmt yuv420p -c:a aac -b:a 192k -movflags +faststart out.mp4

The exact seconds depend on the CPU and the footage; the order of the presets (ultrafast, veryfast, medium from fastest to slowest) and the ultrafast size blow-up are what carry over.

Flag by flag: -c:v libx264 -crf 23 -preset medium is the H.264 encode from the section above. -c:a aac -b:a 192k uses ffmpeg's native AAC encoder in constant-bitrate mode; stereo AAC is effectively transparent from about 128k, so 192k leaves headroom. -movflags +faststart moves the index to the front so a web copy starts playing before it downloads.

Fix the QuickTime black screen

If the MP4 plays in VLC but shows a black screen (or will not open) in QuickTime, Safari, or on an iPhone, the cause is almost always the pixel format. libx264 will encode to yuv444p or yuv422p when the source is in one of those, and Apple's decoders only reliably handle 8-bit yuv420p H.264. That is what -pix_fmt yuv420p forces. I add it to every MP4 I intend to share, even from a 4:2:0 source, because it costs nothing.

MP4 to WebM with VP9 and Opus

The reverse trip also re-encodes. Modern WebM is VP9 plus Opus, not the old VP8 plus Vorbis:

bash
ffmpeg -i in.mp4 -c:v libvpx-vp9 -crf 31 -b:v 0 -c:a libopus -b:a 128k out.webm

The detail that trips people up is -b:v 0: VP9's constant-quality mode only engages when the target bitrate is zero alongside -crf; leave it out and ffmpeg runs a constrained-quality mode that behaves differently. VP9 is slow, and if you can spare the time a two-pass encode gives a better file at a given size:

bash
ffmpeg -i in.mp4 -c:v libvpx-vp9 -b:v 1M -pass 1 -an -f null /dev/null
ffmpeg -i in.mp4 -c:v libvpx-vp9 -b:v 1M -pass 2 -c:a libopus -b:a 128k out.webm

You will still see the legacy VP8 form (-c:v libvpx -crf 10 -b:v 1M -c:a libvorbis) in old tutorials. VP8's CRF scale is 4 to 63 and it compresses worse; every browser that plays WebM at all plays VP9.

The CRF numbers do not transfer between encoders:

EncoderCodecCRF rangeSensible defaultBitrate flag
libx264H.264 (MP4)0 to 51 (use 18 to 28)23omit, CRF drives it
libvpx-vp9VP9 (WebM)0 to 63 (use 15 to 35)31-b:v 0 (required)

Speed

To speed up or slow down a video with ffmpeg, the setpts filter rescales the video presentation timestamps: a smaller multiplier plays faster. For video alone, drop the audio with -an:

bash
# 2x faster (video only)
ffmpeg -i in.mp4 -filter:v "setpts=0.5*PTS" -an out.mp4

# 4x faster
ffmpeg -i in.mp4 -filter:v "setpts=0.25*PTS" -an out.mp4

# Half speed (2x slower)
ffmpeg -i in.mp4 -filter:v "setpts=2.0*PTS" -an out.mp4

The number in front of PTS is the inverse of the speed, which catches almost everyone the first time. If you would rather write the speed factor itself, divide: setpts=PTS/4 is the same as setpts=0.25*PTS, and setpts=PTS/1.3 gives 1.3x without a calculator. For a silent time-lapse or a screen recording you will narrate over, -an is all you need.

Change the audio speed with atempo

To speed up the audio in sync, use atempo, which time-stretches without shifting pitch, so voices do not turn into chipmunks. atempo takes the speed factor directly, not the inverse: atempo=2.0 is twice as fast. So setpts and atempo move in opposite directions for the same change, and 2x overall is setpts=0.5*PTS paired with atempo=2.0:

bash
ffmpeg -i in.mp4 -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" out.mp4

The catch readers hit constantly: while current ffmpeg accepts a single atempo value from 0.5 to 100.0, any tempo above 2.0 skips samples rather than blending them, so for clean results you chain atempo instances each within the 0.5 to 2.0 sweet spot. The factors multiply:

bash
# 4x audio = 2.0 * 2.0
ffmpeg -i in.mp4 -filter:a "atempo=2.0,atempo=2.0" out.mp4

# 0.25x audio (very slow) = 0.5 * 0.5
ffmpeg -i in.mp4 -filter:a "atempo=0.5,atempo=0.5" out.mp4

The steps do not have to be equal: 3x can be atempo=1.5,atempo=2.0, or atempo=sqrt(3),atempo=sqrt(3) for balanced stages. In a combined command the chain rides inside the same -filter_complex, and only the audio side needs chaining:

bash
# 4x faster, audio and video together
ffmpeg -i in.mp4 -filter_complex \
  "[0:v]setpts=PTS/4[v];[0:a]atempo=2.0,atempo=2.0[a]" \
  -map "[v]" -map "[a]" out.mp4

The video multiplier and the audio factor must describe the same change from opposite ends: setpts=PTS/4 goes with a chain that multiplies to 4. Mismatch them and the sound drifts out of sync, the usual symptom when "the speed-up worked but the audio is off."

Smoother slow motion with minterpolate

Slowing a clip with setpts=2.0*PTS creates no new frames; it holds each one on screen longer, so heavy slow-downs stutter. minterpolate synthesizes in-between frames by estimating motion:

bash
# Half speed, interpolated up to a smooth 60 fps
ffmpeg -i in.mp4 -filter:v "setpts=2.0*PTS,minterpolate=fps=60:mi_mode=mci" -an out.mp4

It is slow to run and can smear fast or chaotic motion, so keep it for genuine slow-motion polish. Footage actually shot at a high frame rate always slows down better than interpolated frames can fake.

Reverse a video

To reverse a video with ffmpeg, use the reverse filter for the picture and areverse for the sound, and write to a new file:

bash
ffmpeg -i input.mp4 -vf reverse -af areverse reversed.mp4

reverse flips the order of the video frames, areverse flips the audio samples, so the whole clip plays end-to-start in step. With -vf reverse alone the picture runs backwards over forward audio. For loops and boomerang effects, where backwards sound is just noise, drop the audio instead with -an, which is also faster and lighter on memory:

bash
ffmpeg -i input.mp4 -vf reverse -an reversed.mp4

The output filename matters more than anything else here. A widely copied command reverses a file onto itself (ffmpeg -i clip.mp4 -vf reverse clip.mp4); ffmpeg opens the file for writing while still reading it, and you get a truncated clip and a lost original with no undo.

Trim first: the memory trap

reverse buffers the entire stream in memory before it writes the first frame, because the last input frame becomes the first output frame. A few seconds of 1080p is fine; a feature-length file exhausts RAM, swaps hard, or gets killed. So cut the segment you want, then reverse that:

bash
# Cut ~4 seconds from around 12s, no re-encode (snaps to a keyframe)
ffmpeg -ss 00:00:12 -t 4 -i input.mp4 -c copy segment.mp4

# Reverse the short segment, with explicit quality since a filter re-encodes
ffmpeg -i segment.mp4 -vf reverse -af areverse -c:v libx264 -crf 18 -preset slow reversed.mp4

areverse also buffers the whole audio stream, but audio samples are tiny next to decoded frames, so the video side is what hurts. If a long file genuinely must be reversed in full, split it into chunks, reverse each, and concatenate them in reverse chunk order.

Concat and merge

If the files share the same codecs, parameters, and resolution, the concat demuxer joins them with no re-encode. Write a text file listing them, then:

bash
ffmpeg -f concat -safe 0 -i list.txt -c copy out.mp4

where list.txt holds one file 'clip1.mp4' line per input. When the inputs differ (different codec, resolution, or framerate), the concat demuxer will produce a broken file; use the concat filter instead, which decodes and re-encodes everything. It reconciles codecs, pixel format, and audio sample format on its own, but not resolution: every segment must already be the same size, so scale (and pad, if the aspect ratios differ) first:

bash
ffmpeg -i a.mp4 -i b.mp4 -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" out.mp4

# Different sizes: fit both into 1280x720 first, then concat
ffmpeg -i a.mp4 -i b.mp4 -filter_complex "[0:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1[v0];[1:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1[v1];[v0][0:a][v1][1:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" out.mp4

Different frame rates are accepted but produce variable-frame-rate output.

Subtitles

There are two ways to attach subtitles, and they are not interchangeable. Soft subtitles ride along as a selectable track the viewer can toggle; for an MP4 the subtitle codec is mov_text:

bash
ffmpeg -i in.mp4 -i subs.srt -c copy -c:s mov_text out.mp4

Hard subtitles are burned into the picture, so they always show and survive any re-upload, but they require a re-encode and cannot be turned off:

bash
ffmpeg -i in.mp4 -vf subtitles=subs.srt out.mp4

Common fixes

A few errors come up so often they are worth memorizing. An MP4 that will not start playing until fully downloaded has its moov atom at the end; move it to the front:

bash
ffmpeg -i in.mp4 -c copy -movflags +faststart out.mp4

The dreaded height not divisible by 2 error means a codec rejected an odd dimension after scaling. Force both dimensions even:

bash
ffmpeg -i in.mp4 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" out.mp4

And a video that displays sideways (common with phone footage) rotates with transpose:

bash
ffmpeg -i in.mp4 -vf "transpose=1" out.mp4

transpose=1 is 90 degrees clockwise, transpose=2 counter-clockwise. To grab a single still frame for a thumbnail instead, see extract a thumbnail or frame from a video with ffmpeg.

FAQ

-c copy (stream copy) passes the existing audio and video bytes through untouched, so it is instant and lossless. It only works when the source codec fits the target container, and cuts can only land on keyframes. A re-encode decodes and re-compresses the streams, which is slow but lets you change codec, quality, resolution, or make a frame-accurate cut.

Use -c:v (and -c:a for audio). -vcodec and -acodec are legacy aliases that still work, but the current spellings are -c:v / -c:a, and they read more clearly because they match the stream-specifier syntax used everywhere else (-b:a, -frames:v, and so on).

For libx264, CRF runs from 0 to 51 where lower is better quality and a bigger file. The default is 23, and the visually useful range is about 18 to 28. Use 18 for near-transparent quality, 23 as a solid general default, and 28 when size matters more than fidelity. libx265 uses a similar scale with a default of 28, and libsvtav1 uses a wider 0 to 63 scale (its encoder default is 35, with a CRF around 30 a common starting point for 1080p).

The default GIF conversion maps every frame against one fixed global palette, which produces banding and dithering. Use the two-pass approach with palettegen and paletteuse so ffmpeg builds an optimal 256-color palette from your actual source first. Lowering fps and the output scale are the two biggest levers for file size.

Current ffmpeg lets a single atempo take any value from 0.5 to 100.0, but above 2.0 the filter skips samples instead of blending them, which degrades the audio. For clean larger factors, chain instances that each stay within 0.5 to 2.0: atempo=2.0,atempo=2.0 gives 4x. Pair the audio tempo change with the matching setpts video change so the two stay in sync.

Slowing a clip with setpts holds each existing frame on screen longer rather than creating new ones, so big slow-downs judder. Add minterpolate to synthesize intermediate frames, for example setpts=2.0*PTS,minterpolate=fps=60:mi_mode=mci. It is slow to run and can smear fast motion.

hue=s=0 removes color by zeroing saturation but keeps the original color pixel format, so the chroma planes stay and carry no color. format=gray converts to a single-channel gray pixel format with no chroma at all. On screen they look the same; format=gray is the literal grayscale and the encoded file is often a bit smaller.

The output container cannot hold that codec. Copying an AAC stream into a .mp3 file fails because MP3 files only carry MPEG audio. Check the codec with ffprobe, then use a matching extension (AAC into .m4a, Opus into .opus), or re-encode to the format you need.

Run ffmpeg -i in.mp4 -an -c:v copy out.mp4. -an drops every audio stream and -c:v copy passes the video through unchanged, so the result is bit-for-bit the same picture with the sound gone. To drop only one of several tracks, use -map instead of -an.

Put -ss (and -t or -to) before -i and add -c copy: ffmpeg -ss 00:00:05 -t 12 -i in.mp4 -c copy out.mp4. This is instant and lossless, but the cut snaps to the nearest keyframe so the start may be slightly off. For a frame-accurate cut, drop -c copy and re-encode.

No. Cropping is a filter, and a filter has to decode, alter, and re-encode each frame, so -c:v copy is incompatible with a crop. Set an encoder and quality instead, for example -c:v libx264 -crf 18, and keep -c:a copy so the audio passes through untouched.

Only sometimes. A VP8 WebM cannot be stream-copied into MP4 (ffmpeg's MP4 muxer rejects VP8), and while VP9 plus Opus does copy into MP4, many players, QuickTime and older Safari among them, will not play the result. Re-encode to H.264 and AAC with -c:v libx264 -c:a aac, and add -pix_fmt yuv420p so QuickTime and iOS do not show a black screen.

You almost certainly used the same filename for input and output, for example ffmpeg -i clip.mp4 -vf reverse clip.mp4. ffmpeg opens that file for writing while still reading it, which truncates the source. Always write to a new path, and trim long videos before reversing because the reverse filter holds the whole stream in memory.

Use ffmpeg -af loudnorm when you need one exported file at a fixed loudness (a podcast episode, a video soundtrack), because it rewrites the audio. Use rsgain when you want a whole music library to play evenly without changing the files, because it writes ReplayGain tags that the player applies at playback time. Both measure loudness in LUFS rather than peak level.

See also

Sources

Authoritative references this article was fact-checked against.

TagsffmpegffprobevideoCLIencodingGIFlibx264transcodewebm to mp4loudnorm

Found this useful? Pass it on.

Copied

Ishan Karunaratne

Systems and Network Architect · Chief Technology Officer

Systems and network architect and Chief Technology Officer with more than two decades designing, building, and running production software, cloud and network architecture, Linux systems, and the bare metal underneath them, and lately working AI into the stack. A US Army veteran who served in Operation Iraqi Freedom. What I write here is drawn from the full arc of that work, across architecture, engineering, and operations, not any single job.

Keep reading

Related posts

Regex Cheat Sheet including regex symbols, ranges, grouping, assertions, syntax tables, examples, matches, and compatibility tables. Definitive Regular Expressions Quick Reference!

Regex Cheat Sheet

A regular expression is a pattern that describes a set of strings. This cheat sheet covers character classes, anchors, quantifiers, groups, lookarounds and flags, with per-engine compatibility tables.

Elasticsearch 9.x reference: REST endpoints, Query DSL, aggregations, kNN, ESQL, cluster commands, and a zero-downtime reindex with aliases in curl and Kibana.

Elasticsearch Cheat Sheet

Practitioner reference for Elasticsearch 9.x: index and document operations, Query DSL, aggregations, vector / kNN search, ESQL, cluster management, a zero-downtime reindex runbook with aliases, version compatibility notes, and the gotchas that bite first-time operators.

Open vintage hardcover reference manual on a dark slate desk, dense columned print on warm cream pages lit by a single warm amber side lamp

MySQL Cheat Sheet

MySQL cheat sheet covering CLI commands, database and table operations, joins, indexes, backups, user management, and transactions, with version notes for 5.7, 8.0, and 8.4.