dain-ncnn-vulkan
dain-ncnn-vulkan copied to clipboard
DAIN on MAC
Hi there!
I realize this is not technically an "issue" but perhaps you could find the time (and interest) to help out!
I have been reading about DAIN and its possibilities and I am very eager to use it, however, I have several obstacles:
- I only have a mac
- I am a complete noob at anything programming/coding related - I am designer/animator
So while your project solves issue number 1 :), I am still having a huge problem with issue number 2- i have tried to get it to work but I have no idea how to - I downloaded vulkan SDK from their site and the MacOSX actions from here - however I can't even open it - I am not sure how to make it work - Please help me - if you could provide a step by step guide for dummies like myself, I would be eternally greatful!
Thanks in advance!
You don't need the vulkan sdk since that's just for development
- Download the macos build from here https://github.com/nihui/dain-ncnn-vulkan/actions/runs/252105701
- Move the files from the "best" folder into the same folder as the dain-ncnn-vulkan file
- Open the terminal app and run it with
./dain-ncnn-vulkan
It's a terminal program so you'll need some basic terminal knowledge, eg. you'll need to cd
into the dain folder first
Thank you very much for your reply... I have tried that and I get the message - "permission denied" prompt
chmod +x dain-ncnn-vulkan
Thank you so much it seems to be working now! but it still is in command line interface.. so perhaps you could point me in the right direction - so I have a m4v file that it at 25fps and I want to make it 60fps - can I use that? or I need an actual image sequence?
You'll need something like ffmpeg to extract the video to images. ffmpeg -i input.m4v output/%06d.png
for example would extract the frames into a folder called output
Thanks @Mar2ck!
I do have a folder with an image sequence already - its rather big since I have just upconverted a 58min video at 25fps to 4k...(around 87k frames) so I can use that... the only questions is how... :)
All you need is to use the -i
and -o
options and dain-ncnn will generate double the frames automatically. ./dain-ncnn-vulkan -i "[Path to input folder]" -o "[Path to output folder]"
Also consider using cain-ncnn instead, it's a very similar program but it is much faster and uses a lot less video memory. 87k frames will take a lifetime with dain-ncnn
how would I specify a framerate? and since it is using GPU (and I have a 16gb AMD card) how long do you think it might take ? several days?
It depends on resolution, you can use the -v
option to see frames as theyre being made. The program will just double the frames so you'll have 50fps afterwards. If you want a higher framerate you'll need to run it again to get 100 fps and use ffmpeg to reduce the framerate from there. Dain-ncnn has the option -n
which can let you interpolate 25fps -> 60fps directly but like i said you should really use Cain-ncnn or you'll never finish
Btw if by "upconvert" you mean that you're upscaling the resolution, you should try interpolating the frames first then upscaling the resolution after as that'll be much faster
I think that ship has sailed for me :) I have already finished the upscaling - took around 40hrs... and I did not realize that you can’t pick the framerate... that really will make this much more complicated
Hold on - but it says -n num-frame target frame count (default=N*2)
Doesn’t that mean I can pick a framerate to be 60fps?
It's not that hard if you use ffmpeg. Once youve got your frames at 100fps and for example wanted them at 60fps you could use ffmpeg -framerate 100 -i 100fps/%06d.png -vf framerate=fps=60 output-60.mp4
Yes -n lets you multiply by any amount but cain-ncnn doesn't have it and using dain-ncnn is completely impractical for your situation
Thanks! I will try both and see if what works! but if you can tell me, for dain-ncnn how should I write the -n parameter -n 60 or how?
-n takes an amount of frames to output not a framerate.
- Since you want 25 -> 60, do 60/25 which gives 2.4 as your multiplier.
- You need the number of original frames which you said was around 87,000 something.
- Multiply these two: 87,000*2.4=208800 so you'd use
-n 208800
as an example
However you'll need to swap 87,000 with the exact number of frames you have or it wont make exactly 60 fps.
Thanks! that is very much appreciated!
All you need is to use the
-i
and-o
options and dain-ncnn will generate double the frames automatically../dain-ncnn-vulkan -i "[Path to input folder]" -o "[Path to output folder]"
Also consider using cain-ncnn instead, it's a very similar program but it is much faster and uses a lot less video memory. 87k frames will take a lifetime with dain-ncnn
thanks I tried the program and it's much faster but I wonder if there is quality loss when I use "cain-ncnn" instead of "dain-ncnn"
@BahzBeih You'll have to judge for yourself, they're pretty similar. In my experience Cain seems more blurry in motion whereas Dain has more noticeable artifacting when it doesn't know how to track movement
So I can't for the life of me figure out the correct syntax for launching this... I use the following commands:
./dain-ncnn-vulkan -i"/Volumes/CACHES\ SSD/wedding\ Upconversion/DAIN\ TEST" -o"/Volumes/CACHES\ SSD/wedding\ Upconversion/DAIN\ TEST\ OUTPUT " -n 3600
and i get the error "invalid outputpath extension type"
what am I doing wrong?
Try ./dain-ncnn-vulkan -i "/Volumes/CACHES SSD/wedding Upconversion/DAIN TEST/" -o "/Volumes/CACHES SSD/wedding Upconversion/DAIN TEST OUTPUT/" -n 3600
if the path is in quotes it doesnt need backslashes before spaces
Thanks @Mar2ck! with your help i figured it out i just took out the quotes and then added -f jpg -v in the end and its all working... but DAMN it is slow! @Mar2ck you were absolutely correct - it outputs 1 image per minute, whereas CAIN outputs 16 frames per minute... so yeah huge improvement... so I am testing it now on 1 min of footage (1500 frames) and will see what kind of result I will get...
@woozygoozy No problem. You can get it to process faster by using -j 1:1:1
and using the -t
option. Try setting -t as high as your mac can handle before it starts giving you "vkQueueSubmit failed" or "vkAllocateMemory failed"