FFmpeg Cheat Sheet: 50 Commands for Video Processing

March 12, 2026 ยท RenderIO

50 commands, organized by task

FFmpeg's documentation is 400+ pages. Most of it covers edge cases you'll never hit. This cheat sheet pulls out the 50 commands that handle the vast majority of real-world video processing.

New to FFmpeg and not sure where to start? The FFmpeg command line tutorial covers installation, syntax basics, and your first commands before you need a cheat sheet.

Each command includes the FFmpeg syntax and what it does. At the bottom, there's a section showing how to run any of these through the RenderIO API. If you want to understand what each flag does before copy-pasting, the FFmpeg options reference explains every option with syntax and examples.

Format conversion

1. MOV to MP4 (H.264)

ffmpeg -i input.mov -c:v libx264 -crf 22 -c:a aac output.mp4

Re-encodes video to H.264 and audio to AAC. CRF 22 is visually lossless for most content. For a deeper explanation of CRF values, presets, and when to transcode vs remux, see the video transcoding guide.

2. MP4 to WebM (VP9)

ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 -c:a libopus output.webm

VP9/Opus for web delivery. -b:v 0 enables constant quality mode.

3. MKV to MP4 (copy streams)

ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4

Re-muxes without re-encoding. Instant. Only works if codecs are MP4-compatible.

4. AVI to MP4

ffmpeg -i input.avi -c:v libx264 -crf 23 -c:a aac output.mp4

5. MP4 to HLS

ffmpeg -i input.mp4 -c:v libx264 -c:a aac -hls_time 10 -hls_list_size 0 output.m3u8

Creates 10-second segments for HTTP Live Streaming.

6. MP4 to GIF

ffmpeg -i input.mp4 -vf "fps=15,scale=480:-1:flags=lanczos" output.gif

15fps, 480px wide. Lanczos filter gives the best quality for downscaling. For palette optimization and smaller output files, see the full MP4 to GIF conversion guide. Going the other direction? The GIF to MP4 guide covers the yuv420p and even-dimension flags you need for browser-compatible output.

Resizing and scaling

For a deeper walkthrough of each resize method โ€” including scaling algorithms, crop-then-scale combos, and social media presets โ€” see the FFmpeg scale video guide. The FFmpeg resize guide also covers the force_original_aspect_ratio flag and the scale+pad letterbox pattern in depth.

7. Scale to 720p (keep aspect ratio)

ffmpeg -i input.mp4 -vf scale=-2:720 -c:v libx264 -crf 23 output.mp4

-2 calculates width automatically, ensuring it's divisible by 2.

8. Scale to 1080p

ffmpeg -i input.mp4 -vf scale=-2:1080 -c:v libx264 -crf 23 output.mp4

9. Scale to exact dimensions (with padding)

ffmpeg -i input.mp4 -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2" output.mp4

Fits video within 1920x1080 and adds black bars.

10. Scale to 50% of original

ffmpeg -i input.mp4 -vf "scale=iw/2:ih/2" output.mp4

11. TikTok format (1080x1920)

ffmpeg -i input.mp4 -vf "scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2" output.mp4

12. Instagram square (1080x1080)

ffmpeg -i input.mp4 -vf "scale=1080:1080:force_original_aspect_ratio=decrease,pad=1080:1080:(ow-iw)/2:(oh-ih)/2" output.mp4

Trimming and cutting

For a deep dive on keyframe-accurate cutting, input vs output seeking, and batch trimming, see the complete video trimming guide.

13. First 30 seconds

ffmpeg -i input.mp4 -t 30 -c copy output.mp4

-c copy avoids re-encoding. Fast but not frame-accurate.

14. From 1:00 to 2:00

ffmpeg -i input.mp4 -ss 00:01:00 -t 00:01:00 -c copy output.mp4

15. Last 60 seconds

ffmpeg -sseof -60 -i input.mp4 -c copy output.mp4

-sseof seeks from the end of the file.

16. Frame-accurate trim (re-encode)

ffmpeg -i input.mp4 -ss 00:01:00 -t 00:01:00 -c:v libx264 -crf 23 -c:a aac output.mp4

17. Remove first 10 seconds

ffmpeg -i input.mp4 -ss 10 -c copy output.mp4

Audio operations

18. Extract audio as MP3

ffmpeg -i input.mp4 -vn -acodec libmp3lame -q:a 2 output.mp3

-q:a 2 is high quality (~190kbps VBR).

19. Extract audio as WAV

ffmpeg -i input.mp4 -vn -acodec pcm_s16le -ar 44100 output.wav

20. Remove audio

ffmpeg -i input.mp4 -an -c:v copy output.mp4

-an drops all audio streams. Add -c:v copy to stream-copy the video without re-encoding, which makes it near-instant. For removing specific audio streams, replacing audio, or mixing tracks, see the FFmpeg remove audio guide.

21. Replace audio track

ffmpeg -i input.mp4 -i new_audio.mp3 -c:v copy -map 0:v:0 -map 1:a:0 -shortest output.mp4

22. Adjust volume (double it)

ffmpeg -i input.mp4 -filter:a "volume=2.0" -c:v copy output.mp4

23. Normalize audio

ffmpeg -i input.mp4 -af loudnorm=I=-16:TP=-1.5:LRA=11 -c:v copy output.mp4

EBU R128 loudness normalization. Standard for broadcast.

24. Change audio pitch (shift up)

ffmpeg -i input.mp4 -af "asetrate=44100*1.05,aresample=44100" -c:v copy output.mp4

Speed changes

For a full breakdown of setpts math, atempo chaining, time-lapse, and slow motion from high-frame-rate footage, see the FFmpeg speed up video guide.

25. Speed up 2x

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

26. Slow down 0.5x

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

27. Speed up 4x (audio requires chain)

ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=0.25*PTS[v];[0:a]atempo=2.0,atempo=2.0[a]" -map "[v]" -map "[a]" output.mp4

atempo only supports 0.5-2.0. Chain two filters for 4x.

Overlays and watermarks

28. Image watermark (bottom-right)

ffmpeg -i input.mp4 -i logo.png -filter_complex "overlay=W-w-10:H-h-10" output.mp4

29. Image watermark (top-left)

ffmpeg -i input.mp4 -i logo.png -filter_complex "overlay=10:10" output.mp4

30. Semi-transparent watermark

ffmpeg -i input.mp4 -i logo.png -filter_complex "[1:v]format=rgba,colorchannelmixer=aa=0.3[logo];[0:v][logo]overlay=W-w-10:H-h-10" output.mp4

31. Text overlay

ffmpeg -i input.mp4 -vf "drawtext=text='Sample':fontsize=24:fontcolor=white:x=10:y=10" output.mp4

For responsive scaling with scale2ref, opacity control, animated watermarks, and batch processing, see the complete FFmpeg watermark guide.

Compression

32. Light compression (CRF 23)

ffmpeg -i input.mp4 -c:v libx264 -crf 23 -preset medium -c:a aac output.mp4

33. Heavy compression (CRF 28)

ffmpeg -i input.mp4 -c:v libx264 -crf 28 -preset slow -c:a aac -b:a 96k output.mp4

34. Target file size (50MB for 10min video)

ffmpeg -i input.mp4 -c:v libx264 -b:v 650k -pass 1 -an -f null /dev/null && \
ffmpeg -i input.mp4 -c:v libx264 -b:v 650k -pass 2 -c:a aac -b:a 128k output.mp4

Two-pass encoding. Calculate bitrate: (target_size_bits) / duration = bitrate. For a full breakdown of CRF tuning, H.265/AV1 compression, and social media platform targets, see the video compression guide. If encoding is too slow on CPU, the CUDA and NVENC GPU acceleration guide shows how to offload encoding to your NVIDIA GPU for 5-15x speedup.

Rotation and flipping

35. Rotate 90 degrees clockwise

ffmpeg -i input.mp4 -vf "transpose=1" output.mp4

36. Rotate 90 degrees counter-clockwise

ffmpeg -i input.mp4 -vf "transpose=2" output.mp4

37. Rotate 180 degrees

ffmpeg -i input.mp4 -vf "transpose=1,transpose=1" output.mp4

38. Flip horizontally (mirror)

ffmpeg -i input.mp4 -vf "hflip" output.mp4

