KnightDanila / BAT_FFMPEG

Batch script files for FFMPEG (Microsoft Windows and DOS, OS/2 :unicorn:)
https://github.com/KnightDanila/BAT_FFMPEG
124 stars 28 forks source link

Video AI Upscaling #4

Open GrahamboJangles opened 2 years ago

GrahamboJangles commented 2 years ago

@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:

Alternative software for AI upscaling video that I have tested:

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

KnightDanila commented 2 years ago

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