Skip to content

Instantly share code, notes, and snippets.

@apkd
Last active August 9, 2022 11:47
Show Gist options
  • Save apkd/a4eb52d29eb114ec2deb2103b69f03e1 to your computer and use it in GitHub Desktop.
Save apkd/a4eb52d29eb114ec2deb2103b69f03e1 to your computer and use it in GitHub Desktop.
Quickly re-encodes a video file to .mp4. Add it to your PATH (along with ffmpeg).
@echo off
IF "%1"=="" (
echo Usage: reencode path_to_file [optional_crf]
goto eof
)
SET crf="23"
IF NOT "%2"=="" (
SET crf=%2
)
REM https://trac.ffmpeg.org/wiki/Encode/H.264
for %%i in (%1) do ffmpeg -i %1 -c:v libx264 -crf %crf% -preset slower -c:a libopus -strict -2 "%%~ni_x264.mp4"
:eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment