AVISynth Scenarios
Frame Interpolation with RIFE
RIFE
Note: RIFE only operates on a 64bit system with the latest graphic cards.
RIFE is a high-quality frame interpolation filter, meaning it will smooth out videos by re/creating frames that are missing,
such as after duplicated or blended frames have been removed by other filters, for example when processing cine film
that has been captured by a video camera (telecine). It will interpolate between two frames and create an in-between
frame. This results in smoother video.
The RIFE filter comprises two parts: the filter files themselves, which are included in the plugins folder in the above zip
package, and the RIFE models, which are a 1GB collection of files and folders which detail the various models. I
haven’t included the models folder in the above download because of it’s size; if you would like to use RIFE:
•
go to the Github RIFE page
•
click on the “Latest” button on the right
•
click on the link to the models to download the zipped models folder.
Assuming you have set up AVISynth as I have described above, the models folder needs to be placed in the
avisynth+\plugins64+ folder:
The actual model number to be used in the AVISynth script is shown against the folder number is shown lower down on
the Github page linked-to above. For example, folder 4.6 (True) is model number 24.
Note: only models using 4.1 and above will allow adjustment/manual setting of the frame rate. Lower models will only
double the original framerate.
A typical RIFE script would look something like this, with the user-variables in blue:
v=ffms2("H:\Magix Info\Jak\Deinterlaced 00059.m2ts")
a=LWLibavAudioSource("H:\Magix Info\Jak\Deinterlaced 00059.m2ts")
AudioDub(v,a)
# RIFE only works with RGB floats
z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:l=>rgb:709:709:f")
# motion interpolate to 50 fps
Rife(gpu_thread=1, model=11, fps_num=50000, fps_den=1000, sc=true, sc_threshold=0.12)
# back to YV12
z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:709:709:f=>709:709:709:l")
Chroma Bleed in ANIME video
https://forum.videohelp.com/threads/416462-How-to-remove-this-interlace-blending-chroma-bleed
Removing Aliasing from Progressive video (Jagged edging)
https://forum.videohelp.com/threads/416435-Which-copy-looks-better-to-you-Attachments#post2756412
VHS Capture of DVD restoration (file 2)
https://forum.videohelp.com/threads/416923-De-Interlacing-another-DVD-from-collection
Another capture (file 1):
https://forum.videohelp.com/threads/416904-De-Interlacing-DVD-and-changing-25FPS-To-24FPS
IVTC 3:2 Pulldown of MPEG2 in MKV
Ref: Davexnet https://forum.videohelp.com/threads/404621-MakeMKV/page2#post2762453
aud=ffaudiosource("D:\VH\Chris Hooper\A1_t00.mkv",track=-1)
vid=ffvideosource("D:\VH\Chris Hooper\A1_t00.mkv", track=-1, seekmode=1,fpsnum=30000,fpsden=1001)
audiodub(vid,aud)
tfm().tdecimate()
Prefetch(24)
PSF Cleanup (VOB)
Ref Davexnet
v=ffms2("D:\VH\Akuma786\30Dec\VTS_01_1.VOB")
a=LWLibavAudioSource("D:\VH\Akuma786\30Dec\VTS_01_1.VOB")
AudioDub(v,a)
qtgmc(inputtype=2,preset="medium")
crop(0,124,-0,-122)
depansafe(dxmax=4,dymax=4)
crop(2,6,-4,-8)
Anime aliasing and frame blending
https://forum.videohelp.com/threads/417775-Difficult-low-quality-telecined-source
Removing duplicates from a Bluray rip of an old film
https://forum.videohelp.com/threads/418061-Solutions-for-a-film-with-duplicate-frames-without-predictable-
cycle#post2772415
Uses TDecimate(cycle=25,cycleR=3) to remove dupes and return frame rate back to original of 22fps.
Correcting a 59.94 capture back to 29.97
https://forum.videohelp.com/threads/418065-Converting-wrongly-captured-59-94fps-to-29-97fps#post2772420
sample file and the AVISynth code is in this post.
Correcting hard-coded Wrong field Order
https://forum.videohelp.com/threads/418758-Is-it-worth-it-recapturing-videos/page3#post2781386
Sample file in post #71.
Dealing with WMVs
https://forum.videohelp.com/threads/419043-Avisynth-and-WMV-s-keeping-A-V-in-sync
Old 320x240 Digital Camera Video Files
Such small files, when expanded to normal size for editing, exhibit pronounced jaggies. They can be significantly
improved with AVISynth and VDub2. Here are some “before” and “after” shots:
This is the AVISynth code:
v=ffms2("file.MOV")
a=LWlibavAudioSource("file.MOV")
AudioDub(v,a)
ConvertToYV16()
Spline16Resize(400,300)
santiagmod(3,3) #reduce burned-in jaggies
QTGMC(inputtype=2) #repair badly deinterlaced video ie burned-in jaggies
converttoyv12()
lsfmod(strength=100,Smode = 3) #sharpen
Spline64Resize(768,576)
dehalo_alpha() #reduce halo effects on edges
#RIFE uses motion interpolation to increase framerate.
z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:l=>rgb:709:709:f") # RIFE only works with RGB
floats
Rife(gpu_thread=1, model=11, fps_num=25000, fps_den=1000, sc=true, sc_threshold=0.12) # motion interpolate to 25
fps
z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:709:709:f=>709:709:709:l") # back to YV12
VDub2 filters applied on the AVS file:
Camcorder Color Denoise (CCD); maximum strength
Sharpen: maximum strength
Here are the results on my Youtube channel:
https://www.youtube.com/watch?v=uU-qISwAJo8
AVISynth Scenarios
Frame Interpolation with RIFE
RIFE
Note: RIFE only operates on a 64bit system with the
latest graphic cards.
RIFE is a high-quality frame interpolation filter,
meaning it will smooth out videos by re/creating
frames that are missing, such as after duplicated or
blended frames have been removed by other filters,
for example when processing cine film that has been
captured by a video camera (telecine). It will
interpolate between two frames and create an in-
between frame. This results in smoother video.
The RIFE filter comprises two parts: the filter files
themselves, which are included in the plugins folder
in the above zip package, and the RIFE models,
which are a 1GB collection of files and folders which
detail the various models. I haven’t included the
models folder in the above download because of it’s
size; if you would like to use RIFE:
•
go to the Github RIFE page
•
click on the “Latest” button on the right
•
click on the link to the models to download the
zipped models folder.
Assuming you have set up AVISynth as I have
described above, the models folder needs to be
placed in the avisynth+\plugins64+ folder:
The actual model number to be used in the
AVISynth script is shown against the folder number
is shown lower down on the Github page linked-to
above. For example, folder 4.6 (True) is model
number 24.
Note: only models using 4.1 and above will allow
adjustment/manual setting of the frame rate. Lower
models will only double the original framerate.
A typical RIFE script would look something like this,
with the user-variables in blue:
v=ffms2("H:\Magix Info\Jak\Deinterlaced
00059.m2ts")
a=LWLibavAudioSource("H:\Magix
Info\Jak\Deinterlaced 00059.m2ts")
AudioDub(v,a)
# RIFE only works with RGB floats
z_ConvertFormat(pixel_type="RGBPS",
colorspace_op="709:709:709:l=>rgb:709:709:f")
# motion interpolate to 50 fps
Rife(gpu_thread=1, model=11, fps_num=50000,
fps_den=1000, sc=true, sc_threshold=0.12)
# back to YV12
z_ConvertFormat(pixel_type="YUV420P8",
colorspace_op="rgb:709:709:f=>709:709:709:l")
Chroma Bleed in ANIME video
https://forum.videohelp.com/threads/416462-How-
to-remove-this-interlace-blending-chroma-bleed
Removing Aliasing from Progressive video
(Jagged edging)
https://forum.videohelp.com/threads/416435-Which-
copy-looks-better-to-you-Attachments#post2756412
VHS Capture of DVD restoration (file 2)
https://forum.videohelp.com/threads/416923-De-
Interlacing-another-DVD-from-collection
Another capture (file 1):
https://forum.videohelp.com/threads/416904-De-
Interlacing-DVD-and-changing-25FPS-To-24FPS
IVTC 3:2 Pulldown of MPEG2 in MKV
Ref: Davexnet
https://forum.videohelp.com/threads/404621-
MakeMKV/page2#post2762453
aud=ffaudiosource("D:\VH\Chris
Hooper\A1_t00.mkv",track=-1)
vid=ffvideosource("D:\VH\Chris
Hooper\A1_t00.mkv", track=-1,
seekmode=1,fpsnum=30000,fpsden=1001)
audiodub(vid,aud)
tfm().tdecimate()
Prefetch(24)
PSF Cleanup (VOB)
Ref Davexnet
v=ffms2("D:\VH\Akuma786\30Dec\VTS_01_1.VOB")
a=LWLibavAudioSource("D:\VH\Akuma786\30Dec\V
TS_01_1.VOB")
AudioDub(v,a)
qtgmc(inputtype=2,preset="medium")
crop(0,124,-0,-122)
depansafe(dxmax=4,dymax=4)
crop(2,6,-4,-8)
Anime aliasing and frame blending
https://forum.videohelp.com/threads/417775-
Difficult-low-quality-telecined-source
Removing duplicates from a Bluray rip of an
old film
https://forum.videohelp.com/threads/418061-
Solutions-for-a-film-with-duplicate-frames-without-
predictable-cycle#post2772415
Uses TDecimate(cycle=25,cycleR=3) to remove
dupes and return frame rate back to original of
22fps.
Correcting a 59.94 capture back to 29.97
https://forum.videohelp.com/threads/418065-
Converting-wrongly-captured-59-94fps-to-29-
97fps#post2772420
sample file and the AVISynth code is in this post.
Correcting hard-coded Wrong field Order
https://forum.videohelp.com/threads/418758-Is-it-
worth-it-recapturing-videos/page3#post2781386
Sample file in post #71.
Dealing with WMVs
https://forum.videohelp.com/threads/419043-
Avisynth-and-WMV-s-keeping-A-V-in-sync
Old 320x240 Digital Camera Video Files
Such small files, when expanded to normal size for
editing, exhibit pronounced jaggies. They can be
significantly improved with AVISynth and VDub2.
Here are some “before” and “after” shots:
This is the AVISynth code:
v=ffms2("file.MOV")
a=LWlibavAudioSource("file.MOV")
AudioDub(v,a)
ConvertToYV16()
Spline16Resize(400,300)
santiagmod(3,3) #reduce burned-in jaggies
QTGMC(inputtype=2) #repair badly deinterlaced
video ie burned-in jaggies
converttoyv12()
lsfmod(strength=100,Smode = 3) #sharpen
Spline64Resize(768,576)
dehalo_alpha() #reduce halo effects on edges
#RIFE uses motion interpolation to increase
framerate.
z_ConvertFormat(pixel_type="RGBPS",
colorspace_op="709:709:709:l=>rgb:709:709:f") #
RIFE only works with RGB floats
Rife(gpu_thread=1, model=11, fps_num=25000,
fps_den=1000, sc=true, sc_threshold=0.12) #
motion interpolate to 25 fps
z_ConvertFormat(pixel_type="YUV420P8",
colorspace_op="rgb:709:709:f=>709:709:709:l") #
back to YV12
VDub2 filters applied on the AVS file:
Camcorder Color Denoise (CCD); maximum
strength
Sharpen: maximum strength
Here are the results on my Youtube channel:
https://www.youtube.com/watch?v=uU-qISwAJo8