>cheatref
tmuxffmpeg
  1. > ffmpeg
  2. /
  3. compression

> compression

5 commands for ffmpeg compression

// compression

5 commands
Compress video with CRF quality control
$ ffmpeg -i input.mp4 -c:v libx264 -crf 23 -c:a aac output.mp4
Two-pass encoding for target file size
$ ffmpeg -i input.mp4 -c:v libx264 -b:v 1M -pass 1 -f null /dev/null
Hardware-accelerated encoding with VideoToolbox
$ ffmpeg -i input.mp4 -c:v h264_videotoolbox -b:v 5M output.mp4
Hardware-accelerated encoding with NVENC
$ ffmpeg -i input.mp4 -c:v h264_nvenc -preset p7 -cq 23 output.mp4
Reduce file size by limiting bitrate
$ ffmpeg -i input.mp4 -b:v 1M -maxrate 1M -bufsize 2M -c:a aac output.mp4

// categories

> basic conversion> trimming> audio> video filters> speed & reverse> gif & images> concatenation> subtitles> compression> streaming> inspection> useful tips
> view all ffmpeg commands

// categories

> basic conversion> trimming> audio> video filters> speed & reverse> gif & images> concatenation> subtitles> compression> streaming> inspection> useful tips

// back to ffmpeg commands

> view all ffmpeg commands

> cheatref.com — minimal cheat sheets you can copy and use right away

AboutPrivacy© 2026 goyostudio