ffmpeg -i fileName.mp4 -c:v hevc_nvenc -preset slow -rc:v vbr -cq:v 24 -b:v 0 -c:a aac -b:a 128k -vf scale=1280:-1 -movflags +faststart fileName_compressed.mp4
| Flag | Explanation |
-i fileName.mp4 | Specifies the input file as fileName.mp4 |
-c:v hevc_nvenc | Sets the video codec to NVIDIA’s HEVC encoder |
-preset slow | Sets the encoding preset to “slow” for better compression efficiency |
-rc:v vbr | Sets the rate control mode to variable bitrate |
-cq:v 24 | Sets the Constant Quality (CQ) value to 24 (lower values mean higher quality) |
-b:v 0 | Sets the target bitrate to 0, allowing CQ mode to determine the bitrate |
-c:a aac | Sets the audio codec to AAC |
-b:a 128k | Sets the audio bitrate to 128 kbps |
-vf scale=1280:-1 | Scales the video width to 1280 pixels, height scaled proportionally |
-movflags +faststart | Optimizes the file for web streaming, allowing faster video startup |
fileName_compressed.mp4 | Specifies the output filename |
smaller:
ffmpeg -i 1.mp4 -c:v hevc_nvenc -preset slow -rc:v vbr -cq:v 29 -b:v 450k -c:a aac -b:a 96k -vf scale=960:-1 -movflags +faststart 2.mp4