or Connect
AVS › AVS Forum › Video Components › Home Theater Computers › Avisynth Script for doubling video frame rates
New Posts  All Forums:Forum Nav:

Avisynth Script for doubling video frame rates - Page 64

post #1891 of 1968
Is it possible to use an avisynth sharpener (limitedsharpen, LSFMOD) together with SVP framedoubler?

I'm trying a script like this:

svp_flow_lib="C:\\Program Files (x86)\\Avisynth 2.5\\plugins\\libflowgpu.dll"
svp_scheduler=true
SetMTMode(1,22)
V= ffdshow_source()
SetMTMode(2)
V=V.LSFMod(defaults="slow")
S = V.MSuper(pel=2, hpad=16, vpad=16, rfilter=4)
A = S.MAnalyse(isb=true, blksize=16, overlap=4, plevel=0, pelsearch=3, searchparam=1, search=3, lambda=2000, lsad=1600, dct=5)
B = S.MAnalyse(isb=false, blksize=16, overlap=4, plevel=0, pelsearch=3, searchparam=1, search=3, lambda=2000, lsad=1600, dct=5)
C = S.MRecalculate(A, blksize=8, overlap=2, search=3, searchparam=1, dct=5)
D = S.MRecalculate(B, blksize=8, overlap=2, search=3, searchparam=1, dct=5)
V.MSmoothFps(S, C, D, num=FramerateNumerator(V)*5, den=FramerateDenominator(V)*2, algo=13, block=false, sadgamma=2, sadml=0, ml=0, blend=true)
GetMTMode(false) > 0 ? distributor() : last

But whenever I activate the line "V=V.LSFMod(defaults="slow")", the media player crashes...
post #1892 of 1968
Yes, it's possible but it will slow it down which may be the cause of the crash, or the cause could be that it needs more memory in which case you should add SetMemoryMax(512) to the top of the script, and of course check you are importing the right plugins and scripts for LSFMod.
post #1893 of 1968
@jander the syntax is slightly wrong. You need this:

svp_flow_lib="C:\\Program Files (x86)\\Avisynth 2.5\\plugins\\libflowgpu.dll"
svp_scheduler=true
SetMTMode(1,22)
V = ffdshow_source()
SetMTMode(2)
L = V.LSFMod(defaults="slow")
S = V.MSuper(pel=2, hpad=16, vpad=16, rfilter=4)
A = S.MAnalyse(isb=true, blksize=16, overlap=4, plevel=0, pelsearch=3, searchparam=1, search=3, lambda=2000, lsad=1600, dct=5)
B = S.MAnalyse(isb=false, blksize=16, overlap=4, plevel=0, pelsearch=3, searchparam=1, search=3, lambda=2000, lsad=1600, dct=5)
C = S.MRecalculate(A, blksize=8, overlap=2, search=3, searchparam=1, dct=5)
D = S.MRecalculate(B, blksize=8, overlap=2, search=3, searchparam=1, dct=5)
L.MSmoothFps(S, C, D, num=FramerateNumerator(L)*5, den=FramerateDenominator(L)*2, algo=13, block=false, sadgamma=2, sadml=0, ml=0, blend=true)
GetMTMode(false) > 0 ? distributor() : last

Try that.
post #1894 of 1968
janderclander14

Interpolated frames're always a little bit smoothed cause every point is linear interpolated from source frame point so adding sharpener _before_ MSmoothFps may be isn't a very useful idea.
post #1895 of 1968
Quote:
Originally Posted by Chainik View Post

janderclander14

Interpolated frames're always a little bit smoothed cause every point is linear interpolated from source frame point so adding sharpener _before_ MSmoothFps may be isn't a very useful idea.

Thanks for the tip Chainik. Glad to discover something new each day to improve the scripts
post #1896 of 1968
Quote:
Originally Posted by widezu69 View Post

@jander the syntax is slightly wrong. You need this:

svp_flow_lib="C:\\Program Files (x86)\\Avisynth 2.5\\plugins\\libflowgpu.dll"
svp_scheduler=true
SetMTMode(1,22)
V = ffdshow_source()
SetMTMode(2)
L = V.LSFMod(defaults="slow")
S = V.MSuper(pel=2, hpad=16, vpad=16, rfilter=4)
A = S.MAnalyse(isb=true, blksize=16, overlap=4, plevel=0, pelsearch=3, searchparam=1, search=3, lambda=2000, lsad=1600, dct=5)
B = S.MAnalyse(isb=false, blksize=16, overlap=4, plevel=0, pelsearch=3, searchparam=1, search=3, lambda=2000, lsad=1600, dct=5)
C = S.MRecalculate(A, blksize=8, overlap=2, search=3, searchparam=1, dct=5)
D = S.MRecalculate(B, blksize=8, overlap=2, search=3, searchparam=1, dct=5)
L.MSmoothFps(S, C, D, num=FramerateNumerator(L)*5, den=FramerateDenominator(L)*2, algo=13, block=false, sadgamma=2, sadml=0, ml=0, blend=true)
GetMTMode(false) > 0 ? distributor() : last

Try that.


Quote:
Originally Posted by SubJunk View Post

Yes, it's possible but it will slow it down which may be the cause of the crash, or the cause could be that it needs more memory in which case you should add SetMemoryMax(512) to the top of the script, and of course check you are importing the right plugins and scripts for LSFMod.

Thank you very much for your useful comments.

The player works correctly with the widezu69 script, including the SetMemoryMax(1024) at the top and modifying the sharpening to

LSFMod(defaults="slow", ss_x=1.0, ss_y=1.0)

Quote:
Originally Posted by Chainik View Post

janderclander14

Interpolated frames're always a little bit smoothed cause every point is linear interpolated from source frame point so adding sharpener _before_ MSmoothFps may be isn't a very useful idea.

Then, do you think it is better to apply the sharpener after the frame interpolation? In that case, would the sharpener need to be applied to a much larger amount of frames per second (requiring much more CPU)? Moreover, sharpening the interpolation result would also magnify the motion artifacts?

Thanks!
post #1897 of 1968
The way the script I posted works is:

Take the video source, sharpen it, then analyse and create vectors using the video source NOT THE SHARPENED ONES. Then it takes the sharpened video frames and doubles them using the vectors created.

Basically what this script does is creates the vectors on unmodified video trying to keep artifacts low, but it outputs all sharpened frames.
post #1898 of 1968
widezu69
but it outputs all sharpened frames.

Do you see any difference between MSuper(sharp=0) and (sharp <> 0), which is by default?
MSmoothFps in GPU mode always acts like (sharp=0) no matter what "sharp" value is set.

janderclander14
do you think it is better to apply the sharpener after the frame interpolation?

Yes I do. And the best (=cheapest) way to do this in real time is to use "sharpen complex" pixel shader in MPC-HC or Daum PotPlayer.
post #1899 of 1968
Quote:


janderclander14
do you think it is better to apply the sharpener after the frame interpolation?

Yes I do. And the best (=cheapest) way to do this in real time is to use "sharpen complex" pixel shader in MPC-HC or Daum PotPlayer.

I used to use sharpen complex in MPC-HC, but since I switched to MadVR I'm not able to use post-processing shaders. I'll try to put the software sharpening after the interpolation.
post #1900 of 1968
@Chainik. I don't see a difference. I'm talking about the use of LSF in the script I posted above. I'm saying that the output frames have LSF applied to them but the calculation of vectors is done on just the original source.
post #1901 of 1968
widezu69
Yep, original frames in output sequence are sharped with LSF but interpolated frames are blurred a little inside MSmoothFps.
post #1902 of 1968
Right I see. Sorry, I completely misunderstood. Anyways perhaps this script? This sharpens the frame before interpolation and should output all sharpened(ish) frames.

svp_flow_lib="C:\\Program Files (x86)\\Avisynth 2.5\\plugins\\libflowgpu.dll"
svp_scheduler=true
SetMTMode(1,22)
V = ffdshow_source()
SetMTMode(2)
L = V.LSFMod(defaults="slow")
S = L.MSuper(pel=2, hpad=16, vpad=16, rfilter=4)
A = S.MAnalyse(isb=true, blksize=16, overlap=4, plevel=0, pelsearch=3, searchparam=1, search=3, lambda=2000, lsad=1600, dct=5)
B = S.MAnalyse(isb=false, blksize=16, overlap=4, plevel=0, pelsearch=3, searchparam=1, search=3, lambda=2000, lsad=1600, dct=5)
C = S.MRecalculate(A, blksize=8, overlap=2, search=3, searchparam=1, dct=5)
D = S.MRecalculate(B, blksize=8, overlap=2, search=3, searchparam=1, dct=5)
L.MSmoothFps(S, C, D, num=FramerateNumerator(L)*5, den=FramerateDenominator(L)*2, algo=13, block=false, sadgamma=2, sadml=0, ml=0, blend=true)
GetMTMode(false) > 0 ? distributor() : last
post #1903 of 1968
Quote:
Originally Posted by widezu69 View Post

