This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[HELP] ReplaceSingle (to replace multi)
#1
I have a clip that has two sequential frames that are bad; frames 898 and 899.
ReplaceSingle usually does a great job, but when two bad frames are sequential, it doesn't work well.
Is there another tool or method to solve this?
Perhaps eliminate one of the bad frames completely and the use ReplaceSingle to replace the one bad left frame that was left.
Reply
#2
Replace single is meant to replace single frames, not multiple frames in a row.
It uses the adjacent frames as base to create the interpolation to replace the existing frame.
One would need something like a 'ReplaceMultipleFrames' script, the current frame can't do this atm. .
Maybe I'll find to write a script for this tomorrow, since I probably will be afk. for most of the day, today.


Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#3
Uploaded a new dev version which comes with a 'ReplaceMultiple'.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#4
Thank you, thank you.  A great new tool you've just added.
Already looks a whole lot better, but I think there is a small issue.  The two bad frame 898 and 899 now look great, but it appears that now frame 899 and 900 are identical.
Reply
#5
I'll look into, it maybe I mixed up an index somewhere.
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#6
Think I found the problem, replacing ReplaceMultipleFrames.py with
https://github.com/Selur/VapoursynthScri...eFrames.py
should fix it.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#7
Thank you maestro, it works flawlessly.
Reply
#8
I have another scenario which I'm not sure how to solve, please assist. 
Its a bad transition between scenes.
up to Frame 7361 everything looks good, Frame 7362 is the end of scene, image shifts up and the frame looks bad and 7363 is the new scene also looks good
Is there a way to make frame 7362 become a duplicate to frame 7361, instead of using ReplaceSingle interpolation between 7361 & 7363


Attached Files
.zip   Frames.zip (Size: 1,46 MB / Downloads: 3)
Reply
#9
Untested, but try adding:
def replace_frame(n, clip):
    if n == 7362:
        return clip.get_frame(7361)
    else:
        return clip.get_frame(n)

return core.std.FrameEval(clip, eval=replace_frame)
in a custom section (probably somewhere after deinterlacing), https://github.com/Irrational-Encoding-W...emapFrames could also be used for this.
Will look at it more after work.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#10
Do:
# replaces frame x +1 with a duplicate of x
def duplicate(clip: vs.VideoNode, x: int) -> vs.VideoNode:
    part1 = core.std.Trim(clip, 0, x)          # Frames 0 to x (inclusive)
    replacement = core.std.Trim(clip, x, x)    # Only frame x (duplicate)
    part3 = core.std.Trim(clip, x + 2, None)   # Frames x+2 to end
    return core.std.Splice([part1, replacement, part3], mismatch=True)
return duplicate(clip, 7361)
is faster and works.
If you wanted to duplicate 7361 and 7447 you would use:
# replaces frame x +1 with a duplicate of x
def duplicate(clip: vs.VideoNode, x: int) -> vs.VideoNode:
    part1 = core.std.Trim(clip, 0, x)          # Frames 0 to x (inclusive)
    replacement = core.std.Trim(clip, x, x)    # Only frame x (duplicate)
    part3 = core.std.Trim(clip, x + 2, None)   # Frames x+2 to end
    return core.std.Splice([part1, replacement, part3], mismatch=True)
clip = duplicate(clip, 7361)
clip = duplicate(clip, 7447)
return clip

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)