Last active
August 9, 2022 11:47
-
-
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).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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