Right I see. Sorry, I completely misunderstood. Anyways perhaps this script? This sharpens the frame before interpolation and should output all sharpened(ish) frames.

svp_flow_lib="C:\\Program Files (x86)\\Avisynth 2.5\\plugins\\libflowgpu.dll"
svp_scheduler=true
SetMTMode(1,22)
V = ffdshow_source()
SetMTMode(2)
L = V.LSFMod(defaults="slow")
S = L.MSuper(pel=2, hpad=16, vpad=16, rfilter=4)
A = S.MAnalyse(isb=true, blksize=16, overlap=4, plevel=0, pelsearch=3, searchparam=1, search=3, lambda=2000, lsad=1600, dct=5)
B = S.MAnalyse(isb=false, blksize=16, overlap=4, plevel=0, pelsearch=3, searchparam=1, search=3, lambda=2000, lsad=1600, dct=5)
C = S.MRecalculate(A, blksize=8, overlap=2, search=3, searchparam=1, dct=5)
D = S.MRecalculate(B, blksize=8, overlap=2, search=3, searchparam=1, dct=5)
L.MSmoothFps(S, C, D, num=FramerateNumerator(L)*5, den=FramerateDenominator(L)*2, algo=13, block=false, sadgamma=2, sadml=0, ml=0, blend=true)
GetMTMode(false) > 0 ? distributor() : last

This is script certainly produces sharpener results than the previous one, very comparable to putting the sharpener after the interpolation process (which results in much more cpu usage) if the sharpen strength is raised a bit.

I managed to avoid crashes re-installing avisynth and all dlls. Now the CPU usage is below 40% for 720p videos. Thanks!
post #1904 of 1968
Quote:
Originally Posted by widezu69 View Post

Right I see. Sorry, I completely misunderstood. Anyways perhaps this script? This sharpens the frame before interpolation and should output all sharpened(ish) frames.

svp_flow_lib="C:\\Program Files (x86)\\Avisynth 2.5\\plugins\\libflowgpu.dll"
svp_scheduler=true
SetMTMode(1,22)
V = ffdshow_source()
SetMTMode(2)
L = V.LSFMod(defaults="slow")
S = L.MSuper(pel=2, hpad=16, vpad=16, rfilter=4)
A = S.MAnalyse(isb=true, blksize=16, overlap=4, plevel=0, pelsearch=3, searchparam=1, search=3, lambda=2000, lsad=1600, dct=5)
B = S.MAnalyse(isb=false, blksize=16, overlap=4, plevel=0, pelsearch=3, searchparam=1, search=3, lambda=2000, lsad=1600, dct=5)
C = S.MRecalculate(A, blksize=8, overlap=2, search=3, searchparam=1, dct=5)
D = S.MRecalculate(B, blksize=8, overlap=2, search=3, searchparam=1, dct=5)
L.MSmoothFps(S, C, D, num=FramerateNumerator(L)*5, den=FramerateDenominator(L)*2, algo=13, block=false, sadgamma=2, sadml=0, ml=0, blend=true)
GetMTMode(false) > 0 ? distributor() : last

Sorry not an expert...and got a problem. Copied this script in the Avisynth section of FFDshow, placed LSFMod, removegrain, repair, mvtools2.dll in plugin folder of Avisynth. Now I can hear the audio but got no video...only..



Any suggestion?

Thanks!
post #1905 of 1968
Metal_Icarus
May be too many threads in SetMTMode.

not an expert...and got a problem
So start with SVP, it should be easier
post #1906 of 1968
Post deleted. Error with my script.. Im sorry
post #1907 of 1968
So a final script from me before I move onto other newer concepts. This script is optimised for i7s at any of the two HD resolutions for the maximum smoothness. Artifact suppression is a secondary objective but the script still does very well in terms of quality. Smoothness particularly in 1080p is improved.

svp_flow_lib="C:\\Program Files (x86)\\Avisynth 2.6\\plugins\\libflowgpu.dll"
svp_scheduler=true
SetMTMode(1,15)
V = ffdshow_source()
SetMTMode(2)
S = V.MSuper(pel=2, hpad=16, vpad=16, rfilter=4)
A = S.MAnalyse(isb=true, blksize=16, overlap=4, plevel=0, pelsearch=3, search=3, searchparam=2, lambda=2000, lsad=1600)
B = S.MAnalyse(isb=false, blksize=16, overlap=4, plevel=0, pelsearch=3, search=3, searchparam=2, lambda=2000, lsad=1600)
C = S.MRecalculate(A, blksize=8, overlap=2, searchparam=2, search=3)
D = S.MRecalculate(B, blksize=8, overlap=2, searchparam=2, search=3)
V.MSmoothFps(S, C, D, num=120, den=1, algo=13, block=false, sadgamma=2, sadml=0, ml=0, thSCD1=1000, thSCD2=255, blend=true)
GetMTMode(false) > 0 ? distributor() : last

Edit: Remember to change num= to whatever you want your output framerate to be
post #1908 of 1968
It looks good, but most people will want to change the num and den values for their monitors.
post #1909 of 1968
Ah of course. Posts edited thanks Sub. 120fps is sooo puuuuuurddy though. The best is on 3D. Running 60fps per eye is truly a sight to behold!
post #1910 of 1968
That's pretty awesome. My TV does 600FPS so I guess 300 for each eye
post #1911 of 1968
Quote:
Originally Posted by widezu69 View Post

So a final script from me before I move onto other newer concepts. This script is optimised for i7s at any of the two HD resolutions for the maximum smoothness. Artifact suppression is a secondary objective but the script still does very well in terms of quality. Smoothness particularly in 1080p is improved.

svp_flow_lib="C:\\Program Files (x86)\\Avisynth 2.6\\plugins\\libflowgpu.dll"
svp_scheduler=true
SetMTMode(1,15)
V = ffdshow_source()
SetMTMode(2)
S = V.MSuper(pel=2, hpad=16, vpad=16, rfilter=4)
A = S.MAnalyse(isb=true, blksize=16, overlap=4, plevel=0, pelsearch=3, search=3, searchparam=2, lambda=2000, lsad=1600)
B = S.MAnalyse(isb=false, blksize=16, overlap=4, plevel=0, pelsearch=3, search=3, searchparam=2, lambda=2000, lsad=1600)
C = S.MRecalculate(A, blksize=8, overlap=2, searchparam=2, search=3)
D = S.MRecalculate(B, blksize=8, overlap=2, searchparam=2, search=3)
V.MSmoothFps(S, C, D, num=120, den=1, algo=13, block=false, sadgamma=2, sadml=0, ml=0, thSCD1=1000, thSCD2=255, blend=true)
GetMTMode(false) > 0 ? distributor() : last

Edit: Remember to change num= to whatever you want your output framerate to be

just curious, im still using avisynth 2.5. is 2.6 much more efficient? or can i use your script with avisynth 2.5?
thanks.
post #1912 of 1968
2.6 is more stable for multithreading than 2.5, so it's best to use 2.6 for this.
post #1913 of 1968
Quote:
Originally Posted by widezu69 View Post

So a final script from me before I move onto other newer concepts. This script is optimised for i7s at any of the two HD resolutions for the maximum smoothness. Artifact suppression is a secondary objective but the script still does very well in terms of quality. Smoothness particularly in 1080p is improved.

svp_flow_lib="C:\\Program Files (x86)\\Avisynth 2.6\\plugins\\libflowgpu.dll"
svp_scheduler=true
SetMTMode(1,15)
V = ffdshow_source()
SetMTMode(2)
S = V.MSuper(pel=2, hpad=16, vpad=16, rfilter=4)
A = S.MAnalyse(isb=true, blksize=16, overlap=4, plevel=0, pelsearch=3, search=3, searchparam=2, lambda=2000, lsad=1600)
B = S.MAnalyse(isb=false, blksize=16, overlap=4, plevel=0, pelsearch=3, search=3, searchparam=2, lambda=2000, lsad=1600)
C = S.MRecalculate(A, blksize=8, overlap=2, searchparam=2, search=3)
D = S.MRecalculate(B, blksize=8, overlap=2, searchparam=2, search=3)
V.MSmoothFps(S, C, D, num=120, den=1, algo=13, block=false, sadgamma=2, sadml=0, ml=0, thSCD1=1000, thSCD2=255, blend=true)
GetMTMode(false) > 0 ? distributor() : last

Edit: Remember to change num= to whatever you want your output framerate to be

I cannot use libflowgpu cause no compatible videocard here.. so I replaced libflowgpu.dll by libflowsse.dll

The image shows repeated 4x times in the screen. How I can solve this? What I have to change in your script to use libflowsse.dll correctly ?
post #1914 of 1968
When using libflowsse you need to add MFinest, so it would be something like this:

svp_flow_lib="C:\\Program Files (x86)\\Avisynth 2.6\\plugins\\libflowsse.dll"
svp_scheduler=true
SetMTMode(1,15)
V = ffdshow_source()
SetMTMode(2)
S = V.MSuper(pel=2, hpad=16, vpad=16, rfilter=4)
A = S.MAnalyse(isb=true, blksize=16, overlap=4, plevel=0, pelsearch=3, search=3, searchparam=2, lambda=2000, lsad=1600)
B = S.MAnalyse(isb=false, blksize=16, overlap=4, plevel=0, pelsearch=3, search=3, searchparam=2, lambda=2000, lsad=1600)
C = S.MRecalculate(A, blksize=8, overlap=2, searchparam=2, search=3)
D = S.MRecalculate(B, blksize=8, overlap=2, searchparam=2, search=3)
F = V.MFinest(S)
V.MSmoothFps(S, C, D, finest=F, num=60000, den=1001, algo=13, block=false, sadgamma=2, sadml=0, ml=0, thSCD1=1000, thSCD2=255, blend=true)
GetMTMode(false) > 0 ? distributor() : last
post #1915 of 1968
Quote:
Originally Posted by SubJunk View Post

2.6 is more stable for multithreading than 2.5, so it's best to use 2.6 for this.

thanks sub!
post #1916 of 1968
Its working with "finest"

Thanks a lot SubJunk and Widezu69
post #1917 of 1968
Hi there,

I've been experimenting with the newest SVP 3.1 version. Very promising. It seems a quantum leap from old mvtools-based version.

I've imported/adapted the avs script to ffdshow as follows and included the svp libs in the avisynth directory. It is working so far. The only issue is the need of using the old 2.5 avisynth version instead of the new 2.6 (which caused random crashes).

svp_scheduler=true
SetMemoryMax(1024)
LoadPlugin("C:\\Program Files (x86)\\SVP\\plugins\\svpflow1.dll")
LoadPlugin("C:\\Program Files (x86)\\SVP\\plugins\\svpflow2.dll")
SetMTMode(3,15)
L = ffdshow_source()
SetMTMode(2)
super_params="{scale:{up:0},gpu:1}"
analyse_params="{main:{search:{coarse:{distance:-10},bad:{sad:2000}}},refine:[{thsad:250}]}"
smoothfps_params="{num:5,den:2,algo:13,mask:{},scene:{mode:0}}"
super=L.SVSuper(super_params)
vectors=SVAnalyse(super, analyse_params)
L.SVSmoothFps(super, vectors, smoothfps_params, url="www.svp-team.com")
GetMTMode(false) > 0 ? distributor() : last

Note that most parameters have changed. This is more or less the default parameters but changing the interpolation mode to "maximum smoothness" (mode:0). The "adaptive" mode was fine but if seems to disable motion interpolation on high motion scenes (to avoid artifacts), but this produces a distracting effect of "varying degree of smoothness through the movie" (like if the framerate is continuously changing).

The CPU/GPU usage is certainly lowered (around 12% for 720p videos!) and the quality seems improved. Still, lots of room for tweaking with the new parameters.

What do you think? Any suggestions to improve quality? Any clue of the influence of the new parameters and their values? Did you managed to run it with avisynth 2.6 without crash?
post #1918 of 1968
I've been helping them out with this for a few weeks. This is promising and the resource usage is definitely improved. However, the smoothness still doesn't match the latest script I posted earlier.

I'll have to investigate further
post #1919 of 1968
Quote:
Originally Posted by janderclander14 View Post

Any suggestions to improve quality?

InterFrame 2.0 will be released soon to answer that

Quote:
Originally Posted by janderclander14 View Post

Did you managed to run it with avisynth 2.6 without crash?

We're working on 2.6 compatibility now. The crash is caused by a missing function in 2.6 (whether on purpose or an oversight we don't know yet)
post #1920 of 1968
Quote:
Originally Posted by widezu69 View Post

I've been helping them out with this for a few weeks. This is promising and the resource usage is definitely improved. However, the smoothness still doesn't match the latest script I posted earlier.

I'll have to investigate further

Oh and by the way I agree with this. Moving objects with the new scripts seem worse than they used to be.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Home Theater Computers
AVS › AVS Forum › Video Components › Home Theater Computers › Avisynth Script for doubling video frame rates