Deoldify Vapoursynth filter - Printable Version +- Selur's Little Message Board (https://forum.selur.net) +-- Forum: Talk, Talk, Talk (https://forum.selur.net/forum-5.html) +--- Forum: Small Talk (https://forum.selur.net/forum-7.html) +--- Thread: Deoldify Vapoursynth filter (/thread-3595.html) |
RE: Deoldify Vapoursynth filter - Dan64 - 20.03.2024 good! Unfortunately it seems that there is something wrong with Average Frames. Here an example using 7 frames, with average: center, left, right https://imgsli.com/MjQ4ODEx The situation get worse if the number of frames is increased. https://imgsli.com/MjQ4ODEy I'm trying to write my own average filter, but it is seem that is not possible to access past frames using Vapoursynth Here my code def clip_color_stabilizer(clip: vs.VideoNode = None, nframes: int = 5, smooth_type: int = 0) -> vs.VideoNode: The problem is in the call: frame_to_image(clip.get_frame(n-i)) When nframes>1 Vapoursynth freeze. Do you have any idea on how to access past frames from Vapoursynth ? Thanks, Dan RE: Deoldify Vapoursynth filter - Selur - 20.03.2024 frist thing I see is that, if n < max_frames that should crash, since 'clip.get_frame(n-i)' would try to access non existing frames. for i in range(1, max_frames): for i in range(1, min(n-1,max_frames)): Also the output of AverageFrames does look correct to me, one of the frames you look at is an unprocessed frame. Cu Selur RE: Deoldify Vapoursynth filter - Dan64 - 20.03.2024 (20.03.2024, 15:38)Selur Wrote: frist thing I see is that, if n < max_frames that should crash, since 'clip.get_frame(n-i)' would try to access non existing frames. before this call, there is the if if n < max_frames: (20.03.2024, 15:38)Selur Wrote: Also the output of AverageFrames does look correct to me, one of the frames you look at is an unprocessed frame. In this case I provided in input a clip already colored, there are no gray frames in input. RE: Deoldify Vapoursynth filter - Selur - 20.03.2024 "n < max_frames" should be "n <= max_frames" then RE: Deoldify Vapoursynth filter - Dan64 - 20.03.2024 just to provide an example. nframes=3 max_frames = 3 if (n < max_frames) stop when n=3 for i in range(1, 3) are processed only the frames: 3 - 1 = 2 3 - 2 = 1 current frame (n=3) is allocated at the begin on the list so the list contains the frames: 3, 2, 1 so I don't see the risk to access non available frames. Dan RE: Deoldify Vapoursynth filter - Selur - 20.03.2024 okay. Are you sure, with: img_f.append(frame_to_image(clip.get_frame(n-i))) I suspect that you are averaging the colored frames with the gray scaled frames RE: Deoldify Vapoursynth filter - Dan64 - 20.03.2024 The problem is that is not working! the images provide as example was obtained by using the Vapoursynth AverageFrames RE: Deoldify Vapoursynth filter - Selur - 20.03.2024 Quote:The problem is that is not working!What does that mean? Are you reffering to AverageFrames or your code? I need some code I can actually run or open inside an editor to look at. A code snippet without context isn't something one can debug. btw. I just realized the ui elements in Hybrid are wrong. colstab_merge_enabled, colstab_ddcolor_enabled, colstab_deoldify_enabled are separated options, not like in the gui where if colstab_merge_enabled is disabled the other two are disabled too. -> I'll change that in the gui Cu Selur RE: Deoldify Vapoursynth filter - Selur - 20.03.2024 using: core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll") Problem is, that as soon as there is motion, understandably the averaging can cause problems. I suspect that the idea of using a 'stupid' average is the main problem here. => the more motion the clip has the smaller the number of frames taken into account for the averaging need to be. (maybe using a motion mask - created over the luma only - combined with AverageFrames - using the colored frames - could work, to only merge static chroma,..) Cu Selur Ps.: send you a link to a dev version which should fix the colstab_merge_enabled, colstab_ddcolor_enabled, colstab_deoldify_enabled gui problem RE: Deoldify Vapoursynth filter - Dan64 - 20.03.2024 (20.03.2024, 14:14)Selur Wrote: VSPipe.exe --progress -c y4m c:\Users\Selur\Desktop\test.vpy NUL It is only an apparent speed improvement. Supposing that you are using a render_factor=24, by stacking the frames you are decreasing by 2 the render_factor. You can obtain exactly the same speed increase and quality (without stacking the frames) by setting render_factor=12 and dd_render_factor=12 Dan |