Skip to content

Instantly share code, notes, and snippets.

@alik604
Last active April 9, 2022 17:01
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 alik604/d065420eb287195d0e9f17050ffee116 to your computer and use it in GitHub Desktop.
Save alik604/d065420eb287195d0e9f17050ffee116 to your computer and use it in GitHub Desktop.
FFMPEG to reencode (encode) entire windows directory with GPU or x265

FFMPEG to reencode (encode) entire windows directory with GPU or x265

CPU

for %i in (*.mp4) do ffmpeg -i "%i" -c:v libx265 -vtag hvc1 -preset fast "%~ni_265.mp4"

ffmpeg -i input.mp4 -c:v libx265 -vtag hvc1 -preset fast input_compressed.mp4

Nvidia GPU

for %i in (*.mp4) do ffmpeg -i "%i" -c:v hevc_nvenc -preset fast "%~ni_nvda.mp4"

Explanation

https://stackoverflow.com/a/69316283/5728614

Consider

  • -crf 20
  • -preset fast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment