Skip to content

Instantly share code, notes, and snippets.

@izzqz
Last active June 22, 2021 06:53
Show Gist options
  • Save izzqz/1877c32c2bc021fd0c6e97dcaf00b780 to your computer and use it in GitHub Desktop.
Save izzqz/1877c32c2bc021fd0c6e97dcaf00b780 to your computer and use it in GitHub Desktop.
Drag any media over the batch file to start compressing. Requires ffmpeg and uses hevc_nvenc (Nvidia GPU Hardware acceleration)
@echo off
SET inputFile="%~1"
SET outputFile="%~p1%~n1 (COMPRESSED).mp4"
ECHO Compressing...
ffmpeg -y ^
-hide_banner ^
-vsync 0 ^
-hwaccel cuda ^
-i %inputFile% ^
-c:a copy ^
-c:v h264_nvenc ^
-preset p6 ^
-tune ll ^
-b:v 4M ^
-bufsize 4M ^
-maxrate 4M ^
-qmin 0 ^
-g 250 ^
-bf 3 ^
-b_ref_mode middle ^
-temporal-aq 1 ^
-rc-lookahead 20 ^
-i_qfactor 0.75 ^
-b_qfactor 1.1 ^
%outputFile%
echo ############### DONE ###############
pause
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment