BAT_FFMPEG icon indicating copy to clipboard operation
BAT_FFMPEG copied to clipboard

Video AI Upscaling

Open GrahamboJangles opened this issue 3 years ago • 1 comments

@KnightDanila You're smarter than me, maybe you can figure it out.

Step 1: Output frames from video:

REM https://forum.videohelp.com/threads/344457-can-t-get-ffmpeg-to-convert-video-to-image-sequence#post2177407

ffmpeg -i %%x -r 0.10 -f image2 -s 1280x720 %%4d.jpg

Increase the -r value to get more frames.

Step 3: output photos to a folder

can't figure out

Step 4: take the folder of photos and upscale them

Can't really figure out. Only figured out how to do one image at a time:

AI Upscale single image:

Using https://github.com/nihui/realsr-ncnn-vulkan

I've found this has more realistic results than waifu2x.

realsr-ncnn-vulkan.exe -i input.jpg -o output.png -s 4

Using https://github.com/nihui/waifu2x-ncnn-vulkan

REM https://github.com/nihui/waifu2x-ncnn-vulkan#usages

REM -i is input, -o is output file, -n is noise level, -s is scale factor
REM -v is verbose output, -h is help, -x is tta mode (reduce artifacts, longer processing time)
waifu2x-ncnn-vulkan.exe -i %%x -o "%%~nx_output_ai_upscaled%%~xx" -n 1 -s 4 -v

Step 4: Convert images to video

ffmpeg -r 1/5 -i %%4d.jpg -c:v libx264 -vf fps=25 -pix_fmt yuv420p out.mp4
pause

To do:

  • output photos to a folder
  • automatically take the folder of photos and upscale them

Alternative software for AI upscaling video that I have tested:

https://github.com/AaronFeng753/Waifu2x-Extension-GUI

GrahamboJangles avatar Jul 09 '22 02:07 GrahamboJangles

I also work on this :D I think soon I will figure out how to make it :) I am testing waifu and will test it too, thanks

KnightDanila avatar Aug 12 '22 14:08 KnightDanila