Skip to content

Instantly share code, notes, and snippets.

@TeraokaAkihiro
Created September 10, 2022 02:37
Show Gist options
  • Save TeraokaAkihiro/7c2f3ee063e0b00bef4d058bd55b3e7e to your computer and use it in GitHub Desktop.
Save TeraokaAkihiro/7c2f3ee063e0b00bef4d058bd55b3e7e to your computer and use it in GitHub Desktop.
convert video with realesrgan-ncnn-vulkan
@echo off
:nextfile
if "%~s1"=="" goto end
if exist tmp_frames/ (del /q tmp_frames) else (mkdir tmp_frames)
if exist out_frames/ (del /q out_frames) else (mkdir out_frames)
if exist %~s1 ffmpeg -i "%~s1" -qscale:v 1 -qmin 1 -qmax 1 -vsync 0 tmp_frames/frame%%08d.jpg
"./realesrgan-ncnn-vulkan.exe" -i tmp_frames -o out_frames -n realesr-animevideov3 -s 2 -f jpg
if exist %~s1 FOR %%i IN ("%~s1") DO ( ffmpeg -framerate 24 -i out_frames/frame%%08d.jpg -i "%~s1" -map 0:v:0 -map 1:a:0 -c:a copy -c:v libx265 -pix_fmt yuv420p %%~di%%~piconv_%%~ni%%~xi )
shift
goto nextfile
:end
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment