lltcggie / waifu2x-caffe

waifu2xのCaffe版
MIT License
8.02k stars 841 forks source link

How to use Waifu2x to working on videos? #150

Open PegionFish opened 5 years ago

PegionFish commented 5 years ago

So here's what hap*pened. I want to upscale a low-res Vocaloid song video to 1080p. I have the latest Windows 10 and NVIDIA GeForce GTX 1060 6G installed on my PC What should I do next? Because my machine has certain bugs I can't use Linux so it would be nice if I can just run thin on my Windows PC. CUDA and cuDNN are all set.

PegionFish commented 5 years ago

btw I'm not really good on Japanese so any English documents would be nice, thank you

CharonM72 commented 5 years ago

I had some success using FFmpeg to extract every frame from a video and then use waifu2x to upscale all of them. This can take a very long time, depending on the scale, model, and the number of frames, but using CUDA will help a lot. Then you will need to put the frames back together into a video, which I have not tried to do, but it should work. I was not able to make a video out of it (I got lazy), so I cannot say how good it will look in the end.

FFmpeg will work on Windows.

On Thu, Feb 14, 2019 at 11:29 PM 割鱼蜓猪 notifications@github.com wrote:

btw I'm not really good on Japanese so any English documents would be nice, thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lltcggie/waifu2x-caffe/issues/150#issuecomment-463902618, or mute the thread https://github.com/notifications/unsubscribe-auth/ABPTFOkFKRrV2KPL_AOksesIr5lNDwNrks5vNjePgaJpZM4a86nc .

PegionFish commented 5 years ago

I had some success using FFmpeg to extract every frame from a video and then use waifu2x to upscale all of them. This can take a very long time, depending on the scale, model, and the number of frames, but using CUDA will help a lot. Then you will need to put the frames back together into a video, which I have not tried to do, but it should work. I was not able to make a video out of it (I got lazy), so I cannot say how good it will look in the end. FFmpeg will work on Windows. On Thu, Feb 14, 2019 at 11:29 PM 割鱼蜓猪 @.***> wrote: btw I'm not really good on Japanese so any English documents would be nice, thank you — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#150 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/ABPTFOkFKRrV2KPL_AOksesIr5lNDwNrks5vNjePgaJpZM4a86nc .

That's my solution now. Using Premiere Pro to extract every single frame from that video and just using Waifu2X to upscale each of these. BUT it takes almost forever and I'm not sure if I can even success. Does the speed of Waifu2X have anything to do with RAM or CPU or just CUDA cores

PegionFish commented 5 years ago

I had some success using FFmpeg to extract every frame from a video and then use waifu2x to upscale all of them. This can take a very long time, depending on the scale, model, and the number of frames, but using CUDA will help a lot. Then you will need to put the frames back together into a video, which I have not tried to do, but it should work. I was not able to make a video out of it (I got lazy), so I cannot say how good it will look in the end. FFmpeg will work on Windows. On Thu, Feb 14, 2019 at 11:29 PM 割鱼蜓猪 @.***> wrote: btw I'm not really good on Japanese so any English documents would be nice, thank you — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#150 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/ABPTFOkFKRrV2KPL_AOksesIr5lNDwNrks5vNjePgaJpZM4a86nc .

I mean 9000+ PNG files, each upscaling to 4K resolution, that can take a whole day

CharonM72 commented 5 years ago

As far as I know, your GPU is the deciding factor on how fast it goes. An RTX 2080 will do a lot better than a GTX 760. The more CUDA cores the better (and make sure it's actually using CUDA!)

On Fri, Feb 15, 2019 at 12:46 AM 割鱼蜓猪 notifications@github.com wrote:

I had some success using FFmpeg to extract every frame from a video and then use waifu2x to upscale all of them. This can take a very long time, depending on the scale, model, and the number of frames, but using CUDA will help a lot. Then you will need to put the frames back together into a video, which I have not tried to do, but it should work. I was not able to make a video out of it (I got lazy), so I cannot say how good it will look in the end. FFmpeg will work on Windows. … <#m-2526989077447663436> On Thu, Feb 14, 2019 at 11:29 PM 割鱼蜓猪 @.***> wrote: btw I'm not really good on Japanese so any English documents would be nice, thank you — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#150 (comment) https://github.com/lltcggie/waifu2x-caffe/issues/150#issuecomment-463902618>, or mute the thread https://github.com/notifications/unsubscribe-auth/ABPTFOkFKRrV2KPL_AOksesIr5lNDwNrks5vNjePgaJpZM4a86nc .

I mean 9000+ PNG files, each upscaling to 4K resolution, that can take a whole day

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lltcggie/waifu2x-caffe/issues/150#issuecomment-463915428, or mute the thread https://github.com/notifications/unsubscribe-auth/ABPTFAmXNVgp5DHheCU5UrxvoWHHGhS-ks5vNkmugaJpZM4a86nc .

YukiSakuma commented 5 years ago

https://github.com/K4YT3X/video2x

Joachim-Otahal commented 5 years ago

ffmpeg works perfectly (win10 x64 here). Be sure to get the most recent version of ffmpeg. ffmpeg.exe -hide_banner -i \%06d.png then your waifu: waifu2x-caffe-cui.exe --model_dir models\upconv_7_anime_style_art_rgb -s 2 -n 1 -m noise_scale -e png -c 540 -i \%06d.png -o \%06d.png and reencode: ffmpeg.exe -hide_banner -framerate 25 -i \%06d.png -vcodec libx264 -preset:v veryslow -tune:v Animation -crf 20

Be aware: -c 540 is the fastest for 1080p input for my card which has a lot of video RAM. You mileage may vary.