Log in

View Full Version : SmoothSkip - Repair skippy motion


joj
19th July 2015, 10:42
Latest version: 2.0.1 (updated 2021-09-11)

In tribute to tritical's awesome filter, this one tackles the inverse problem
of TDecimate; allowing for addressing frames that have non-smooth, skippy / juddery motion.

Example:
http://griffeltavla.files.wordpress.com/2015/07/smoothskip-fast.gif slowmo> http://griffeltavla.files.wordpress.com/2015/07/smoothskip-slow.gif

It is mostly a heuristic command and control (detect and act) filter and doesn't do any actual
image processing. The interpolation used in the sample above leveraged mvtools
and this filter just decided when to use frames from that alternate clip.

Script to create this, samples, further information as well as the source code
can be found on github (https://github.com/jojje/SmoothSkip).

Binary for download with source code included available here (https://github.com/jojje/SmoothSkip/releases).


SmoothSkip( altClip, int "cycle", int "create", int "offset", float "scene", bool "debug" )

*altclip*: The clip to pick frames from, to insert before the respective frames in a cycle having the highest frame difference
to their respective preceding ones. Mandatory option.

*cycle*: Number of consecutive frames forming a cycle between skips.
Typically it would be the number of frames between skips. If the distance of the frame skipping varies, a larger cycle can be
specified and number of frames to inject (create) in the cycle can also be raised so that an N in M cycle can be established.
Default: 4

*create*: Number of frames to create in a cycle.
This together with cycle forms the frequency of frame injection ("create" in "cycle"). For example if there is one skip seen in
each cycle and a cycle is 4 frames, then one new frame will be injected every 4 frames. Consequently the resulting clip will
have 5/4 as many frames and the frame rate increased by the same factor. If on the other hand, the cycle is less strict,
such as 3 frames in every 10-12 frames, then create can be set to 3 with a cycle of the upper observed bound (12 frames),
which will result in a 3 in 12 frame insertion ratio.
Default: 1

*offset*: Frame offset used to pick an insertion frame from the alternate clip (altclip).
When scripting AviSynth, users are prevented from accessing individual frames, as selecting frames is the purview of the
application leveraging AviSynth. Filter plugins however have greater flexibility and can pick and choose which frame to use
and this offset option gives you some flexibility in selecting replacement frames that do not necessarily reside at the same
frame number as the primary clip's. Of course, you could achieve the effect of fixed offset like this by using Trim and Loop,
so this is just a shorthand to save you from having to stitch and slice clips in the script.
Default: -1 (frame with number before current_frame)

*scene*: Scene detection threshold.
Any frame difference ("YDifferenceFromPrevious") above this threshold will be regarded as a scene change. When a scene
change frame is detected, the frame from the source clip will be used instead of the alt-clip. When a scene change frame is
detected in a cycle, the frame with the next largest frame diff will be picked instead. In short, if a scene change is detected
in a cycle, then the frame with the largest diff will be removed from skip tagging. There is one exception to this rule, and
that is when the cycle size is one (1). In that case, if a frame is flagged as a scene change, then a freeze-frame from the
source clip will be added instead. This is to allow for sharp scene transitions (straight cuts), which look much better to the
eyes than blending or interpolating the adjacent frames across a scene change.
Default: 32.0

*debug*: Display various internal metrics as an image overlay.
Default: false


Changelog:
* 2.0.1 Fixes scene-change detection for single frame cycles. Now also allows the plugin to be used more than once in a script.
* 2.0.0 Adds multithreading support, scene detection. Fixes debug paint overflow. Removes "dm" option.
* 1.0.2 Fix bounds check on user input
* 1.0.1 Fix for invalid end-frame calculation
* 1.0.0 Initial release

Reel.Deel
20th July 2015, 03:09
Interesting, I sometimes encounter this problem after using SRestore on blended content. I'll give it a try, thanks!

pbristow
3rd August 2015, 13:59
Hooray! Somebody's done this! =:o>

I've been trying on-and-off to solve these kinds of problems for years. Scripted solutions were always too slow, so I clearly needed a plugin, but didn't have the skills/motivation to do the work myself. =:o?

Thankyou! I'll download it now and give it a try next time I find myself watching a jerky video.

jfma
1st October 2015, 21:23
Would you be so kind as to build an x64 version for Avisynth+ ?

:thanks:

coolgit
6th August 2021, 15:44
Does this actually work?

When a frame is created, it is in the wrong place.

Motion r to l

rrrr

becomes

rrlrr

hence going forwards then backwards (created frame) then forwards.

joj
12th September 2021, 04:14
@coolgit. Well it works for me, and I've run it on about 1200 different sources.
What you describe could have been an issue with an older version, and when using it with multithreading, or with some other filters that operated in the temporal space.
I've uploaded a version I've been using the last couple of years, which doesn't exhibit the mentioned problems. For me at least.
Give a newer version a try and see if it helps. If it doesn't, provide a test clip with the script you're using and I'll take a look.

@jfma there is a 64-bit version in the last release. Been away from the video space a few years, so sorry for the late reply.

real.finder
14th September 2021, 12:01
in https://github.com/jojje/SmoothSkip/blob/4396e2be89ec70f5acd21c52be328205617a9e9f/SmoothSkip.h#L52 the offset is float and the scene is int "[OFFSET]f[SCENE]i"

ognirats
14th September 2021, 14:37
Thanks you