Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frame count #67

Open
SmoothBrainApe opened this issue Oct 25, 2023 · 9 comments
Open

frame count #67

SmoothBrainApe opened this issue Oct 25, 2023 · 9 comments

Comments

@SmoothBrainApe
Copy link

Just want to confirm. If I use arguement -n, should I put N*8 for example if I want to interpolate the video 8 times? Is that how it works?

@TNTwise
Copy link

TNTwise commented Oct 25, 2023

From my testing, you need to put the amount of frames * 8 for it to work in your specific case.

@SmoothBrainApe
Copy link
Author

From my testing, you need to put the amount of frames * 8 for it to work in your specific case.

Oohhhhh! I see! Thanks! Now my bash script works like a charm! Thanks again!

@2blackbar
Copy link

This is not correct, when you set it like this and will have 3 input frames then you will end up with 3rd frame getting reapeated multiple times at the end... they really dropped the ball with those multiplier calculations, its just plain dumb cause it could of been much much simple way

@TNTwise
Copy link

TNTwise commented Jan 2, 2024

Pretty sure the third frame at the end gets repeated to keep the time the same, at least that's what I'm told.

@2blackbar
Copy link

2blackbar commented Jan 2, 2024

ok i built the fix, you can download from here : i also will upload gui in bat file form ,its a python gui for this app so needs to be in same folder as the exe : https://github.com/2blackbar/rife-ncnn-vulkanfix/releases

@SmoothBrainApe
Copy link
Author

Soo...what should be the computation then?

@2blackbar
Copy link

2blackbar commented Jan 2, 2024

What You want it to be? I can customise, i can make it so you specify number of inbetweens to generate between each input frames .

Actually there it is, replace code inside bat file, replace what starts from if output path till model name = model_name etc... easy to find inside generate command

So now if you want twice as much frames then set number to 1 to create 1 inbetween each input frame

if output_path:
    command += f' -o "{output_path}"'

num_inbetween_frames = num_frame_entry.get()

if num_inbetween_frames:
    num_input_frames = len([name for name in os.listdir(input_path) if os.path.isfile(os.path.join(input_path, name))])
    target_frame_count = num_input_frames + (int(num_inbetween_frames) * (num_input_frames - 1))
    command += f" -n {target_frame_count}"

time_step = time_step_entry.get()
if time_step:
    command += f" -s {time_step}"  # Include the time step in the command

model_name = model_name_var.get()

Now there is also this one, with this one you can simply tell it to multiply all input frames by this number
So 2x 4x 7x or whatever and it will count all input frames and spit out proper amount of multiplied frames, so use this code below if you want that , so you will be able to set it like in first post here , you set it to 8 and it will do 8 times amount of all frames

frame_multiplier = num_frame_entry.get()

if frame_multiplier:
num_input_frames = len([name for name in os.listdir(input_path) if os.path.isfile(os.path.join(input_path, name))])
target_frame_count = int(frame_multiplier) * num_input_frames
command += f" -n {target_frame_count}"

@SmoothBrainApe
Copy link
Author

Cool thanks! Imma try this later when i get home. I use linux so I am not sure a bat file will work on my case but i will give it a try. Thanks

@TNTwise
Copy link

TNTwise commented Jan 2, 2024

Cool thanks! Imma try this later when i get home. I use linux so I am not sure a bat file will work on my case but i will give it a try. Thanks

Could use my project and replace the binary https://github.com/TNTwise/REAL-Video-Enhancer

Edit:
recompiled for Linux, MacOS, and Windows: https://github.com/TNTwise/rife-ncnn-vulkan/releases/tag/20240102-frame-count-patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants