Skip to content

Instantly share code, notes, and snippets.

@Eiyeron
Created May 6, 2020 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Eiyeron/e44c249a90ff75bdb87220e842dd0355 to your computer and use it in GitHub Desktop.
Save Eiyeron/e44c249a90ff75bdb87220e842dd0355 to your computer and use it in GitHub Desktop.
Batch file to reencode video files in an hopefully Twitter-compatible way
@echo off
set /p quality="Quality: "
ffmpeg -hwaccel nvdec -c:v h264_cuvid -i %1 -c:v h264_nvenc -rc:v vbr_hq -cq:v %quality% -b:v 2500k -maxrate:v 5000k -profile:v high -pix_fmt yuv420p out.mp4
REM Here's the version without GPU-accelerated encoding
REM ffmpeg -i %1 -crf %quality% -b:v 2500k -maxrate:v 5000k -pix_fmt yuv420p out.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment