View Full Version : Avisynth "morph" function, way to automate it and stability concerns
abolibibelot
2nd January 2018, 00:24
I'm trying to correct footage (important and unique) which was taken with a camera having a dysfunctional stabilization system, generating jerkiness all by itself (mostly on the vertical axis), even when it was held with a relatively steady hand (steady enough so that the stabilization system would normally have corrected the slight amount of jerkiness instead of doing the opposite – anyway, what's done is done).
I used the stabilization module coming with the editor I'm using (Magix Video Deluxe), which made quite an improvement, but couldn't correct individual frames which are blurred because of that jerkiness.
Then I discovered Avisynth's “morph (https://forum.doom9.org/showthread.php?t=161154)” function found on this forum, which can effectively interpolate those bad frames from the surrounding good ones. That thing is quite impressive, if there isn't too much motion the result is virtually perfect, the interpolated frames aren't even noticeable ; there are very few cases where it doesn't produce a satisfying result. But that's an almost overwhelming task to go through about 35 minutes of footage looking for blurred frames and correcting them one by one...
So, is there a way to automate the process, to detect the blurred frames with some script and correct them on-the-fly, or at least generate a list of frame numbers which I could then convert to a list of morph(x, y) calls ?
And also, I'm having concerns about the possibility of running such a heavy-duty Avisynth script. So far I have about 700 "morph" calls, it proved unstable within AVSPmod when more than a few dozens are active, I have to disable them regularly to be able to continue, and it makes it crash quite often if I forget. I have a quite powerful machine, i7 6700K and 16GB of RAM, but won't even such a system choke if I try to run an x264 encode with that kind of script as input ? Or is Avisynth designed in such a way that commands are treated in their sequential order without putting an excessive strain on the system ? Is AVSPmod known to have stability issues with long scripts ?
Thanks.
wonkey_monkey
2nd January 2018, 00:33
How many bad frames in a row do you get, at most?
abolibibelot
2nd January 2018, 01:28
How many bad frames in a row do you get, at most?
Most are unique (but there can be several in close succession, with good frames in between), in some cases there are two in a row, there are very few areas with more than two in a row.
Here's an example (in one area where there happens to be three in a row) :
https://forum.doom9.org/attachment.php?attachmentid=16173&d=1514852796
(native frame)
https://forum.doom9.org/attachment.php?attachmentid=16172&d=1514852694
(interpolated frame using morph function)
(Is there a way to resize pictures so as to not affect the page's layout ? O_o)
16173
16172
StainlessS
2nd January 2018, 03:02
Perhaps of use for manual fix:- https://forum.doom9.org/showthread.php?t=173158&highlight=Sawbones
EDIT: Play clip in VirtualDubFilterMod whilst using Sawbones, stop on problem frame, press a SawBones key sequence
to insert a command into command file, repeat until clip end.
Process in Avisynth using above created Command file and FrameSurgeon script function.
Perhaps quicker and less effort than attempting to write successful detection function.
(Max interpolation of 9 frames, EDIT: If greater than 9 frames, could leave until totally manual fix later)
EDIT: For later manual fix, Clipclop's DoctorFrames Script handles up to 20 interpolated frames.
Clipclop:- https://forum.doom9.org/showthread.php?p=1520076
abolibibelot
2nd January 2018, 05:31
I'm currently trying this method. I installed all the required plugins (took some time to know what was required and how to get it), created an empty Command.txt file, made an AVS script with :
AVISource("I:\20131224\20151224.avi")
ConvertToYV12(matrix="Rec709")
FrameSurgeon(Cmd="G:\20131224 M2TS\Command.txt")
which loads into VirtualDub FilterMod, I ran SawBones.exe with both windows visible as instructed, but the keyboard shortcuts don't work so far. Did I forget something or do something wrong ?
Do you know how FrameSurgeon performs compared with Morph ?
Is DoctorFrames() another frame interpolation function, or a part of the tools used by FrameSurgeon ?
Perhaps quicker and less effort than attempting to write successful detection function.
If I have to do it myself that's for sure, as I've never written any kind of program yet... But I guess that this would be a tough task even for someone with good programming skills and knowledge and experience in the particular field of digital video.
https://forum.doom9.org/attachment.php?attachmentid=16174&d=1514867437
EDIT :
(Max interpolation of 9 frames, EDIT: If greater than 9 frames, could leave until totally manual fix later)
EDIT: For later manual fix, Clipclop's DoctorFrames Script handles up to 20 interpolated frames.
Do you mean 9 frames in total, or 9 consecutive frames ? If 9 consecutive, that's plenty enough, if it's 9 total, I need much, much more than that (as I said, I already made more than 700 morph() calls).
StainlessS
2nd January 2018, 05:53
Meant 9 consecutive frames for interpolate.
Have found bug in FrameSurgeon, can you make this change to line 201
was
BSZ = c.Height/40 FSZ=c.Height/5
LBOX = c.LetterBox(BSZ,BSZ,BSZ,BSZ,$0000FF)
Mod
BSZ = c.Height/(40*2)*2 FSZ=c.Height/(5*2)*2
LBOX = c.LetterBox(BSZ,BSZ,BSZ,BSZ,$0000FF)
What OS, and keyboard are you using ?
EDIT: Script that I'm gonna play with
Import("FrameSurgeon.avs")
AVISource("1941 Flint Michigan Parade [Low, 360p].mp4.AVI")
Crop(0,0,Width/4*4,Height/4*4) # fix odd dimensions
#Return Info
ConvertToYV12(matrix="Rec709")
FrameSurgeon(Cmd="Command.txt",Show=True,Final=False)
Return Last
EDIT: Added Show=True
EDIT: You may need to run as administrator, and maybe any Antimalware might block keyboard control stuff in SawBones,
might think some kind of keyboard logger or something.
EDIT: When click from some other active window to VDub window, should flash up a "SawBones is watching" message for a few secs.
(NEXT TO MOUSE)
EDIT: Sawbones icon should be visible on task bar (RHS) when active.
EDIT:
You have script loaded into VirtualDubFilterMod,
Existing "Command.txt",
Command.txt loaded into running and visible edit window of "NotePad.exe",
Sawbones visible on TaskBar.
And Open VirtualDubFilterMod script editing window, on taskbar.
EDIT: Mine aint working either, maybe some change to current VirtualDubFilterMod or something, give us a little while to investigate further.
abolibibelot
2nd January 2018, 06:22
What OS, and keyboard are you using ?
Windows 7 Pro, AZERTY (french) keyboard. Don't have any antimalware stuff installed currently (I know it's bad... it's a relatively new install, I was using Avira Antivirus before but it became really annoying, not sure what to use now).
When click from some other active window to VDub window, should flash up a "SawBones is watching" message for a few secs.
Sawbones icon should be visible on task bar (RHS) when active (NEXT TO MOUSE).
I get a very quick flash but no message, even though the process does appear in Task manager. What is RHS ? What do you mean by “next to mouse” ?
Also, I have a gazillion Notepad instances opened... And I'm using Notepad2 as a replacement for the default Notepad (but normally it should behave just the same for anything that uses Notepad, shouldn't it ?).
EDIT : There's a SawBones icon on task bar, when I hover over it there's “(Paused)” beside the name, and if I click on it (left or right click), a contextual menu appears with “Script paused” checked and “Exit”, but I can't uncheck it.
EDIT : OK, now I can, it's no longer paused, but still doesn't work.
Have found bug in FrameSurgeon, can you make this change to line 201
What kind of issue was it provoking, and how did this change solve it ? (Just curious...)
poisondeathray
2nd January 2018, 06:33
Are you using avisynth/avspmod x64 ? or x86 ?
To rule out if it's an avspmod issue, try vdub/vdubfiltermod
Are you using a recent mvtools2 ? There are older versions that are prone to crashes. Try the pinterf branch
But it's probably a trim() issue . Each call has multiple trims and avisynth doesn't like thousands of trims
As a workaround for now, split up the script, save out the script to an intermediate for each section
For detection, I wouldn't trust most approaches on important footage. Too much room for error. Even if it's 95% accurate you risk missing bad sections; but even worse - false positives mean you risk losing good original frames.
Moreover, doing yourself and previewing gives you the option to evaluate the results. There are several different interpolation function variants and various settings that might get better results if your "default" result was poor. Example for one section a larger blocksize might help, for another maybe dct=1, etc..
Or sometimes, the interpolated result is worse than the original, then you can *see* that and use another method or adjust accordingly
But brainstorming some ideas - maybe frame differences . The problem with avisynth runtime functions such as YDifferenceFromPrevious is that it will fail with 2 sequential blurry frames . Or something normal like turning on a light would be flagged inappropriately. Lots of scenarios for misdetection
Maybe motion vectors. Or maybe something like deshaker's log file run through some excel script to filter the results . Large deltas maybe in rotation should be areas where there is large motion
I don't know of anyway to automatically/accurately detect unwanted "what is a blurred frame"
StainlessS
2nd January 2018, 06:35
I get a very quick flash but no message, and no icon visible on task bar, even though the process does appear in Task manager. What is RHS ? What do you mean by “next to mouse” ?
RHS means Right Hand Side.
If icon not visible then is not running properly, dont know why (especially as no anti-malware running), it should work ok on W7 (I think).
Anybody confirm work/not on W7 ?
Can ONLY use standard NotePad, it looks for the system NotePad, and nothing else.
Also, NOT good idea to have multiple instances open, it will not have a clue which one it should insert commands into.
What kind of issue was it provoking, and how did this change solve it ?
The Mod code block contains the fix (In previous post).
Dont know why it previously did not work for me, suspected some kind of Graphics card shortcuts were interfering, but "Ati hotkey Poller" is disabled in my
services and so should not be problem. I did a reboot, and now its working fine, no idea what the problem was.
Suggest try standard NotePad, maybe icon not visible is not a restricting problem.
Azerty Keyboard might need some mods to your Sawbones.ini file, if you can figure out which keys (if any) dont work as expected.
(just need to try the command key sequences in docs and see that they all insert correct commands into Command.txt).
EDIT: The text "(NEXT TO MOUSE)", I had pasted at end of wrong line, fixed in original post in blue, sorry for confusion.
EDIT: Just seen your edit that icon is visible when mouse hovers over it, that is probably down to your TaskBar config settings
and is therefore ok, it should work fine if you use the system notepad. (it has to use system notepad to access its controls,
some other notepad eg NotePadPlus or whatever, has different executable name and different controls, so will not work).
Azerty may though still be a small problem for you to fix in ini file.
EDIT: You can do a simple Right Click on Command.txt and "Open With" NotePad.exe in context menu (its probably available there as an option without you having to look for it in its directory [on XP32 NotePad.exe is in system32]).
abolibibelot
2nd January 2018, 07:03
I made a test with AVSPmod, running FrameSurgeon on the same frame shown above :
https://forum.doom9.org/attachment.php?attachmentid=16176&d=1514872740
The result seems to be more precise than Morph, it deals with moving objects better (that man's legs for instance), with no ghosting effect. I'll try it with problematic frames which I couldn't improve satisfyingly with Morph.
And so, can I safely run a script with hundreds of frame interpolations, with either one of those functions ?
StainlessS
2nd January 2018, 07:05
You also need Show=True in FrameSurgeon script to view edits within Sawbones when you press the "CTRL/ALT," [thats a comma at the end] sequence,
ie as so (for my test)
Import("FrameSurgeon.avs")
AVISource("1941 Flint Michigan Parade [Low, 360p].mp4.AVI")
Crop(0,0,Width/4*4,Height/4*4) # fix odd dimensions
#Return Info
ConvertToYV12(matrix="Rec709")
FrameSurgeon(Cmd="Command.txt",Show=True,Final=False)
Return Last
EDIT:
And so, can I safely run a script with hundreds of frame interpolations, with either one of those functions ?
Thousands :) [if you find a limit, let me know]
EDIT: If you find that you need to change ini for AZERTY (French I think) keyboard, then please post mods in the Sawbones/FrameSurgeon thread for other users of Azerty, thanx.
EDIT:
Here doc for the "CTRL/ALT," (control / alt /COMMA) command, SAVE & REFRESH, ie view edited clip in SawBones,
with deletes shown marked for deletion only (otherwise would screw up further editing (thats why FINAL=FALSE is set))
CTRL/ALT/, Save & Refresh.
Ie, Save NotePad Command.txt, refresh/reload Avisynth Script, jumping back to original position in VDubFilterMod.
NOTE, v1.04, We have Added this "CTRL/ALT/," key combo.
You can change this key combination used for "Save & Refresh" by changing the ini file item
"KEY_Save=^!," to something else, in sequence they are CTRL(^) SHIFT(+), ALT(!) and ',' keys
pressed together. The Sawbones.ini file is created upon first use of the executable.
NOTE, it is quite difficult to find key combo's that are not used system wide, and also not used by VirtualDubFitlerMod.
It does also not improve matters where eg Graphics cards install a whole bunch of additional hotkey combos, reducing what
is available to the user. (Who actually thinks they need permanent system wide hotkeys to access graphic card settings,
almost useless and just an annoyance [particularly if they supplant your own hotkeys], disable if at all possible).
The key combos for "Interpolate Range" and "Save & Refresh", may not work on some international keyboards and so you can
change key combo in the ini file, a URL link to further info will be embedded in the ini file.
Hopefully all of the other Sawbones key combos are available to you, they were made deliberately a little awkard
in the hope that they are not used elsewhere on your system, if they already in-use then I'm afraid you may need to mod the
Sawbones source and rebuild it (after ascertaining what keys ARE available to you).
NOTE, Save & Refresh requires that VirtualDubFilterMod Script Editor window is also open to refresh the avisynth script
(can be left open on task bar, you do not need to see the contents of the script window). If Script Editor is NOT open,
then only a NotePad save of the Command text is done, we cannot refresh/reload the avs script into VDub if script editor
is not open (or not avialable, so will not work in Standard VirtualDub).
IMPORTANT:- See also above DELETE commands.
EDIT:
Here, result of sawbones DEL 0 (delete frame 0) command, after Save & Refresh key sequence executes,
as seen in VirtualDubFilteRMod with SawBones active.
https://s14.postimg.cc/qcekzk0y9/Morph.jpg (https://postimages.cc/)
EDIT: When final = TRUE, above frame deleted for real and not just marked for deletion (Must use Final=False if using SawBones).
abolibibelot
2nd January 2018, 07:25
If icon not visible then is not running properly, dont know why (especially as no anti-malware running), it should work ok on W7 (I think).
I found it afterwards (I may have terminated the process and forgot to re-run it). But I still don't get a message saying "SawBones is watching".
Can ONLY use standard NotePad, it looks for the system NotePad, and nothing else.
Just seen your edit that icon is visible when mouse hovers over it, that is probably down to your TaskBar config settings
and is therefore ok, it should work fine if you use the system notepad. (it has to use system notepad to access its controls,
some other notepad eg NotePadPlus or whatever, has different executable name and different controls, so will not work).
Oh, right... Couldn't it be implemented in a future revision ? Even if each text editing tool has a different layout, CTRL+V works in all of them.
You can do a simple Right Click on Command.txt and "Open With" NotePad.exe in context menu (its probably available there as an option without you having to look for it in its directory [on XP32 NotePad.exe is in system32]).
Doing that just opens Notepad2. I tried to open directly the notepad.exe inside system32, it does the same (even though it seems to be the native one, it says it's from Microsoft).
Copying it to another directory : same. Changing its name to notepad3333.exe : it doesn't run at all ! O_o
Anything else I can try, short of uninstalling Notepad2 ?
StainlessS
2nd January 2018, 07:45
I found it afterwards (I may have terminated the process and forgot to re-run it). But I still don't get a message saying "SawBones is watching".
Not sure, think will only flash that message if both VirtualDubFilterMod (which identifies itself as VirtualDub and has same controls), and NotePad.exe are both running.
Oh, right... Couldn't it be implemented in a future revision ? Even if each text editing tool has a different layout, CTRL+V works in all of them.
NO, needs more than Paste from clipboard, and controls in some other version of a notepad exe are not likely to be named exactly the same and of same type.
You surely must be able to load notepad via Accessories menu, if not then they are some bad habits that NotePad2 has got, and I would get rid of it.
Sorry, have no intention of writing multiple versions of Sawbones for all variations of notepad replacements, that was why system NotePad was chosen.
AutoiIt source is supplied for anyone willing to spend (what seems like a daft waste of time) to get past NotePad2 peculiarities.
StainlessS
2nd January 2018, 07:55
From AutoIt source
If you can find names for below, in NotePad2, then might work
Global Const $EdTitle = "[CLASS:Notepad]" ; NotePad
Global Const $EditControl = "[CLASS:Edit; INSTANCE:1]"
Below should work, so long as names above ok and NotePad2 access CTRL/S as Save As.
Func NotepadSave()
ControlSend($EdTitle, "", $EditControl, "^s" , 0) ; Send CTRL/S to NotePad, ie Save (FileSelector pop-up if not named)
If NOT WinExists($ScriptTitle) Then
ToolTip("Sending NotePad Save ONLY")
Else
ControlSend($ScriptTitle, "", $ScriptControl, "{F5}" , 0) ; Send F5, save File and Refresh to VirtualDubFilterMod Script Editor
ToolTip("Sending ScriptEditor Save & Refresh")
EndIf
$ShowCnt = $ShowCntLimit * 4
Endfunc
Then Re-Build, F5 key I think in AutoIt editor.
Can use the window tool (forget what its called in autoIt) to identify the Class name of NotePad2 and also the edit control (which may already be called Edit).
EDIT: The window tool mentioned above is AU3Info on the tools menu of the ScITe editor for AutoIt (available on the AutoIt website when download). It identifies internal names of controls and stuff of windows including program windows and controls.
EDIT: By the way, I use PsPad and NotePad+, neither of which prevents me using system NotePad, if they did, I would ditch them.
EDIT: Is NotePad2 that you use, this one ? :- http://notepad2.com/
EDIT: If it is above notepad2, then below looks like it should work, change and F5 to rebuild.
Global Const $EdTitle = "[CLASS:Notepad2]" ; NotePad2
Global Const $EditControl = "[CLASS:SysListView32; INSTANCE:1]"
OK, compiled SawBones for above NotePad2 from http://notepad2.com/
Available from SendSpace below this post, until link expires.
EDIT: The build key in AutiIt editor is actually F7 not F5.
abolibibelot
2nd January 2018, 08:29
You surely must be able to load notepad via Accessories menu, if not then they are some bad habits that NotePad2 has got, and I would get rid of it.
Well, it was designed to replace the native Notepad in every way, so it does it as it's supposed to. But it's optional, and reversible. Since it's far richer in features and also runs much faster with large files, I think it's very useful and welcome tweak. It uses some Registry trick :
“The Notepad2 Setup Tool can be used to replace Windows Notepad with Notepad2, using a clean, unintrusive registry-based method (read about the technical details (http://www.flos-freeware.ch/doc/notepad2-Replacement.html)).”
I would say that it's the native Notepad's behaviour which is problematic, making it necessary to use such a trick to open text files with anything else by default.
AutoiIt source is supplied for anyone willing to spend (what seems like a daft waste of time) to get past NotePad2 peculiarities.
Well, I'll try that tomorrow... (or later today should I say – it's 8 AM here and I haven't slept yet !)
Thanks for the explanations, and of course many thanks for designing those tools...
In any case, if I decide to use FrameSurgeon from now on (I'll probably do as it seems to be an improvement over an already excellent little function), how can I translate all the commands I already wrote for Morph without having to type them again ? I was thinking of using OpenOffice Calc for that purpose.
Another test with a problematic frame : in this case FrameSurgeon doesn't perform better than Morph, it's actually worse :
https://forum.doom9.org/attachment.php?attachmentid=16177&d=1514877779
https://forum.doom9.org/attachment.php?attachmentid=16178&d=1514877797
16177
16178
StainlessS
2nd January 2018, 08:35
Have supplied NotePad2 version in above post.
Is it correct NotePad2 ?
EDIT:
In any case, if I decide to use FrameSurgeon from now on (I'll probably do as it seems to be an improvement over an already excellent little function), how can I translate all the commands I already wrote for Morph without having to type them again ? I was thinking of using OpenOffice Calc for that purpose.
Post a zip of morph commands, I'll convert for you.
When working OK, you will be able to see result when using Sawbones/FrameSurgeon and chose to use Morph if bad (later).
EDIT: OK, had a quick look at your "technical details" link, looks like same NotePad2 (same original author) but a modified version (much later version mod, by someone else) but guess that there is still a fair chance of it working ok, give new Sawbones a bash.
By the way, I dont have much intention of making future multiple versions of sawbones, you will have to make the mods
yourself, copy and paste of two strings, and pressing F7 is not so very hard.
abolibibelot
2nd January 2018, 09:04
After deleting the Notepad2 Registry key (see link in previous post) I can run the native Notepad (I saved it so I could re-import it afterwards).
Now I have the “SawBones is WATCHING” message when clicking on the VDFM window, and CTRL+DEL works as intended. But CTRL+SHIFT+ALT+1 doesn't work. I'll try to edit the .ini file later today.
StainlessS
2nd January 2018, 09:12
Great stuff.
To assist in CTRL+SHIFT+ALT+1, suggest test first if being used by something else.
eg, copy some exe to desktop.
create a shortcut to it.
right click "Properties", and click on "Shortcut Key", and enter the shortcut.
If it prevents you from entering the shortcut, then looks like something else is already using it (maybe Graphics card).
EDIT: Anyway, I've gotta get some sleep too, Good Night.
EDIT: If doing above and successful setting of shortcut, then go back and remove the shortcut, or it will be in-use.
StainlessS
2nd January 2018, 09:18
NOTE:
For CTR/ALT/SHIFT/1,
it requires a range, ie you need to mark VirtualDub range with HOME end END keys, or it will not work (flashes a 'no range' type message I think).
EDIT: Maybe would be more sensible to presume current frame interpolation, but then that would work different to the other
(multiple frame) interpolation commands.
EDIT: Nope, was talking rubbish above, when I press CTRL/ALT/SHIFT/1, it does indeed insert current frame for interpolation.
It's the "CTRL SHIFT ALT /" (last one is slash) Interpolate Range command sequence that needs a vdub marked range.
abolibibelot
2nd January 2018, 09:43
By the way, I use PsPad and NotePad+, neither of which prevents me using system NotePad, if they did, I would ditch them.
Again, that's optional ; on the page I linked the author explains that this feature was first proposed as an unofficial trick, then implemented in the default install (most likely because many users requested it). He also explains that the same trick is used by ProcessExplorer (from SysInternals which has been acquired by Microsoft) to replace the native Task manager, so it's nothing shady or malicious.
It works after temporarily deleting the registry key, but I'll still try to re-build the program to use with Notepad2, following your instructions above. (I recently installed AutoIt, hoping that it could help me with a totally different task, but didn't get very far.)
Post a zip of morph commands, I'll convert for you.
That's really nice of you, but I'd rather learn the method, and it may be useful for someone reading this thread later on and having a similar issue.
When working OK, you will be able to see result when using Sawbones/FrameSurgeon and chose to use Morph if bad (later).
Yes, anyway I will review each processed frame before proceeding with the encoding. For this particular frame I have deemed the result with Morph unsatisfying and disabled the corresponding command, so neither of them can improve over the native frame (unless the function can be tweaked) ; there are only a few like that so it's not so bad (and it happens when there is a lot of motion so it's barely noticeable anyway). I tested FrameSurgeon with other frames which were problematic with Morph and FrameSurgeon generally produced a decent result.
StainlessS
2nd January 2018, 09:50
Sorry, have not implemented ini file replacement for Azerty.
Looking at this:- https://en.wikipedia.org/wiki/AZERTY#Differences_between_the_Belgian_and_French_layouts_of_the_AZERTY_keyboard
Leads me to believe that we will have problems, due to qwerty keys 1->9 being on bottom row,
and Azerty having 1->9 on top row, I think I need allow change in ini for probably all command sequences so that
Azerty can use eg CTRL/SHIFT/ALT/& instead of CTRL/SHIFT/ALT/1, etc (ie the bottom row characters).
I'll do that conversion in a few hours (well after some sleep).
Why do you foreigners have to be awkward and speak strange languages and use odd keyboards, just to be difficult I guess. :)
There must be an easier way :(
Bernardd
2nd January 2018, 10:50
abolibibelot, have you try this martin53's script https://forum.doom9.org/showthread.php?p=1600151#post1600151
StainlessS
2nd January 2018, 17:33
abolibibelot,
Can you down the SawBones_1-5_Beta.zip from Sendspace (link below this post), and give it a whirl.
I may have fixed the AZERTY keyboard probs (hopefully, and for QWERTZ [German] etc too).
I should have been wrapping non special keys in {} I think, to have it convert for various keyboards.
(Not 100% sure by any means but it stands some chance of working I think).
NOTE, I've been experiencing problems with VirtualDubFilterMod when sending the "Save & Refresh" sequence,
Save NotePad Command.txt file [EDIT: works fine], and then sending 'F5' key to VirtualDubFilteRMod's open Script Editor window.
It refuses to refresh, unless the window is visible, ie not minimised onto the taskbar, its not a big deal, you just
have to make the script editor window tiny and bung it up next to the NotePad window, then it all works ok.
(It used to work ok on taskbar, I think).
Can you check that all key combos are working please, and I'll put up a non beta (after I finally do get some sleep).
Yawn :)
EDIT: This is the AutoIt snippet that does not save & refresh, (maybe 'Shekh the magnificent' is watching)
...
Global Const $ScriptTitle = "[CLASS:birdyAVSEditor]" ; VirtualDubFilterMod Script Editor Window
Global Const $ScriptControl ="[CLASS:Scintilla; INSTANCE:1]"
...
Func NotepadSave()
ControlSend($EdTitle, "", $EditControl, "^s" , 0) ; Send CTRL/S to NotePad, ie Save (FileSelector pop-up if not named)
If NOT WinExists($ScriptTitle) Then
ToolTip("Sending NotePad Save ONLY")
Else
ControlSend($ScriptTitle, "", $ScriptControl, "{F5}" , 0) ; Send F5, save File and Refresh to VirtualDubFilterMod Script Editor
ToolTip("Sending ScriptEditor Save & Refresh")
EndIf
$ShowCnt = $ShowCntLimit * 4
Endfunc
EDIT: It does present the tooltip marked above in blue, but does not refresh when on taskbar. EDIT: script editor does not respond to the F5 key.
EDIT: It should also put up an alert and abort if cannot set a [EDIT: Global, ie system wide] HotKey, and say which sequence failed,
so you can check to see what is using the hotkey (they cannot be replaced, and sometimes you cannot find what
is using a hotkey. No programs seem to exist that can tell what sets any particular [EDIT: system wide] hotkey).
I guess that the only way to find out is to press the hotkey sequence and see what pops up.
But, seems impossible to enumerate all used hotkeys and show what is using them.
abolibibelot
2nd January 2018, 18:56
To assist in CTRL+SHIFT+ALT+1, suggest test first if being used by something else.
eg, copy some exe to desktop.
create a shortcut to it.
right click "Properties", and click on "Shortcut Key", and enter the shortcut.
If it prevents you from entering the shortcut, then looks like something else is already using it (maybe Graphics card).
Well, indeed I can't input CTRL + SHIFT + ALT + 1 in a shortcut, but if I press those four keys simultaneously it displays “CTRL + ALT + 1 (PAV. NUM.)” (which disappears as soon as I release the keys), the “SHIFT” (or “MAJ” as it's called here), does not appear ; it does appear if I press only the three first keys : “CTRL + MAJ + ALT +”.
I tried CTRL + SHIFT + ALT + 2, and... the display turned to black, then went upside-down ! O_o Kinda spooky when you're not expecting it... (Could be reverted with CTRL + SHIFT + MAJ + 8. And as you might expect, or not expect at all, the same sequence ending with 4 turns the display to the left – messing with all the windows sizes to accomodate – and with 6 it turns it to the right. Whoever designed this should be bludgeonned with a rubber dildo, to the left and to the right of his sorry face, until he screams “ALT + F4 !”.)
Oh, but it does in fact work (using the default SawBones) with the other numerical keys, the ones on the... LHS of the keyboard (at first I tried the ones on the numerical keypad) : with CTRL + SHIFT + ALT + &, I get the correct command “I1 XXXX” added in the Command.txt file.
NOTE, I've been experiencing problems with VirtualDubFilterMod when sending the "Save & Refresh" sequence,
Save NotePad Command.txt file [EDIT: works fine], and then sending 'F5' key to VirtualDubFilteRMod's open Script Editor window.
It refuses to refresh, unless the window is visible, ie not minimised onto the taskbar, its not a big deal, you just
have to make the script editor window tiny and bung it up next to the NotePad window, then it all works ok.
(It used to work ok on taskbar, I think).
Does that concern the updated version, or the former one also ? How is this “Shekh the magnificent” related to this ?
Why do you foreigners have to be awkward and speak strange languages and use odd keyboards, just to be difficult I guess.
Dunno, but here there's a proverb saying “Un homme AZERTY en vaut deux” ! :) (Well, hard to translate that pun, the actual proverb is “Un homme averti en vaut deux”, meaning “A man who is aware is worth two men”, and “averti” is pronunced almost the same as “AZERTY”...)
Actually, you may already know this, the layout of keys on keyboards was originally designed to slow down the typing, so as to limit the risk of jamming the early typewriters...
https://en.wikipedia.org/wiki/QWERTY
StainlessS
3rd January 2018, 09:54
(PAV. NUM.), === USB Numerical Keypad ???:- https://www.google.co.uk/search?q=%22%28PAV.+NUM.%29%22&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&dcr=0&ei=zJJMWqDNDM3U8gfj3ru4BA
I think W7+ (maybe Vista+, arrh!, I'm on XP32), added some stuff to Accessories/Accessibility/ for setting eg Gamma Ramp, screen inversion etc,
maybe thats part of the CTRL + SHIFT + ALT + 2<---> 8, stuff, or some 'Value Added' Usb numerical keyboard gunk,
maybe you can access some of its settings and turn off the gunk (check also .Accessibility/ stuff to see what hotkeys it installs by default).
You could always look at your graphics card driver stuff [on XP, right click DeskTop, Properties, Settings, Advanced, and see what they have left there to play with.
I switch them all off one by one, then disable hotkeys stuff, disable any daft taskabar icon accessory, then go into Services (via 'My Computer/Manage', on XP),
and disable Ati HotKey Poller, that usually gets rid of all gunk grafix stuff.
[I needed some XP screen Inversion {Black<--->White<-->Black} tool some time ago, and managed to come up with this:- XP Screen color inversion (https://forum.doom9.org/showthread.php?t=171949) ]
Does that concern the updated version, or the former one also ? How is this “Shekh the magnificent” related to this ?
Both, (did not affect previous versions of VirtualDubFilteRMod). "Shekh the Magnificent", lives here :- All Hail Shekh (https://forum.doom9.org/showthread.php?p=1770401#post1770401)
you may already know this
Yep, quite common knowledge. Used to know somebody that collected and repaired old typewriters (nasty old tall mechanical things, maybe Edwardian),
not hard to imagine them getting their 'hammer arms' in a tangle.
abolibibelot
3rd January 2018, 10:23
abolibibelot, have you try this martin53's script https://forum.doom9.org/showthread.php?p=1600151#post1600151
I am trying this right now, but I haven't yet figured out how it should be used according to the nature of the defects that need to be corrected, and which parameters significantly affect the outcome (the script is quite long and the instructions quite sparse). With the default parameters, it just replaces the identified bad frames by one of the adjacent frames, is that correct ? How can it be set to interpolate frames, and how does it perform, compared with Morph, FrameSurgeon and similar functions ? If it does work as intended that would be a huge time saving, but I'd still want to know which frames were replaced and review them.
The amount of informations I found on this topic is almost as overwhelming as the task itself...
abolibibelot
3rd January 2018, 11:03
(PAV. NUM.), === USB Numerical Keypad ???
No, just the regular numerical keypad on the right side of a desktop keyboard. With an AZERTY keyboard it's more convenient to use this as the numerical keys on the left are on “second row” as you mentioned.
I think W7+ (maybe Vista+, arrh!, I'm on XP32), added some stuff to Accessories/Accessibility/ for setting eg Gamma Ramp, screen inversion etc,
maybe thats part of the CTRL + SHIFT + ALT + 2<---> 8, stuff, or some 'Value Added' Usb numerical keyboard gunk,
maybe you can access some of its settings and turn off the gunk (check also .Accessibility/ stuff to see what hotkeys it installs by default).
You could always look at your graphics card driver stuff [on XP, right click DeskTop, Properties, Settings, Advanced, and see what they have left there to play with.
I switch them all off one by one, then disable hotkeys stuff, disable any daft taskabar icon accessory, then go into Services (via 'My Computer/Manage', on XP),
and disable Ati HotKey Poller, that usually gets rid of all gunk grafix stuff.
Well, anyway, it works with the numerical keys on the left, so I should be able to proceed, as I will mostly need I1 & I2, if I need something else that doesn't work natively I'll edit the .ini file.
In the mean time I made some tests, comparing Morph and FrameSurgeon with several other scripts I could find :
bad frames interpolation tests (http://www.mediafire.com/file/byd50pq0d1e1b8d/bad%20frames%20interpolation%20tests%2020180103.rar)
FrameSurgeon performs best overall. Morph leaves some motion artifacts but does correct the jerkiness and effectively restores the sharpness in still areas for all three frames. FixBadFrames on the contrary interpolates the motion very well (at least for the first frame) but leaves the picture blurred elsewhere (second and third interpolated frames are worse). Interpolate_bad_frames and RX almost as good as FrameSurgeon (RX is probably second best behind FrameSurgeon). BadFrames is a poor performer, if I used it correctly, worst of the bunch.
Scripts used for this test :
– Morph
https://forum.doom9.org/showthread.php?t=161154
– FrameSurgeon (with SawBones)
https://forum.doom9.org/showthread.php?t=173158
– RX
https://forum.doom9.org/showthread.php?p=1600429#post1600429
– Interpolate2 / Interpolate_bad_frames
https://forum.doom9.org/showthread.php?p=1600428#post1600428
– Interpolate (apparently an earlier version of the one above, and produces an inferior result – but not as bad as BadFrames)
https://forum.doom9.org/showthread.php?p=1554824#post1554824
– FixBadFrames
https://forum.doom9.org/showthread.php?p=1600501#post1600501
– BadFrames
http://avisynth.org.ru/badframes/badframes.html
Oh, and I found a precise answer to one of my initial questions in this thread :
https://forum.doom9.org/showthread.php?t=152758&page=3
"Cobo, I've been using Mug Funky's Morph before now but don't much like it for several reasons, both trivial and important. The important one is the fact if I try to call it more than a dozen-15 times in the script, I get an out of memory error. So the movie has to be broken up into pieces, encoded separately as lossless, and then rejoined."
https://forum.doom9.org/showthread.php?t=152758&page=4
"I did get an out of memory error once, but it was during the encode and didn't pinpoint RX as the cause. When using Morph I get it just loading the script if too many frames are being interpolated."
So running Morph with that many calls would most likely not work.
And so, how would you proceed to convert the Morph commands to FrameSurgeons commands ?
StainlessS
3rd January 2018, 11:52
I'll edit the .ini file.
I'de have to make all key combos available, there were only a few editable in ini. Did not anitcipate any problems with the numerical keys combos.
I'll see what I can do.
And so, how would you proceed to convert the Morph commands to FrameSurgeons commands
No idea, dont know what your Morph commands look like [I guess something like Morph(23,25) or similar, to fix frame 24 (from memory of reading the morph thread)].
I would just knock up a script for parsing the commands file (or script portion), extracting two numbers, adding 1 to first and subtract 1 from second, and convert to an Id command, and write it out to another file. I find parsing frames files not so difficult at all.
EDIT: I could have easily used CTRL/ALT/Letter combos, however I use them extensively in my own system wide hotkeys.
EDIT: Also NOTE, VirtualDub/FilterMod uses loads of hotKeys which you also cannot use in SawBones.
EDIT: I guess that I can easily get around the VDFilterMod F5 Save & Refresh thing, by shifting focus to the script window, before sending F5 key, and then shifting back to FilterMod window. (have not tried that yet, but I expect that it should be ok).
EDIT: What version NotePad2 do you use ? and I assume that there is an Avisynth syntax highlighter option, is there also possibility of playing via eg MPC-HC and viewing help file within NotePad2, on some key combo ? (the old version by original author looked quite good, and very light weight).
EDIT: At ~300KB for largest file, I downed them all, both 32bit and both 64bit.
EDIT: I usually use PsPad for hacking out a script & quick test for errors in MPC-HC or MPlayer2 (old WMV from about W98 or W2K), and when roughly about right, switch to VirtualDubFilteRMod script editor, and finally PsPad again (or NotePadPlus) for beautifying (eg TABS to SPACES).
EDIT: Dont know if more have been added, this I knocked up quite some time ago. [EDIT: Does not incl new AVS Script Editor hotKeys]
VDubAccelerators.txt
FILE MENU:
CTRL/O Open Video file
F2 Re-Open Video file
SPACE Preview Input
ENTER Preview Filtered
F5 Preview Output From Start
F7 SaveAs AVI
SHIFT/F7 Save Old Format AVI
CTRL/W Close AVI
CTRL/SHIFT/F7 Queue Batch Save AVI
CTRL/L Load Processing Settings
CTRL/S Save Processing Settings
F4 Job Control
CTRL/Z Undo
EDIT MENU:
CTRL/Y ReDo
CTRL/X Cut
CTRL/C Copy
CTRL/V Paste
DELETE Delete
CTRL/D Clear Selection
CTRL/A Select ALL
HOME Set Selection Start
END Set Selection End
VIEW MENU:
F9 Toggle Input Input Video Pane
F10 Toggle Output Input Video Pane
SHIFT/F10 View decompressed Output
F8 Log
SHIFT/F8 Real-Time Profiler
GO MENU:
CTRL/LEFT Beginning
CTRL/RIGHT End
LEFT Previous frame
RIGHT Next Frame
SHIFT/LEFT Previous KeyFrame
SHIFT/RIGHT Next KeyFrame
ALT/LEFT Back 50 Frames
ALT/RIGHT Forward 50 Frames
PAGEUP Back 50 Frames
PAGEDOWN Forward 50 Frames
SHIFT/[ Prev Drop Frame
SHIFT/] Next Drop Frame
SHIFT/, Prev Range
SHIFT/. Next Range
[ Goto Selection Start
] Goto Selection End
CTRL/SHIFT/LEFT Goto Prev Scene
CTRL/SHIFT/RIGHT Goto Next Scene
CTRL/G Goto Frame
VIDEO MENU:
CTRL/F Filters
CTRL/R FrameRate
CTRL/P Compression
CTRL/1 Copy Source frame to ClipBoard
CTRL/2 Copy Output frame to ClipBoard
AUDIO MENU:
CTRL/I Interleaving
CTRL/N Conversion
HELP MENU:
F1 Help
#############################################################
###################### SORTED BY TYPE ########
#############################################################
PLAIN KEYS:
[ Goto Selection Start
] Goto Selection End
SPACE Preview Input
ENTER Preview Filtered
DELETE Delete
HOME Set Selection Start
END Set Selection End
LEFT Previous frame
RIGHT Next Frame
PAGEUP Back 50 Frames
PAGEDOWN Forward 50 Frames
CTRL KEYS:
CTRL/1 Copy Source frame to ClipBoard
CTRL/2 Copy Output frame to ClipBoard
CTRL/A Select ALL
CTRL/C Copy
CTRL/D Clear Selection
CTRL/F Filters
CTRL/G Goto Frame
CTRL/I Interleaving
CTRL/L Load Processing Settings
CTRL/N Conversion
CTRL/O Open Video file
CTRL/P Compression
CTRL/R FrameRate
CTRL/S Save Processing Settings
CTRL/V Paste
CTRL/W Close AVI
CTRL/X Cut
CTRL/Y ReDo
CTRL/Z Undo
CTRL/LEFT Beginning
CTRL/RIGHT End
CTRL/SHIFT/F7 Queue Batch Save AVI
FUNCTION KEYS:
F1 Help
F2 Re-Open Video file
F4 Job Control
F5 Preview Output From Start
F7 SaveAs AVI
F8 Log
F9 Toggle Input Input Video Pane
F10 Toggle Output Input Video Pane
SHIFT KEYS:
SHIFT/[ Prev Drop Frame
SHIFT/] Next Drop Frame
SHIFT/, Prev Range
SHIFT/. Next Range
SHIFT/LEFT Previous KeyFrame
SHIFT/RIGHT Next KeyFrame
SHIFT/F7 Save Old Format AVI
SHIFT/F8 Real-Time Profiler
SHIFT/F10 View decompressed Output
CTRL/SHIFT/LEFT Goto Prev Scene
CTRL/SHIFT/RIGHT Goto Next Scene
ALT/LEFT Back 50 Frames
ALT/RIGHT Forward 50 Frames
EDIT:
#############################################################
############### AVS SCRIPT EDITOR WINDOW ##################
#############################################################
FILE MENU:
CTRL/N New
CTRL/O Open
CTRL/S Save
F2 Save
F5 Save & Refresh
F7 Save & Open as AVI
CTR/Q Exit
EDIT MENU:
CTRL/Z Undo
CTRL/Y Redo
CTRL/G Goto
CTRL/F Find
F3 Find Next
SHIFT/F3 Find Prev
CTRL/P Insert Position
CTRL/R Insert Range
CTRL/T Insert Trim with Range
CTRL/I Insert Frameset as Trims
CTRL/SHIFT/O Insert Filename
CTRL/ALT/SHIFT/C Comment Selected Lines
CTRL/ALT/SHIFT/U UnComment Selected Lines
EDIT: Conflicts with AVS script editor dont matter. (its the VD main window that will be active).
EDIT: VDFilterMod also has ability to edit DeComb and VapourSynth scripts, but no idea how Decomb thing behaves, and VapourSynth
editor is very limited, because no-one that was interested had any idea about VapourSynth syntax nor vs requirements.
abolibibelot
3rd January 2018, 23:52
Wow, that's a lot of edits ! :)
No idea, dont know what your Morph commands look like [I guess something like Morph(23,25) or similar, to fix frame 24 (from memory of reading the morph thread)].
I would just knock up a script for parsing the commands file (or script portion), extracting two numbers, adding 1 to first and subtract 1 from second, and convert to an Id command, and write it out to another file. I find parsing frames files not so difficult at all.
Yes, that's it. And Morph(23, 27) to fix frames 24, 25, 26 for instance. So the difficulty, if there is one, is to correctly set the number of frames to interpolate.
Doing that kind of script is what I'd like to learn here.
What I did was : open the script into Calc, using “( , )” as separators, in the next column, add 1 to the first number, in another column, create a formula to calculate [second number] - [first number] - 1 ; then copy those values to Notepad2, add “I” at the begining of every line (Edit > Block > Modify lines > Prefix text to lines). It's quite rudimentary but it does the job !
But anyway, I think I'll just start all over again, since I have to see the effect on each treated frame, and it'll be much quicker than the first time around with SawBones (and with this method being so much quicker, and the FrameSurgeon function apparently being much easier on the system, I can add frames with light defects which I ignored before).
I'de have to make all key combos available, there were only a few editable in ini. Did not anitcipate any problems with the numerical keys combos.
I could have easily used CTRL/ALT/Letter combos, however I use them extensively in my own system wide hotkeys.
As I said, it does work with the numerical keys on the left. I almost never use those ones, since they're not in direct access, but on “second row” as you mentioned, that's why I didn't even try them at first.
But that may have been more convenient with letters indeed, as the current hotkeys for I1, I2, I3 (probably the only ones I'll need here, and probably the most useful in most situations) are too awkward to type with the left hand, while progressing through the footage with the right hand on the left-right arrow keys.
Side question : should I place the interpolation commands before or after the denoising ?
What version NotePad2 do you use ? and I assume that there is an Avisynth syntax highlighter option, is there also possibility of playing via eg MPC-HC and viewing help file within NotePad2, on some key combo ? (the old version by original author looked quite good, and very light weight).
Just the regular, official build in 64-bit. I'm not sure what you want to know exactly. In my config, Notepad2 is launched in every situation where the native Notepad would be launched.
Another text editor I use when I need some special features which are not in Notepad2 is TEDNotepad : that one is based on the native Notepad at its core, which has some drawbacks (it doesn't display line numbers on the main window, only in the status bar, doesn't have syntax highlighting and other refinements), but is otherwise packed with special features, allowing for instance to move and/or duplicate blocks of texts by defining them as columns, using any character as separator.
StainlessS
4th January 2018, 02:43
should I place the interpolation commands before or after the denoising ?
Sorry, you cant do that. You can interpolate OR FXn replace[denoise], after all interpolations/replacments done, then can delete frames.
ClipClop [Replacement/Interpolations] are further (afterwards) processed, by Prune[range deletions] filter.
Interpolations are just replacments, replaced with a 'Magic' Interpolation clip.
FXd replacements can replace other FXd replacements, but that is just because the last one takes precidence, ie it does the last one
and ignores the previous ones. But you cannot 'break' a 'Magic' ie Interpolated clip, you cannot replace any frame of one, but as deletes are
processed later in Prune, you can delete any/all of an interpolated sequence.
EDIT: You can remove eroneous edits in Command.txt file just by switching to notepad window and, well, editing them.
You can eg denoise your source before using FrameSurgeon, eg src=src.MCDegrain(2) or whatever. (or silimar to the result of Framesurgeon).
EDIT: There is probably not much to stop you doing say two passes of FrameSurgeon, but the first pass edits should be completed
and processed with Show=False,Final=True, and passed on as source to the second installment of FrameSurgeon for hand edit, final edit.
Anyway, I'm knackered and gonna get some shuteye, so,
find SawBones-v1.05_Beta2-20180104 on SendSpace (below in my Sig) or here:- LINK REMOVED
Pretty much done, just really editing doc file and maybe a little more tinkering, but all key combos now user editable.
VDFM Script Editor window need to be open, if on taskBar will pop up in screen when save & refresh key pressed.
I could not get it to respond to keys when minimized (it aint a normal windows window or controls), so have to activate it.
I noted that on my Keyboard ALT/1 etc all available, also Windows key may be available.
Here a snip from doc that I'm editing.
SawBones v1.05, (c) StainlessS @ Doom9:- https://forum.doom9.org/showthread.php?t=173158
SawBones/FrameSurgeon, a VirtualDubFilterMod/Avisynth script, utility combo to edit bad frames.
Create Command file in VirtualDubFilterMod [VDFM] with Sawbones, and use Command file in Avisynth script function FrameSurgeon.
SawBones now requires VirtualDubFilterMod, and also requires standard system NotePad, both NotePad and VDFM AVS Script editor
windows should be open (you can make them smallish and leave them above/below the VDFM main window). Sawbones will appear as a
little icon on the Right Hand Side of the task bar (SawBones does not have a window).
Quick intro:
Create a Command.txt file and load into NotePad. Create a client script calling FrameSurgeon with args
FrameSurgeon(...,Cmd="Command.txt",Final=False,Show=True)
and open this client script in VDFM and with the VDFM Script editor window open, then run SawBones, now you are set to go.
You can scroll through a video clip in VDFM, and press the SawBones "Frame Delete" key combo to insert a FrameSurgeon
delete (DEL n) command for the current frame into the NotePad Editor. You press the keys with VDFM as the active window (not NotePad).
After entering the frame delete command, you could (if desired) then press the 'Save & Refresh' key combo, and the contents of
NotePad Command.txt file will be saved, and then VDFM will reload the script at the same position so you can see the deleted frame.
(In actual fact, when using FrameSurgeon with Sawbones, you should use the FrameSurgeon args Final=False,Show=True, so that
FrameSurgeon will not actually delete frames, but only mark the frames with some "DUMMY_DELETE" type subtitle in red,
deleting them for real would screw up any further edits, plus you can scroll back and forth to see what
frames will be deleted and perhaps spot any mistakes). Save your Command.txt file, you can now run the same client
script with Final=True,Show=False to edit the clip for real, job done.
A Bit More
Default: SawBones.ini file, created on first use of Sawbones.Exe (can just delete ini file and will be recreated on next execution)
You can edit the "KEY_xxxxx" entries in the [UserKeys] Section, and also the "Comment" entry in the [UserComment] Section.
##############
[Default]
COMMENT= : RangeEndIsExclusive: 0 = Avisynth : 1 = VirtualDub
RangeEndIsExclusive=0
[UserKeys]
COMMENT_1= : Accelerator keys:- CTRL=^ ALT=! SHIFT=+ WINDOWS=#
COMMENT_2= : Accelerators before key characters eg '^{a}' not '{a}^'
COMMENT_3= : Wrap the character part (excluding ^+!#) in curly braces eg {1} for key 1
COMMENT_4= : Use Lowercase for alphabetic keys eg {a} not {A}
COMMENT_5= : Where multiple characters on same keyboard key, use the lower one.
COMMENT_6= : eg CTRL/SHIFT/ALT/a = '^+!{a}' and CTRL/F1 = '^{F1}'
COMMENT_7= : Hotkeys must not be in use by system nor by VirtualDub FilterMod main window.
COMMENT_8= : More=http://www.autoitscript.com/autoit3/docs/functions/Send.htm
COMMENT_9= : More=http://www.autoitscript.com/autoit3/docs/functions/HotKeySet.htm
COMMENT10= : Count of currently modified HotKeys = 0
KEY_DeleteFrame=^{DELETE}
KEY_DeleteRange=^+{DELETE}
KEY_CopyFrameFromSourcePrevious=^{F1}
KEY_CopyFrameFromSourceNext=^{F2}
KEY_ReplaceFrameWith_FX1=^{1}
KEY_ReplaceFrameWith_FX2=^{2}
KEY_ReplaceFrameWith_FX3=^{3}
KEY_ReplaceFrameWith_FX4=^{4}
KEY_ReplaceFrameWith_FX5=^{5}
KEY_ReplaceFrameWith_FX6=^{6}
KEY_ReplaceFrameWith_FX7=^{7}
KEY_ReplaceFrameWith_FX8=^{8}
KEY_ReplaceFrameWith_FX9=^{9}
KEY_ReplaceRangeWith_FX1=^+{1}
KEY_ReplaceRangeWith_FX2=^+{2}
KEY_ReplaceRangeWith_FX3=^+{3}
KEY_ReplaceRangeWith_FX4=^+{4}
KEY_ReplaceRangeWith_FX5=^+{5}
KEY_ReplaceRangeWith_FX6=^+{6}
KEY_ReplaceRangeWith_FX7=^+{7}
KEY_ReplaceRangeWith_FX8=^+{8}
KEY_ReplaceRangeWith_FX9=^+{9}
KEY_Interpolate_1=^+!{1}
KEY_Interpolate_2=^+!{2}
KEY_Interpolate_3=^+!{3}
KEY_Interpolate_4=^+!{4}
KEY_Interpolate_5=^+!{5}
KEY_Interpolate_6=^+!{6}
KEY_Interpolate_7=^+!{7}
KEY_Interpolate_8=^+!{8}
KEY_Interpolate_9=^+!{9}
KEY_InterpolateRange=^+!{/}
KEY_NotepadSaveAndRefresh=^+!{,}
[UserComment]
Comment=QWERTY_UK
##############
A Bit More
A SawBones created Command file may look something like this:-
(Later commands take presidence so order does matter, Interpolated ranges CANNOT be replaced[error in FrameSurgeon] but can be later deleted)
##############
DEL 400,449 # Delete frames 400 to 449 (AFTER ALL replacments done, ie as if at end of command file)
I3 10 # Interp 3 frames 10 -> 12, using 9 and 13 as source
CP 40 # Replace frame 40 with frame 39
CN 41 # Replace frame 41 with frame 42
FX1 50,199 # replace range 50,199 with same range from FX1 clip
FX2 300,599 # replace range 300,599 with same range from FX2 clip
##############
EDIT: Multiple deletes on same frame will result in only a single deletion.
Good night.
EDIT: Number of non default User Hotkey shown in sawbones via ToolTip when switch to VDFM window.
Also shows any UserComment that is set in ini file, eg QWERTY_UK by default.
Also shows RangeEndIsExclusive status if non default.
abolibibelot
4th January 2018, 03:24
Sometimes there's a bug when using SawBones, for instance instead of typing “I2 25474” it types “I2 254è4”, I had another instance where the last digit was replaced by a “"” (quotation sign).
Also, when I try the save/reload hotkey (or if I just type F2 to reload the script), I get an error :
Avisynth open failure:
Evaluate: System exception - Access Violation
([GScript], line 187)
([GScript], line 188)
([GScript], line 189)
([GScript], line 219)
(G:\20131224 M2TS\20151224 pour encodage.avs, line 552)
(G:\20131224 M2TS\20151224 pour encodage.avs, line 4)
Could it be because the script is also open in AVSPmod ?
If I reload the script by drag-and-drop, I get another error :
Avisynth open failure:
ClipClop: ERROR, CMD Line 22 *NON PARSE* $I1 1766& @ &
([GScript], line 218)
([GScript], line 219)
(G:\20131224 M2TS\20151224 pour encodage.avs, line 552)
(G:\20131224 M2TS\20151224 pour encodage.avs, line 4)
Oh, right, that one is caused by another wonky line : “I1 1766&”.
Sorry, you cant do that. You can interpolate OR FXn replace[denoise], after all interpolations/replacments done, then can delete frames.
ClipClop [Replacement/Interpolations] are further (afterwards) processed, by Prune[range deletions] filter.
I should have been more clear : my script contains a SMDegrain filter for a large part of the footage, including the sequences that need frame fixing. So far I did this :
AVISource("I:\20131224\20151224.avi")
ConvertToYV12(matrix="Rec709")
S1 = Trim(0, 360)
S2 = Trim(361, 18883).SMDegrain(thSAD=200)
S3 = Trim(18884, 22819)
S4 = Trim(22820, 63800).SMDegrain(thSAD=200)
S5 = Trim(63801, 81930)
S6 = Trim(81931, 83390).SMDegrain(thSAD=200)
S7 = Trim(83391, 84190).SMDegrain(thSAD=400)
S8 = Trim(84190, 0).SMDegrain(thSAD=200)
S1 ++ S2 ++ S3 ++ S4 ++ S5 ++ S6 ++ S7 ++ S8
*** frame fixing functions added here ***
So, should I first fix the frames, then denoise (if denoising affects the interpolating process in a bad way), or the other way around (if it improves it rather), or it doesn't matter ? Also, can the order of the filters affect the global processing speed ?
Anyway, I'm knackered and gonna get some shuteye, so, find SawBones-v1.05_Beta2-20180104 on SendSpace (below in my Sig) or here:- https://www.sendspace.com/file/ge6c0v
Thanks a lot, you're tremendously helpful. I'll try it right away. Good night too.
abolibibelot
4th January 2018, 05:08
So, after replacing the SawBones.exe file with the 1.05 beta version, I tried to edit the .ini file, changing the first interpolate hotkeys to ^+!{x} (x, c, v, b, n for 1, 2, 3, 4, 5), but it doesn't work, the former hotkeys are still active (also tried ^+{x}, both can be used for a shortcut). I terminated the SawBones process, closed VDFM, re-opened VDFM, re-launched SawBones, to no avail.
I still get random erroneous characters like :
I1 2561à
I1 25612
I1 25616
I1 25621
I1 25623
I1 25627
I1 25633
I1 25636
I1 25638
I1 25-50
I1 2565(
But at least I'm moving forward at a less excruciatingly slow pace ! :)
StainlessS
4th January 2018, 21:26
OOps sorry, I re-posted the same link as the previous one, I'de copied zip to a temp folder, and then from inside SentSpace wizard, went to wrong temp folder and re-uploaded the previous version, again. :( :( :(
Sorry again, :( [EDIT: I told you I was Knackered :) ]
StainlessS
5th January 2018, 02:08
Here SawBones-v1.06_Beta-20180105.zip:- LINK REMOVED
Several bug fixes, I think that you may find all of your problems have disappeared.
I had done a few silly mistakes that did not affect me, only non qwerty users.
I need a good slap on the wrist, sorry [Again].
StainlessS
10th January 2018, 05:55
About Shortcuts and what I said about it not being possible to link a hotkey with the program that set it,
well, just updated the whole lot [EDIT: About 200 utils] of my NirSoft catalog of utils, and ShortcutsMan, now identifies the program that sets a particular hotkey.
https://www.nirsoft.net/utils/shman.html
NOTE, I had to disable Comodo DNS and switch to Open DNS, as Comodo just would not let me go there, a real pain sometimes that
Comodo stuff. NirSoft is an absolutely brilliant collection of utils, but gets a bad rep with AV software as it has quite a few
password viewing/recovery utils etc, so should perhaps be shown as Pups (Potentially Unwanted Programs), but Comodo DNS
dont give me the opportunity to override it, so Comodo DNS is now out.
https://s20.postimg.cc/9jjgpuwel/Shorts.jpg (https://postimages.cc/)
Aint nuttin to be scared of, even M$ bundles NirSoft's USBDeview with some stuff.
EDIT: Also InstalledCodec is NirSoft, I'm sure many already use that.
EDIT: Also, the many Live boot CD's that are knocking about, quite often use a dozen or more Nirsoft utils,
Hiren CD/USB probably uses about 50+ Utils from Nirsoft.
EDIT: The linked page makes no mention of OS's after XP, just tried with Windows 10 and works fine.
EDIT: Shortcuts Map, also works (only tested on XP) if you are scared of nirSoft:- http://www.zealsoft.com/shortcuts/index.html
EDIT: One of the NirSoft utils is called something like QuickDNS, lets you switch DNS at the click of a button,
gonna use that and Comodo as primary DNS except where is being awkward.
EDIT: To config Comodo Firewall for maximum security search "How to configure Comodo Internet Security",
on youtube clip @ 33:58 or here:- "https://www.youtube.com/watch?v=4hCoT3fCTxM
You can also set it up with multiple DNS in "Network Zones" (not shown in clip), so that clicking alternate DNS in NirSoft QuickDNS is all that is needed to switch. [You set multiple IP addresses in a Network Zone, and use the named NetWork Zone rather than IP addresses when configuring the firewall 'Application Rules' for svchost.exe].
StainlessS
14th January 2018, 00:52
abolibibelot,
You do not seem to have been online since the 4th, please if you do come back respond, give us a clue, please. You may assist a lot more than yourself. thanx.
abolibibelot
4th December 2018, 05:36
So I'm revisiting this thread only now, sorry for being so slow... é_è
I managed to finish that daunting task in May, after several delays, ending up with more than 4800 FrameSurgeon commands created by checking about 35min. of 29.97 FPS footage frame by frame, which amounts to about 50.000 frames, most of which showing a wooden coffin with my grandmother inside... Sawbones was a huge time saver, and a definite sanity saver !
@StainlesS : On what particular subject did you need a feedback ?
As I said, there were some errors every now and then, some digits substituted by letters or other characters which I had to manually correct. It may or may not depend upon the speed at which I pressed the 4 keys, in a quite awkward hand position (CTRL + ALT + SHIFT + [number]), sometimes in very quick succession once I got immersed in the task, checking ~5 frames per second. I began with v. 1.04 and ended with v. 1.09.
Right now I'm trying to improve that movie ever-so-slightly, by performing the interpolations on the source files rather than the final export from the NLE software as I did previously (some damaged frames were at crossfades so I couldn't repair them satisfyingly). I managed to calculate the shifted values for each script by examining the script opened in AVSPMod, the timeline in the NLE software (positioning each cut sequence next to the complete source file, at the corresponding position), and the first version of the completed movie opened in VirtualDub2.
I'm also looking for possible improvements in interpolation functions over the past few months. FrameSurgeon, although a very good performer overall, sometimes generates ugly artifacts on frames with fast action.
But first I have to solve an issue with the Morph function, which I used for some of those frames on the rare occasions where it produced a better result than FrameSurgeon : with the same command as before, for instance Morph(137,139), I obtain a blend of frame 137 and the last frame of the input, instead of frame 139. I may have to create a dedicated thread for that.
StainlessS
4th December 2018, 18:12
On what particular subject did you need a feedback ?
Here SawBones-v1.06_Beta-20180105.zip:- LINK REMOVED
Several bug fixes, I think that you may find all of your problems have disappeared.
I had done a few silly mistakes that did not affect me, only non qwerty users.
Since then has elevated to v1.09, where I had to guess whether it worked for you or not (guess link posted day after your previous visit was probably OK).
As I said, there were some errors every now and then, some digits substituted by letters or other characters which I had to manually correct.
Yep, probably fixed as stated above.
Best source to use is always gonna be from lossless (ideally AVI, reliable frame exact), also note, FrameSurgeon switches OFF scene change detection [thSCD1 & thSCD2] in MvTools, (as Sawbones/FrameSurgeon is user driven, and user presumably thought result was good).
Where bad result, dont mark for use in Framesurgeon, must process later (perhaps with some mvtools solution and with thSCD1 & thSCD2 not switch off, where will probably result in blend / or frame copy depending upon mvtools blend arg).
and the last frame of the input, instead of frame 139. I may have to create a dedicated thread for that.
I'll take a look and see if I can spot an error in source.
EDIT: Maybe I should make thSCD1 & thSCD2 switch off optional.
EDIT: SawBones/FrameSurgeon thread with current v1.09:- https://forum.doom9.org/showthread.php?t=173158&highlight=SawBones
abolibibelot
4th December 2018, 20:39
I'll take a look and see if I can spot an error in source.
Just to be clear, I have this issue with Morph, not FrameSurgeon. I created a new thread which details this particular issue (among other things – perhaps too many things at once !...). I verified, the code is strictly identical to what I copied from this thread in January, and it worked flawlessly then :
https://forum.doom9.org/showthread.php?t=161154
As I said in that thread I created today, StaxRip apparently changed something in the Avisynth+ directory, but I can't figure out what exactly, or determine if it's indeed related with that issue.
I also get this message when opening AVSPMod :
“Error parsing plugin string at position 0:”
And nothing else, so I don't know what the exact problem is...
Best source to use is always gonna be from lossless (ideally AVI, reliable frame exact)
Well, as far as I understand it, loading any source in Avisynth produces the equivalent of a lossless video stream for all the processing filters which are applied in the script... Or did you mean something else ?
also note, FrameSurgeon switches OFF scene change detection [thSCD1 & thSCD2] in MvTools, (as Sawbones/FrameSurgeon is user driven, and user presumably thought result was good).
I'm not sure I understand that part... What does switching off scene change detection entail in this case ?
Where bad result, dont mark for use in Framesurgeon, must process later (perhaps with some mvtools solution and with thSCD1 & thSCD2 not switch off, where will probably result in blend / or frame copy depending upon mvtools blend arg).
Not sure I understand this either ! :)
I've read threads where it was reported that MVTools would produce that kind of artifacts with sources in resolutions higher than 1280x720 :
https://letransfert.soforums.com/t618-L-interpolation-avec-Interframe-SVPFLOW-VS-MVTOOLS2.htm
https://forum.doom9.org/showthread.php?t=165075
Those threads are several years old, do you know if there has been any progress since then ?
Thanks for your quick feedback !
StainlessS
4th December 2018, 21:17
Which Morph() function, 2nd post ? (there are several with same name).
EDIT: In this thread:- https://forum.doom9.org/showthread.php?t=161154
No idea about AvsPMod, I dont use it.
AviSource is frame accurate, others, not always so. (Other source filters may deliver wrong frame, unless accessed linearly).
If mvTools thinks bad match (via thSCD1, & thSCD2) then skips interpolate and instead either uses simple blend, or copies previous
frame (depends upon mvtools MFlowiInter Blend arg).
would produce that kind of artifacts with sources in resolutions higher than 1280x720
Not limited to higher rez.
abolibibelot
4th December 2018, 22:08
Which Morph() function, 2nd post ? (there are several with same name).
That one :
https://forum.doom9.org/showthread.php?p=1620927#post1620927
If myTools thinks bad match (via thSCD1, & thSCD2) then skips interpolate and instead either uses simple blend, or copies previous
frame (depends upon mvtools MFlowiInter Blend arg).
Here's an example of a frame processed by Morph (I made this screenshot in January, when it did work) :
16607
And the same processed by FrameSurgeon :
16608
There's a panning movement and some jerkiness in that shot so it's understandable that the interpolated frame is still blurry, but here it looks like FrameSurgeon is trying hard to mix the two adjacent frames and produces those fuzzy edges, which look definitely worse than simply blending the frames as Morph does. Could there be a way to adjust this behaviour by tweaking some parameters in the FrameSurgeon script ?
StainlessS
5th December 2018, 03:36
Could there be a way to adjust this behaviour by tweaking some parameters in the FrameSurgeon script ?
I'll change it.
Wanna give this a whirl.
Morpheus.Avs
/*
Morpheus(), Just like you dreamed it to be :)
Interpolate frames using a Command list of frames in String or in file.
Req RT_Stats v1.43+, Avs+ or GScript, Grunt, MvTools, RemoveGrain, CallCmd (optional, auto deletes DBase).
Planar YUV.
Function Morpheus(clip c,String Cmd,Bool "Inclusive"=True,
\ Int "SPad"=16, Int "SSharp"=1, Int "SRFilter"=4, [* MSuper *]
\ Int "ABlkSize"=16, Int "AOverlap"=4, Int "ASearch"=3,Int "ADct"=0, [* MAnalyse *]
\ Int "RBlkSize"=8, Int "ROverlap"=2, Int "RthSAD"=100, [* MRecalculate *]
\ Float "Iml"=200.0, Bool "IBlend"=True, Int "IthSCD1"=400, Int "IthSCD2"=130, [* MFlowInter *]
\ Bool "Show"=True )
Args:-
Cmd, No default. If first character is Asterisk, then is a command string list, otherwise a command list filename.
Commands consist of frame numbers, Frame numbers can be either COMMA(,) or SPACE separated and can be
followed by a # comment (one interpolation command per line).
If Inclusive == True then commands must be start and end of frames to Interpolate, eg
10,11 # Two frames, frame 10 and 11 are to be interpolated using frames 9 and 12 as source.
15 # single frame interpolated at frame 15, with src frames 14 and 16.
20,-2 # Two frames interpolated at frames 20 and 21 with Src frames 19 and 22.
If Inclusive == False (Exclusive) then command frames must be those either side of Interpolated frames ie src frames.
9,12 # Two frames, frame 10 and 11 are to be interpolated using frames 9 and 12 as source.
14,16 # single frame interpolated at frame 15, with src frames 14 and 16.
19,22 # Two frames interpolated at frames 20 and 21 with Src frames 19 and 22.
Inclusive, Default True.
If True, Commands specify the start and end frames to interpolate (single start frame allowed).
If False, Commands specify the TWO source frames used to create the interpolated frames that lie between them.
MvTools2 Args, for Interpolation.
MSuper args:
SPad, Default 16, See MvTools MSuper(hpad=8,vpad=8) [We use same for both].
SSharp, Default 1, See MvTools MSuper(sharp=2)
SRFilter, Default 4, See MvTools MSuper(rfilter=2)
MAnalyse args:
ABlkSize, Default 16, See MvTools MAnalyse(BlkSize=8,BlkSizeV=8) [We use same for both].
AOverLap, Default 4, See MvTools MAnalyse(OverLap=0)
ASearch, Default 3, See MvTools MAnalyse(Search=4)
ADct, Default 0, See MvTools MAnalyse(Dct=0). Using other than default value can be VERY slow.
MRecalculate args:
RBlkSize, Default 8, See MvTools MRecalculate(BlkSize)
NOTE, RBlkSize = 0 Will Switch OFF MRecalculate, probably a bit faster at possible expense of quality.
ROverlap, Default 2, See MvTools MRecalculate(Overlap)
RthSAD, Default 100, See MvTools MRecalculate(thSAD=200)
MFlowInter args:
Iml, Default 200.0, See MvTools MFlowInter(ml=100.0)
IBlend, Default True, See MvTools MFlowInter(Blend=True). Blend or copy frame at scene change.
IthSCD1, Default 400, See MvTools MFlowInter(thSCD1=400) : (0 < IthSCD1 <= (8*8)*255)
IthSCD2, Default 130, See MvTools MFlowInter(thSCD1=130) : (0 < IthSCD1 <= 255)
Threshold which sets how many blocks have to change for the frame to be considered as a
scene change. It is ranged from 0 to 255, 0 meaning 0 %, 255 meaning 100 %.
Default is 130 (which means 51.0%).
Used by MvTools2 MFlowInter during interpolation.
Show, Default False. Show Interpolated frames.
Remainder are MvTools Interpolation args, See MvTools.
*/
Function Morpheus(clip c,String Cmd,Bool "Inclusive",
\ Int "SPad", Int "SSharp", Int "SRFilter", [* MSuper *]
\ Int "ABlkSize", Int "AOverlap", Int "ASearch",Int "ADct", [* MAnalyse *]
\ Int "RBlkSize", Int "ROverlap", Int "RthSAD", [* MRecalculate *]
\ Float "Iml", Bool "IBlend", Int "IthSCD1", Int "IthSCD2", [* MFlowInter *]
\ Bool "Show"
\ ) {
c myName="Morpheus: "
IsAvsPlus=(FindStr(UCase(versionString),"AVISYNTH+")!=0) HasGScript=RT_FunctionExist("GScript")
HasGRunt =RT_FunctionExist("GScriptClip") HasMvTools=RT_FunctionExist("MSuper")
HasRemoveGrain=RT_FunctionExist("RemoveGrain") HasCallCmd =RT_FunctionExist("CallCmd")
IsAvs26=VersionNumber>=2.6
Assert(IsAvsPlus || HasGScript,RT_String("%sNeed either GScript or AVS+",myName))
Assert(HasGRunt,RT_String("%sNeed GRunt:-https://forum.doom9.org/showthread.php?t=139337 ",myName))
Assert(HasMVTools,RT_String("%sNeed MvTools2:-http://forum.doom9.org/showthread.php?t=131033",myName))
Assert(HasRemoveGrain,RT_String("%sNeed RemoveGrain",myName))
Assert(IsYV12||(IsAvs26&&(IsY8||IsYV16||IsYV24)),RT_String("%sOnly Standard v2.6 Planar Supported (excepting YV411)",myname))
Assert(Cmd!="",String("%sCmd cannot be ''",myName))
Inclusive = Default(Inclusive,True)
SPad = Default(SPad,16) SSharp = Default(SSharp,1) SRFilter= Default(SRFilter,4)
ABlkSize = Default(ABlkSize,16) AOverlap= Default(AOverlap,4) ASearch = Default(ASearch,3) ADct = Default(ADct,0)
RBlkSize = Default(RBlkSize,8) ROverlap= Default(ROverlap,2) RthSAD = Default(RthSAD,100)
Iml = Default(Iml,200.0) IBlend = Default(IBlend,True) IthSCD1 = Default(IthSCD1,400) IthSCD2= Default(IthSCD2,130)
Show = Default(Show,False)
####
FuncS="""
Function ChrIsNul(String S) {return RT_Ord(S)== 0}
Function ChrIsHash(String S) {return RT_Ord(S)==35}
Function ChrIsStar(String S) {return RT_Ord(S)==42}
Function ChrIsComma(String S) {return RT_Ord(S)==44}
Function ChrIsHyphen(String S) {return RT_Ord(S)==45}
Function ChrIsDigit(String S) {C=RT_Ord(S) return C>=48&&C<=57}
Function ChrEatWhite(String S) {i=1 C=RT_Ord(S,i) While(C==32||C>=8&&C<=13) {i=i+1 C=RT_Ord(S,i)} return i>1?MidStr(S,i):S}
Function ChrEatDigits(String S) {i=1 C=RT_Ord(S,i) While(C>=48&&C<=57) {i=i+1 C=RT_Ord(S,i)} return i>1?MidStr(S,i):S}
Function Fn@@@(clip c,String DB,Bool Show,String Fmt1,String Fmt2) {
c n=current_frame
if(RT_DBaseGetField(DB,n,0)) { # Is an Interpolated frame
Start = RT_DBaseGetField(DB,n,1) # Start of Interpolated Frames (Inclusive)
End = RT_DBaseGetField(DB,n,2) # End of Interpolated Frames (Inclusive)
Count = End - Start + 1 # Count of Interpolated frames in this run
Index = n-Start # Index into Count (0 relative, 0 -> Count-1)
OFrms=4 # Max number of frames to use from either side of Interpolated run (Src Frames, before & after)
LS=Max(Start-OFrms,0)
LCnt=Start-LS RCnt=Min(c.FrameCount-1-End,OFrms)
TmpC = c.Trim(LS,-LCnt) + c.Trim(End+1,-RCnt) # Src used for interpolation, (with some extra frames[higher quality sometimes])
FixFrm=LCnt-1 # Frame where Interpolated frame will be created
Prefilt=TmpC.RemoveGrain(22)
Pad=SPad@@@ Sharp=SSharp@@@ srfilter=SRFilter@@@ Ablksize=ABlkSize@@@ AOverLap=AOverLap@@@ ASearch=ASearch@@@ ADct=ADct@@@
Super=TmpC.MSuper(hpad=Pad,vpad=Pad,levels=1,sharp=Sharp,rfilter=srfilter)
Superfilt=Prefilt.MSuper(hpad=Pad,vpad=Pad,sharp=Sharp,rfilter=srfilter)
bv=Superfilt.MAnalyse(isb=true ,blksize=Ablksize,overlap=AOverLap,search=ASearch,delta=1,dct=ADct)
fv=Superfilt.MAnalyse(isb=False ,blksize=Ablksize,overlap=AOverLap,search=ASearch,delta=1,dct=ADct)
RBlkSize=RBlkSize@@@
if(RBlkSize>0) {
ROverLap=ROverLap@@@ RthSAD=RthSAD@@@
bv=Super.MRecalculate(bv,blksize=RBlkSize,overlap=ROverLap,thSAD=RthSAD)
fv=Super.MRecalculate(fv,blksize=RBlkSize,overlap=ROverLap,thSAD=RthSAD)
}
TmpC=TmpC.MFlowInter(Super,bv,fv,time=100.0*(Index+1)/(Count+1),ml=Iml@@@,blend=IBlend@@@,thSCD1=IthSCD1@@@,thSCD2=IthSCD2@@@)
TmpC.Trim(FixFrm,-1) # Interpolated Frame to return
if(Show) { RT_Subtitle(Fmt2,n,Index+1,Count) }
} Else if(Show) { RT_Subtitle(Fmt1,n) }
Return Last
}
if(ChrIsStar(CMD)) {
CMD=MidStr(CMD,2)
} else {
Cmd=RT_GetFullPathName(Cmd)
Assert(Exist(CMD),RT_String("%sCMD File does not exist",myName))
CMD=RT_ReadTxtFromFile(CMD)
}
LINES=RT_TxtQueryLines(CMD) FC=Framecount
DB = RT_GetFullPathName("~@@@_"+RT_LocalTimeString+".DB") RT_DBaseAlloc(DB,FrameCount,"bii")
for(i=0,LINES-1) {
SS=RT_TxtGetLine(CMD,i).ChrEatWhite
S=SS
if(!S.ChrIsNul && !S.ChrIsHash) {
if(S.ChrIsDigit) {
StartF = S.RT_NumberValue
EndF=StartF
S=S.ChrEatDigits.ChrEatWhite
if(S.ChrIsComma) {S=S.MidStr(2).ChrEatWhite}
IsNeg = S.ChrIsHyphen
if(IsNeg) {S=S.MidStr(2).ChrEatWhite}
if(S.ChrIsDigit) {
EndF=S.RT_NumberValue
if(IsNeg) {
Assert(Inclusive,RT_String("%sCMD: Error@Line_%d, Exclusive End Frame Cannot be -ve\n%s",myName,i+1,SS))
EndF=StartF+EndF-1
}
S=S.ChrEatDigits
} Else if(!Inclusive) {
Assert(False,RT_String("%sCMD: Error@Line_%d, Exclusive must have End Frame\n%s",myName,i+1,SS))
} Else if(IsNeg) { Assert(False,RT_String("%sCMD: Error@Line_%d, Expecting End Frame\n%s",myName,i+1,SS)) }
Start_I = (Inclusive) ? StartF : StartF+1
End_I = (Inclusive) ? EndF : EndF-1
Assert(Start_I>0,RT_String("%sCMD: Error@Line_%d, Illegal Start frame\n%s",myName,i+1,SS))
Assert(End_I<FC-1,RT_String("%sCMD: Error@Line_%d, EndFrame(%d)+1 Out Of Clip\n%s",myName,i+1,End_I+1,SS))
Inclusive
\ ? Assert(Start_I<=End_I,RT_String("%sCMD: Error@Line_%d, StartFrame(%d) <= EndFrame(%d)\n%s",myName,i+1,Start_I,End_I,SS))
\ : Assert(StartF<EndF-1,RT_String("%sCMD: Error@Line_%d, None to interpolate, Start(%d) End(%d)\n%s",myName,i+1,StartF,EndF,SS))
for(n=Start_I,End_I) { RT_DBaseSet(DB,n,True,Start_I,End_I) }
S=S.ChrEatWhite
}
if(!S.ChrIsHash) { Assert(S.ChrIsNul,RT_String("%sCMD: Error@Line_%d, *** NON-PARSE ***\n'%s'",myName,i+1,SS)) }
}
}
Global SPad@@@=SPad Global SSharp@@@=SSharp Global SRFilter@@@=SRFilter
Global ABlkSize@@@=ABlkSize Global AOverLap@@@=AOverLap Global ASearch@@@=ASearch Global ADct@@@=ADct
Global RBlkSize@@@=RBlkSize Global ROverLap@@@=ROverLap Global RthSAD@@@=RthSAD
Global Iml@@@=Iml Global IBlend@@@=IBlend Global IthSCD1@@@=IthSCD1 Global IthSCD2@@@=IthSCD2
###
Fmt1="%d]"
Fmt2="%d] I%d/%d"
ARGS = "DB,Show,Fmt1,Fmt2"
ScriptLine = "Fn@@@("+ARGS+")"
Last.GScriptClip(ScriptLine, local=true, args=ARGS)
"""
GIFunc="MORPHEUS" # Function Name, Supply unique name for your multi-instance function.
GIName=GIFunc+"_InstanceNumber" # Name of the Instance number Global
RT_IncrGlobal(GIName) # Increment Instance Global (init to 1 if not already exists)
GID = GIFunc + "_" + String(Eval(GIName))
InstS = RT_StrReplace(FuncS,"@@@","_"+GID)
# Write Debug GScript File to current directory (line numbers will correspond to error messages)
# RT_WriteFile("DEBUG_"+GID+".TXT","%s",InstS)
HasGScript ? GScript(InstS) : Eval(InstS,"GS_EVAL") # Use GSCript if installed (loaded plugs override builtin)
# if CallCmd available, Auto delete DBase file on clip closure.
HasCallCmd?CallCmd(close=RT_String("""CMD /C chcp 1252 && del "%s" """,DB), hide=true, Synchronous=7):NOP
Return Last
}
Client
Colorbars(Pixel_type="YV12").KillAudio.ShowFrameNumber
INCLUSIVE=True
SHOW=True
INCLUSIVE_CMD="""* # <<<<==== Asterisk(Star) is first character, ie is a String Command, else is a Filename.
10 11 # This Is a Comment
15
20 -2
"""
EXCLUSIVE_CMD="""* # <<<<==== Asterisk(Star) is first character, ie is a String Command, else is a Filename.
9 12
14 16
19 22
"""
# Select Inclusive or Exclusive CMD depending upon value of INCLUSIVE
CMD = (INCLUSIVE) ? INCLUSIVE_CMD : EXCLUSIVE_CMD
Morpheus(Cmd,Inclusive=INCLUSIVE,Show=SHOW)
SEE POST #50 for better version
abolibibelot
5th December 2018, 07:34
Wanna give this a whirl.
I'm not sure if I used this correctly, I created a TXT file with just a frame number (138), and called Morpheus("G:\pathname\filename.txt"), apparently it worked (so if I understand this correctly it uses “inclusive” commands by default). The result on the same test frame is better than what I got when first testing FrameSurgeon in January, but for some reason, FrameSurgeon does better now than it did then, and slightly better than Morpheus here (actually it depends which area of the picture is considered, for instance the front of the bike is better with Morpheus); perhaps some of the associated plugins was updated since then, I couldn't say – or perhaps FrameSurgeon itself was improved ? There are still some fuzzy edges, but it's less pronunced, and the general outlines are about right. I'll have to test on a few other problematic frames.
Morpheus :
16610
FrameSurgeon (retried today on the same frame) :
16611
I'm not sure what the "Final" switch is for in FrameSurgeon.
StainlessS
5th December 2018, 11:52
if I understand this correctly
Yes.
The FINAL Switch in FrameSurgeon, if true then does the edits for real.
Otherwise, it only marks frames to DELETE (they are still there and are marked with a "DUMMY DELETE" type big red subtitle & border).
Below added to first post in Sawbones/FrameSurgeon thread.
When Final=False, Delete commands appear like so (marked for deletion only, only deleted for real when Final=True)
Set FINAL=False when using SawBones.
Reason:- If a frame were deleted for real in FrameSurgeon, then any deletes following that frame would (in sawbones) all be off by 1 frame.
Off by 1 frame thing would not affect non delete edits, as deletes are processed only after all other edits are done.
(SawBones/VirtualDub2, have no idea what Avisynth has deleted before clip was loaded into VirtualDub)
One additional advantage of the Dummy Delete frames is that you can see what will be deleted when FINAL=True.
https://s14.postimg.cc/qcekzk0y9/Morph.jpg (https://postimages.cc/)
SawBones/FrameSurgeon:- https://forum.doom9.org/showthread.php?t=173158&highlight=sawbones
EDIT: The MvTools type defaults are different in FrameSurgeon and Morpheus (something for you to play with),
Someone said not so long ago that MvTools arg, TrueMotion=False is better on HD clips (but dont remember where it was posted,
nor what if any other tweaks may give better results for HD).
Also, FrameSurgeon calculates interpolation clips before frame serving commences (quicker) whereas Morpheus calcs in real time.
Morpheus real time mode can by concatenating source frames, with some extra source frames (eg 3 frames before first interp
frame, and 3 frames after last interp frame) can produce a better result in some rarer cases according to other people (leastwise I
aint ever been able to see better results yet with my lousy eyes). FrameSurgeon precalc mode cannot do the extra source frames
trick (and never will be able to).
EDIT: I decided not to bother trying to fix the Morph() plug, Jenyok functions sometimes have 'undocumented features', and
tend to be a bit big and cumbersome, and I aint likely to use them. Also, Morph() style method tends to crap out after
something like 70 function calls with system exceptions, reason I did Morpheus() which should easily handle thousands of
interpolation seqs.
abolibibelot
5th December 2018, 15:27
The FINAL Switch in FrameSurgeon, if true then does the edits for real.
Otherwise, it only marks frames to DELETE (they are still there and are marked with a "DUMMY DELETE" type big red subtitle & border).
But... FrameSurgeon is supposed to interpolate frames, not delete them... so I still don't get it... :confused:
The MvTools type defaults are different in FrameSurgeon and Morpheus (something for you to play with),
Someone said not so long ago that MvTools arg, TrueMotion=False is better on HD clips (but dont remember where it was posted, nor what if any other tweaks may give better results for HD).
I don't find "TrueMotion" in the current FrameSurgeon.avsi script, should I add it, and where exactly ?
I decided not to bother trying to fix the Morph() plug, Jenyok functions sometimes have 'undocumented features', and
tend to be a bit big and cumbersome, and I aint likely to use them. Also, Morph() style method tends to crap out after
something like 70 function calls with system exceptions, reason I did Morpheus() which should easily handle thousands of
interpolation seqs.
Indeed it's way less stable, that's one of the reasons why I created this very thread (the script would crash with a few dozen calls, and I needed way more than that). But it's still useful as a complimentary function, for some tricky frames that it handles a bit better than FrameSurgeon. In the script I used for the final encoding of the first version of that movie, I made an extensive use of FrameSurgeon (about 4800 calls in the separate "command" file), and also called Morph for 12 frames ; for some frames neither one produced a good result so I left them untouched.
As for its current malfunction, it's most likely related with some problematic plugin or configuration issue on my system, as it used to work as intended. So do you know which plugins it relies on, and if one of them was updated recently, which could have changed the function's behaviour ?
I just compared the current Avisynth+ directory in my system partition with a Macrium Reflect backup made on September 29th, using WinMerge, only the differences are displayed :
16612
The "Setup Log 2018-10-26 #001.txt" file indicates that "AviSynthPlus-MT-r2728.exe" (included in StaxRip) has been installed on that date. Before that, I most likely had "AviSynthPlus-r1576.exe" installed.
EDIT : Is it normal that all the pictures I uploaded since yesterday are (still) marked “pending approval”, and don't appear where they should ?
StainlessS
5th December 2018, 16:15
But... FrameSurgeon is supposed to interpolate frames, not delete them... so I still don't get it...
A bit more than that.
All SawBones Keyboard commands that are inserted into NotePad command Text file:-
CTRL/F1 CopyFromPrevious frame to current frame (ie replace source current frame n with source frame n - 1. (CP n)
CTRL/F2 CopyFromNext frame to current frame (ie replace source current frame n with source frame n + 1. (CN n)
CTRL/1 Replace current frame with same frame from FX1 clip. (FX1 n)
CTRL/2 Replace current frame with same frame from FX2 clip. (FX2 n)
CTRL/3 Replace current frame with same frame from FX3 clip. (FX3 n)
CTRL/4 Replace current frame with same frame from FX4 clip. (FX4 n)
CTRL/5 Replace current frame with same frame from FX5 clip. (FX5 n)
CTRL/6 Replace current frame with same frame from FX6 clip. (FX6 n)
CTRL/7 Replace current frame with same frame from FX7 clip. (FX7 n)
CTRL/8 Replace current frame with same frame from FX8 clip. (FX8 n)
CTRL/9 Replace current frame with same frame from FX9 clip. (FX9 n)
CTRL/SHIFT/1 Replace range with same range from FX1 clip. (FX1 s,e)
CTRL/SHIFT/2 Replace range with same range from FX2 clip. (FX2 s,e)
CTRL/SHIFT/3 Replace range with same range from FX3 clip. (FX3 s,e)
CTRL/SHIFT/4 Replace range with same range from FX4 clip. (FX4 s,e)
CTRL/SHIFT/5 Replace range with same range from FX5 clip. (FX5 s,e)
CTRL/SHIFT/6 Replace range with same range from FX6 clip. (FX6 s,e)
CTRL/SHIFT/7 Replace range with same range from FX7 clip. (FX7 s,e)
CTRL/SHIFT/8 Replace range with same range from FX8 clip. (FX8 s,e)
CTRL/SHIFT/9 Replace range with same range from FX9 clip. (FX9 s,e)
CTRL/SHIFT/ALT/1 Interpolate current frame n using source n-1 and n+1 as source frames. (I1 n)
CTRL/SHIFT/ALT/2 Interpolate 2 frames starting at current frame n, using source n-1 and n+2 as source frames. (I2 n)
CTRL/SHIFT/ALT/3 Interpolate 3 frames starting at current frame n, using source n-1 and n+3 as source frames. (I3 n)
CTRL/SHIFT/ALT/4 Interpolate 4 frames starting at current frame n, using source n-1 and n+4 as source frames. (I4 n)
CTRL/SHIFT/ALT/5 Interpolate 5 frames starting at current frame n, using source n-1 and n+5 as source frames. (I5 n)
CTRL/SHIFT/ALT/6 Interpolate 6 frames starting at current frame n, using source n-1 and n+6 as source frames. (I6 n)
CTRL/SHIFT/ALT/7 Interpolate 7 frames starting at current frame n, using source n-1 and n+7 as source frames. (I7 n)
CTRL/SHIFT/ALT/8 Interpolate 8 frames starting at current frame n, using source n-1 and n+8 as source frames. (I8 n)
CTRL/SHIFT/ALT/9 Interpolate 9 frames starting at current frame n, using source n-1 and n+9 as source frames. (I9 n)
CTRL SHIFT ALT / Interpolate Range. Ie in Avisynth Inclusive mode, where range is 100,101 [2 frames] then result = (I2 100)
The specified range start and end are the outer bad frames.
You can change this key combination used for "Interpolate Range" by changing the ini file item
"KEY_InterpolateRange=^+!{/}", to something else, in sequence they are CTRL(^) SHIFT(+), ALT(!) and '/' keys
pressed together. The Sawbones.ini file is created upon first use of the executable.
CTRL/DELETE Delete current frame. (DEL n) [FrameSurgeon Frame/Range deletes are processed AFTER ALL interpolations/replacements]
CTRL/SHIFT/DELETE Delete range (DEL s,e)
NOTE. If using below "Save & Refresh" with Avisynth loaded script, then DO NOT USE ANY delete commands
within SawBones UNLESS, you call FrameSurgeon with arg "FINAL=FALSE". The FrameSurgeon arg FINAL=FALSE,
causes FrameSurgeon to NOT actually delete frames, it will only MARK those frames as being targetted for deletion
(the frames will show some kind of DUMMY_DELETE text subtitled onto those frames). If you do not call FrameSurgeon with
FINAL=FALSE, then FrameSurgeon will indeed delete the frames, but VDub2/Sawbones will have no idea that
it has been done, and further replacements or deletions will be on the WRONG ranges.
IMPORTANT:- See also below Save & Refresh command.
EDIT: And the actual commands inserted by SawBones into command file and processed by FrameSurgeon.
Supported commands In SCmd and Cmd.
(where n=frame number, s= range start frame, e=range end frame, d is a digit, '1' to '9', i is a count.
NOTE, e range End Frame behaves as in trim eg -20 means 20 frames starting at frame s, e=0 means to last frame):-
"CP n" CopyFromPrevious ie replace source clip c frame n with source clip c frame n - 1.
"CN n" CopyFromNext ie replace source clip c frame n with source clip c frame n + 1.
#
"I1 n" Interpolate 1 frame n (using source frames n-1 and n+1 as Interpolation source frames, (Id commands Planar, YUY2 only).
"I2 n" Interpolate 2 frames starting at frame n, (using source frames n-1 and n+2).
"I3 n" Interpolate 3 frames starting at frame n, (using source frames n-1 and n+3).
"I4 n" Interpolate 4 frames starting at frame n, (using source frames n-1 and n+4).
"I5 n" Interpolate 5 frames starting at frame n, (using source frames n-1 and n+5).
"I6 n" Interpolate 6 frames starting at frame n, (using source frames n-1 and n+6).
"I7 n" Interpolate 7 frames starting at frame n, (using source frames n-1 and n+7).
"I8 n" Interpolate 8 frames starting at frame n, (using source frames n-1 and n+8).
"I9 n" Interpolate 9 frames starting at frame n, (using source frames n-1 and n+9).
"I n" Interpolate 1 frame n (using source frames n-1 and n+1 as Interpolation source frames.
"I s,e" Interpolate range s to e (max range 9 frames, using source frames s-1 and e+1 as source frames).
"I s,-i" Interpolate frame count i, range s to s+i-1, (i max 9 frames, using source frames s-1 and s+i as source frames).
#
"FXd n" Replace frame n with same frame from FXd clip, eg "FX3 100" replace source frame 100 with same frame from FX3 clip.
"FXd s,e" Replace range s to e with same range from FXd clip.
"FXd s,0" Replace range s to end of clip with same range from FXd clip.
"FXd s,-i" Replace frame count i, range s to s+i-1, with same range from FXd clip.
(the hyphen '-' indicates that i is a count rather than the end frame of a range).
#
"DEL n" Delete frame n (Deletes are processed AFTER ALL Interpolations/replacements)
"DEL s,e" Delete frames s to e
"DEL s,0" Delete frames s to end of clip.
"DEL s,-i" Delete frame count i, range s to s+i-1.
"-n" Delete frame n
"-s,e" Delete frames s to e
"-s,0" Delete frames s to end of clip.
"-s,-i" Delete frame count i, range s to s+i-1.
NOTE, FrameSurgeon frame/range deletes have a 1ms linear FadeOut/FadeIn at splices simulating zero crossing, to prevent 'Cracks' in audio.
I don't find "TrueMotion" in the current FrameSurgeon.avsi script, should I add it, and where exactly ?
TrueMotion is an arg to MAnalyse (default True). Maybe I add something.
So far as I remember Morph only uses MvTools2 and builtin stuff. Maybe condition that caused problem was just a script error that occurs in rare circumstance.
(that would be my guess, ie undocumented feature).
JFYI, modding the various mvtools arg options in both FrameSurgeon and Morpheus would also produce different results, thats what they are for,
defaults are not always optimum, nor are they ever always likely to be.
[EDIT: eg, ADct in Morpheus (default 0) is supposed to usually produce better quality if 1, but is much slower (see MvTools docs)]
A Moderator once said that it is a good idea to Report your own post when waiting approval (little red triangle on bottom left of post).
Post #42 Updated.
abolibibelot
5th December 2018, 18:15
A bit more than that.
Oh, alright, I remember seeing that when I first got ahold of it, so it's normal if I don't see any effect with my interpolate-only scripts.
TrueMotion is an arg to MAnalyse (default True). Maybe I add something.
Alright, so it's not as simple as just adding that switch to one particular line in the script ?
JFYI, modding the various mvtools arg options in both FrameSurgeon and Morpheus would also produce different results, thats what they are for,
defaults are not always optimum, nor are they ever always likely to be.
Is there a guide somewhere explaining how to do this in a methodical way, singling out the most effective options, their advantages / drawbacks, in which situations they can help or not ?
So far as I remember Morph only uses MvTools2 and builtin stuff. Maybe condition that caused problem was just a script error that occurs in rare circumstance.
(that would be my guess, ie undocumented feature).
But the commands are the same as they were months ago, now it fails with the same frames it used to process correctly. And the mvtools2.dll is not among those which have been changed in the mean time.
Could it be related with multithreading, since apparently the newly installed version of Avisynth+ is multithreaded ? Can I check that without re-installing the former version, by adding a “threads=1” switch somewhere ? (I already have “threads=1” in the source loading line, and Morph produces the same result with LWLibavVideoSource or FFVideoSource.)
StainlessS
5th December 2018, 23:25
so it's normal if I don't see any effect with my interpolate-only scripts.
Yes, only deletes when you tell it to (it dont go in for 'jolly japes' [practical jokes, although, maybe I add some :) ]).
Alright, so it's not as simple as just adding that switch to one particular line in the script ?
I would probably (when I figure out what is best/least worst default) add an optional arg.
Is there a guide somewhere explaining ...
If you find one, let me know. (likely would be a sort of 'if its like this, do that, and if its like the other then do alternative, and if its a bit like both, then do something else').
Experimentation, and hard work is probably best way to understanding, although Zorr has 'Avisynth Optimizer' thread in Avisynth Development forum.
now it fails with the same frames
I know how much I trust my own memory, so forgive me for not being 100% convinced by yours :)
Only suggestion to re-install old stuff and check, then maybe start thread with concrete and provable and repeatable results.
EDIT: For HD, might wanna try in Morpheus, ABlksize=24(or 32,Default16), and maybe RBlkSize=16.
StainlessS
6th December 2018, 19:01
Someone said not so long ago that MvTools arg, TrueMotion=False is better on HD clips (but dont remember where it was posted,
nor what if any other tweaks may give better results for HD).
Twas the adorable Hello_Hello :) [And Grouch2004, and Didee (but of course they never were quite as adorable)].
https://forum.doom9.org/showthread.php?p=1855907#post1855907
StainlessS
6th December 2018, 23:31
New Version Morpheus, added one helluva lot of args, give it a whirl (Incl TrueMotion).
Morpheus.avs v0.02 Part 1 of 2.
/*
Morpheus() v0.02, Just like you dreamed it to be :)
Interpolate frames using a Command list of frames in String or in file.
Req RT_Stats v1.43+, Avs+ or GScript, Grunt, MvTools, RemoveGrain, CallCmd (optional, auto deletes DBase).
Planar YUV.
Function Morpheus(clip c,String Cmd,Bool "Inclusive"=True,
\ Int "Prefilter"=1, [* Prefilter *]
\ Int "SPad"=16, Int "SPel"=2, Bool "SChroma"=True, [* MSuper *]
\ Int "SSharp"=1, Int "SRFilter"=4, [* MSuper *]
\ Int "ABlkSize"=c.Width>1920?32:c.Width>1100?24:c.Width>720?16:8, Int "ABlkSizeV"=ABlkSize, [* MAnalyse *]
\ Int "ASearch"=3, Int "ASearchParam"=2, Int "APelSearch"=SPel, [* MAnalyse *]
\ Bool "AChroma"=SChroma, Bool "ATrueMotion"=ABlksize<16, [* MAnalyse *]
\ Int "AOverlap"=4, Int "AOverlapV"=AOverlap, [* MAnalyse *]
\ Int "ADct"=0, Bool "ATryMany"=False, [* MAnalyse *]
\ Int "RthSAD"=100, Int "RBlkSize"=ABlkSize/4*2, Int "RBlkSizeV"=RBlkSize, [* MRecalculate *]
\ Int "RSearch"=ASearch, Int "RSearchParam"=ASearchParam, [* MRecalculate *]
\ Bool "RChroma"=AChroma, Bool "RTrueMotion"=ATrueMotion, [* MRecalculate *]
\ Int "ROverlap"=RBlkSize>2?2:0, Int "ROverlapV"=ROverlap, Int "RDct"=ADct, [* MRecalculate *]
\ Float "Iml"=200.0, Bool "IBlend"=True, [* MFlowInter *]
\ Int "IthSCD1"=400, Int "IthSCD2"=130, [* MFlowInter *]
\ Bool "Show"=False
\ )
Args:-
Cmd, No default. If first character is Asterisk, then is a command string list, otherwise a command list filename.
Commands consist of frame numbers, Frame numbers can be either COMMA(,) or SPACE separated and can be
followed by a # comment (one interpolation command per line).
If Inclusive == True then commands must be start and end of frames to Interpolate, eg
10,11 # Two frames, frame 10 and 11 are to be interpolated using frames 9 and 12 as source.
15 # single frame interpolated at frame 15, with src frames 14 and 16.
20,-2 # Two frames interpolated at frames 20 and 21 with Src frames 19 and 22.
If Inclusive == False (Exclusive) then command frames must be those either side of Interpolated frames ie src frames.
9,12 # Two frames, frame 10 and 11 are to be interpolated using frames 9 and 12 as source.
14,16 # single frame interpolated at frame 15, with src frames 14 and 16.
19,22 # Two frames interpolated at frames 20 and 21 with Src frames 19 and 22.
Inclusive, Default True.
If True, Commands specify the start and end frames to interpolate (single start frame allowed).
If False, Commands specify the TWO source frames used to create the interpolated frames that lie between them.
MvTools2 Args, for Interpolation.
Prefilter, Default 1 (0->2). 0=c.Blur(0.6), 1=c.RemoveGrain(22), 2=c.RemoveGrain(1).RemoveGrain(22)
Applied to src to produce prefiltered clip for MSuper (avoid noise when getting initial vectors)
RemoveGrain(1) = Undot : RemoveGrain(22)~=MedianBlur
MSuper args:
SPad, Default 16, See MvTools MSuper(hpad=8,vpad=8) [We use same for both].
SPel, Default 2.
SChroma, Default True.
SSharp, Default 1, See MvTools MSuper(sharp=2)
SRFilter, Default 4, See MvTools MSuper(rfilter=2)
MAnalyse args:
ABlkSize, Default c.Width>1920?32:c.Width>1100?24:c.Width>720?16:8, See MvTools MAnalyse(BlkSize=8).
if c.Width>1920 then 32 Else if c.Width>1100 then 24 Else if c.Width>720 then 16 Else 8
ABlkSizeV, Default ABlkSize.
ASearch, Default 3, See MvTools MAnalyse(Search=4)
ASearchParam, Default 2.
APelSearch, Default SPel.
AChroma, Default SChroma
ATrueMotion, Default ABlksize<16 Then True Else False. See MvTools MAnalyse(truemotion=true)
AOverLap, Default 4, See MvTools MAnalyse(overlap=0)
AOverLapV, Default AOverLap.
ADct, Default 0, See MvTools MAnalyse(Dct=0). Using other than default value can be VERY slow.
ATryMany, Default False.
MRecalculate args:
RthSAD, Default 100, See MvTools MRecalculate(thSAD=200)
RBlkSize, Default ABlkSize/4*2, See MvTools MRecalculate(blksize)
NOTE, RBlkSize = 0 Will Switch OFF MRecalculate, probably a bit faster at possible expense of quality.
RBlkSizeV, Default RBlkSize. See MvTools MRecalculate(blksizeV)
RSearch, Default ASearch.
RSearchParam, Default ASearchParam.
RChroma, Default AChroma.
RTrueMotion, Default ATrueMotion.
ROverlap, Default RBlkSize>2?2:0.
ROverlapV, Default ROverlap.
RDct, Default ADct.
MFlowInter args:
Iml, Default 200.0, See MvTools MFlowInter(ml=100.0)
IBlend, Default True, See MvTools MFlowInter(Blend=True). Blend or copy frame at scene change.
IthSCD1, Default 400, See MvTools MFlowInter(thSCD1=400) : (0 < IthSCD1 <= (8*8)*255)
IthSCD2, Default 130, See MvTools MFlowInter(thSCD1=130) : (0 < IthSCD1 <= 255)
Threshold which sets how many blocks have to change for the frame to be considered as a
scene change. It is ranged from 0 to 255, 0 meaning 0 %, 255 meaning 100 %.
Default is 130 (which means 51.0%).
Used by MvTools2 MFlowInter during interpolation.
Show, Default False. Show Interpolated frames.
*/
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.