39. Flip vertically

ffmpeg -i input.mp4 -vf "vflip" output.mp4

Thumbnails and frames

For keyframe-only extraction, scene detection, batch processing, and format comparisons (JPEG vs PNG vs WebP), see the complete frame extraction guide.

40. Single frame at timestamp

ffmpeg -i input.mp4 -ss 00:00:05 -vframes 1 -q:v 2 thumb.jpg

41. One frame every 10 seconds

ffmpeg -i input.mp4 -vf "fps=1/10" thumb_%03d.jpg

42. First frame

ffmpeg -i input.mp4 -vframes 1 -q:v 2 first_frame.jpg

Metadata

43. Strip all metadata

ffmpeg -i input.mp4 -map_metadata -1 -c:v copy -c:a copy output.mp4

44. View metadata (ffprobe)

ffprobe -v quiet -print_format json -show_format -show_streams input.mp4

For extracting specific fields, filtering by stream type, and using ffprobe in automation scripts, the complete ffprobe tutorial covers everything in detail.

45. Set metadata title

ffmpeg -i input.mp4 -metadata title="My Video" -c copy output.mp4

Filters and effects

46. Add noise

ffmpeg -i input.mp4 -vf "noise=alls=10:allf=t" output.mp4

47. Crop (center 640x480)

ffmpeg -i input.mp4 -vf "crop=640:480" output.mp4

48. Blur

ffmpeg -i input.mp4 -vf "boxblur=5:1" output.mp4

49. Color adjustment (increase brightness)

ffmpeg -i input.mp4 -vf "eq=brightness=0.06:saturation=1.2" output.mp4

50. Fade in/out (first and last 2 seconds)

ffmpeg -i input.mp4 -vf "fade=t=in:st=0:d=2,fade=t=out:st=58:d=2" -c:a copy output.mp4

Adjust st=58 to (video_duration - fade_duration).

Using any command with RenderIO

Every command above works with the RenderIO API. Replace file paths with {placeholder} names:

curl -X POST https://renderio.dev/api/v1/run-ffmpeg-command \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key" \
  -d '{
    "ffmpeg_command": "-i {{input}} -vf scale=-2:720 -c:v libx264 -crf 23 {{output}}",
    "input_files": {"input": "https://example.com/video.mp4"},
    "output_files": {"output": "720p.mp4"}
  }'

For more complete API examples, the curl examples post has 20 ready-to-paste commands. There are also full integration guides for Python and Node.js.

FAQ

What does CRF mean and what value should I use?

CRF (Constant Rate Factor) controls quality vs file size. Lower values = better quality, larger files. For H.264: CRF 18 is nearly lossless, 23 is the default, 28 is noticeably compressed. Most people should start at 22-23 and adjust.

When should I use -c copy vs re-encoding?

Use -c copy when you're just changing the container (MKV to MP4), trimming, or merging clips that share the same format. It's instant because it doesn't re-encode. When clips have different codecs or resolutions, you need the concat filter instead โ€” the FFmpeg concat guide covers all three methods with error fixes. Use re-encoding (-c:v libx264) when you need to change resolution, codec, quality, or apply filters. The transcoding guide goes deeper.

Why does FFmpeg require even dimensions for H.264?

H.264 encodes video in macroblocks of 16x16 pixels. Odd dimensions cause encoding errors. Using scale=-2:720 instead of scale=-1:720 ensures the width is divisible by 2.

What's the difference between VP9 and H.264?

VP9 produces smaller files at the same quality but encodes much slower. H.264 has wider device support. Use H.264 (libx264) as the default and VP9 (libvpx-vp9) when you need WebM for web playback. For a full comparison of all major codecs (H.264, H.265, AV1, VP9, ProRes) and which containers support them, see the FFmpeg formats guide.

How do I chain multiple filters?

Separate filters with commas in the -vf flag: -vf "scale=1080:-2,fps=30,eq=brightness=0.06". For complex operations involving multiple inputs (like watermarks), use -filter_complex instead.

For workflow-specific guides, check out the TikTok content automation pipeline with n8n or the dropshipping video automation guide for TikTok Shop sellers. The Starter plan at $9/mo includes 500 commands. Get your API key to start processing.