Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
16th June 2019, 23:11 | #1201 | Link |
Registered User
Join Date: Jan 2007
Posts: 45
|
@SnillorZ: That 0.2fps was with 64bit plugins, 64bit ffmpeg 4.1.3 as well as x64 Avisnyth+ MT r2772! Maybe I don't have the latest plugins but they were all grabbed from newest sources I could find.
The versions I have are:
My input images are 2976 x 1984 if that makes a difference, which are cropped to 1440 x 1080 in the avs script. |
17th June 2019, 01:19 | #1202 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,691
|
If you are feeding 1440x1080 into the script (i.e., you are cropping BEFORE restoring), then 0.2 fps is about 10% (or less) of what you should be getting. Even without MT, you should be getting at least 1-2 fps.
|
17th June 2019, 09:50 | #1203 | Link |
Registered User
Join Date: Jan 2007
Posts: 45
|
I haven't majorly altered the script. Mainly changing the input to accept an image sequence, flip the image, tweak the crop and stabilise values and paths to 64 bit plugins.
See below script I use: Code:
# John Meyers Script # Use AVISynth version 2.60 #VIDEO FILE #---------------------------------------------------------------------------------------------------------------------------- SetFilterMTMode("DEFAULT_MT_MODE", 2) #Change the following line to point to your video file film="E:\Videos\imgseq\SAM_%05d.jpg" #GENERAL PARAMETERS #---------------------------------------------------------------------------------------------------------------------------- result="result1" #specify the wanted output here; valid results are "result1" through "result4" and "resultS1" through "resultS4" for before/after trim_begin=1 trim_end= 28160 play_speed=18 #play speed (8mm=16; Super8=18; 16mm sound=24) #COLOR AND LEVELS PARAMATERS #---------------------------------------------------------------------------------------------------------------------------- saturation=0.9 #for all outputs gamma=1.0 #for all outputs blue= -0 red=-0 #manual color adjustment, when returning result3 & result4. Values can be positive or negative black_level=0 white_level=255 output_black=0 output_white=255 #manual levels, when returning result2 & result4 #SIZE, CROP AND BORDERS PARAMETERS #---------------------------------------------------------------------------------------------------------------------------- CLeft=796 CTop=376 CRight=550 CBottom=388 #crop values after Depan and before final resizing W=1440 H=1080 #final size after cropping bord_left=0 bord_top=0 bord_right=0 bord_bot=0 #720p= borders 150 in_bord_left=0 in_bord_top=0 in_bord_right=0 in_bord_bot=0 #Borders around input that must be removed #STABILISING PARAMETERS #---------------------------------------------------------------------------------------------------------------------------- maxstabH=20 #maximum values for the stabiliser (in pixels) 20 is a good start value maxstabV=40 est_left=760 est_top=380 est_right=500 est_bottom=350 #crop and contast values for special Estimate clip est_cont=1.6 #DENOISING PARAMETERS #---------------------------------------------------------------------------------------------------------------------------- #Fastest parameters #denoising_strength=600 #denoising level of first denoiser: MVDegrain() #denoising_strength=300 #denoising level of first denoiser: MVDegrain() #block_size= 16 #block size of MVDegrain #block_size_v= 16 #block_over= 8 #block overlapping of MVDegrainMulti() #Best compromise between speed and quality denoising_strength= 0 #denoising level of first denoiser: MDegrain() block_size= 8 #block size of MVDegrain block_size_v= 8 block_over= 4 #block overlapping of MVDegrainMulti() dirt_strength=20 #sets amount of dirt removal (big spots) #FOUR STEP SHARPENING PARAMETERS #-------------------------------------------------------------------------------------------------------------------------------- PRE_sharp_ness= 30 PRE_radi_us= 3 #presharpening (UnsharpMask) just after first denoising Sharp_Strength= 0.1 #AUTO LEVELS PARAMETER #-------------------------------------------------------------------------------------------------------------------------------- X=4 #X is a special parameter for reducing the autolevels effect on the whites X2=16 #X2 is a special parameter for reducing the autolevels effect on the blacks #NUMBER OF THREADS #-------------------------------------------------------------------------------------------------------------------------------- threads=5 # END VARIABLES, BEGIN SCRIPT #================================================================================================================================= # Using AVISynth version 2.60, build August 28, 2012 (Ben-Rudiak-Gould, etc.) # Using VirtualDub 1.8.6 #Change the following (lower or higher) if you have stability problems with multi-threading SetMemoryMax(1600) #Load plugins explicitly LoadPlugin("plugins_x64/mvtools2.dll") LoadPlugin("plugins_x64/autolevels_x64.dll") LoadPlugin("plugins_x64/Deflicker.dll") Loadplugin("plugins_x64/Depan.dll") LoadPlugin("plugins_x64/DepanEstimate.dll") Loadplugin("plugins_x64/masktools2.dll") Loadplugin("plugins_x64/RemoveDirt.dll") Loadplugin("plugins_x64/RgTools.dll") Loadplugin("plugins_x64/warpsharp.dll") #Use the following for alternative frame interpolation #loadplugin("svpflow1.dll") #Version 1.2.1.0 5/29/2012 #loadplugin("svpflow2.dll") #Version 1.3.1.0 6/02/2012 #Import("InterFrame2.avsi") #Version 2.1.0 6/27/2012 #Open and crop the video #Remove all setmtmode statements (there are four in this script) if not using multi-threaded (MT) AVISynth #setmtmode(5,threads) source1= ImageSource(file=film, start=trim_begin, end=trim_end, fps=play_speed).FlipVertical().converttoYV12() #killaudio() improves stability (in my experience -- others disagree) cropped_source=source1.crop(in_bord_left,in_bord_top,-in_bord_right,-in_bord_bot) #temporarily remove any black borders on input video #setmtmode(2) #cropped_source=filldrops(cropped_source) #Use this when removing bad frames that have been removed by duplicating previous frame #(see notes in function at end of script) #STABILIZING #.................................................................................................................................................................... stab_reference= cropped_source.crop(est_left,est_top,-est_right,-est_bottom).tweak(cont=est_cont).MT_binarize(threshold=80).greyscale().invert() mdata=DePanEstimate(stab_reference,trust=1.0,dxmax=maxstabH,dymax=maxstabV) stab=DePanStabilize(cropped_source,data=mdata,cutoff=0.5,dxmax=maxstabH,dymax=maxstabV,method=1,mirror=15) #Alternative line that includes deflicker. I find that this usually is not needed. #stab=DePanStabilize(cropped_source,data=mdata,cutoff=0.5,dxmax=maxstabH,dymax=maxstabV,method=1,mirror=15).deflicker() #DENOISING #................................................................................................................................................................... #Remove dirt input_to_removedirt=stab.crop(CLeft,CTop,-CRight,-CBottom) stabcrop=RemoveDirtMC(input_to_removedirt,dirt_strength,false) #Reduce grain prefiltered = RemoveGrain(stabcrop,2) superfilt = MSuper(prefiltered, hpad=32, vpad=32,pel=2) super= MSuper(stabcrop, hpad=32, vpad=32,pel=2) halfblksize= (block_size>4) ? block_size/2 : 4 halfoverlap= (block_over>2) ? block_over/2 : 2 bvec1 = MAnalyse(superfilt, isb = true, delta = 1, blksize=block_size, overlap=block_over,dct=0) bvec1 = MRecalculate(super, bvec1, blksize=halfblksize, overlap=halfoverlap,thSAD=100) fvec1 = MAnalyse(super, isb = false, delta = 1, blksize=block_size, overlap=block_over,dct=0) fvec1 = MRecalculate(super, fvec1, blksize=halfblksize, overlap=halfoverlap,thSAD=100) bvec2 = MAnalyse(super, isb = true, delta = 2, blksize=block_size, overlap=block_over,dct=0) bvec2 = MRecalculate(super, bvec2, blksize=halfblksize, overlap=halfoverlap,thSAD=100) fvec2 = MAnalyse(super, isb = false, delta = 2, blksize=block_size, overlap=block_over,dct=0) fvec2 = MRecalculate(super, fvec2, blksize=halfblksize, overlap=halfoverlap,thSAD=100) denoised=stabcrop.MDegrain2(super, bvec1,fvec1,bvec2,fvec2,thSAD=denoising_strength).levels(0,gamma,255,0,255).tweak(sat=saturation).unsharpmask(PRE_sharp_ness,PRE_radi_us,0) #SHARPENING #................................................................................................................................................................... sharp1=denoised.sharpen(Sharp_Strength) PreBorderFrame = sharp1.Lanczos4Resize(W - bord_left - in_bord_left - bord_right - in_bord_right, H - bord_top - in_bord_top - bord_bot - in_bord_bot) #FRAME INTERPOLATION (optional) #................................................................................................................................................................... #Interpolate frames #Use this for progressive output -- example shows 29.97 progressive #PreBorderFrame=InterFrame(NewNum=30000,NewDen=1001,PreBorderFrame,GPU=true,Cores=threads) #Use this for interlaced output -- example shows 29.97 interlaced #PreBorderFrame=InterFrame(NewNum=60000,NewDen=1001,PreBorderFrame,GPU=true,Cores=threads).SeparateFields().SelectEvery(4, 0, 3).Weave() #RESULT1: AUTOLEVELS,AUTOWHITE #...................................................................................................................................................................... #SetMTMode(5) #Turn off SetMTMode for Autolevels result1= PreBorderFrame.coloryuv(autowhite=true).addborders(X,0,0,0,$FFFFFF).addborders(0,0,X2,0,$000000).autolevels(filterRadius=2).crop(X,0,-X2,-0).addborders(bord_left+in_bord_left, bord_top+in_bord_top, bord_right+in_bord_right, bord_bot+in_bord_bot) #RESULT3: AUTOLEVELS, MANUAL COLOR CORRECTIONS #..................................................................................................................................................................... result3= PreBorderFrame.coloryuv(off_U=blue,off_V=red).addborders(X,0,0,0,$FFFFFF).addborders(0,0,X2,0,$000000).autolevels(filterRadius=2).crop(X,0,-X2,-0).addborders(bord_left+in_bord_left, bord_top+in_bord_top, bord_right+in_bord_right, bord_bot+in_bord_bot) #SetMTMode(2) #Re-enable SetMTMode after Autolevels #RESULT2: MANUAL LEVELS, AUTOWHITE #...................................................................................................................................................................... result2= PreBorderFrame.levels(black_level,gamma,white_level,0,255).coloryuv(autowhite=true).addborders(bord_left+in_bord_left, bord_top+in_bord_top, bord_right+in_bord_right, bord_bot+in_bord_bot) #RESULT4: MANUAL LEVELS, MANUAL COLOR CORRECTIONS #..................................................................................................................................................................... result4= PreBorderFrame.coloryuv(off_U=blue,off_V=red).levels(black_level,gamma,white_level,0,255).addborders(bord_left+in_bord_left, bord_top+in_bord_top, bord_right+in_bord_right, bord_bot+in_bord_bot) #PARAMETERS FOR THE COMPARISONS #..................................................................................................................................................................... W2= W+bord_left+bord_right H2= H+bord_top+bord_bot source4=Lanczos4Resize(source1,W2,H2) #COMPARISONS: ORIGINAL VS RESULTS #...................................................................................................................................................................... resultS1= stackhorizontal(subtitle(source4,"original",size=28,align=2),subtitle(result1,"autolevels, autowhite",size=28,align=2)) resultS2= stackhorizontal(subtitle(source4,"original",size=28,align=2),subtitle(result2,"autowhite, manual levels correction",size=28,align=2)) resultS3= stackhorizontal(subtitle(source4,"original",size=28,align=2),subtitle(result3,"autolevels, manual color correction",size=28,align=2)) resultS4= stackhorizontal(subtitle(source4,"original",size=28,align=2),subtitle(result4,"manual colors and levels correction",size=28,align=2)) #Finish and go home Eval(result) # END SCRIPT, BEGIN FUNCTIONS #================================================================================================================================= #REMOVE DIRT FUNCTION #...................................................................................................................................................................... function RemoveDirt(clip input, int limit, bool _grey) { clensed=input.Clense(grey=_grey, cache=4) alt=input.RemoveGrain(2) return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,dmode=2,debug=false,noise=limit,noisy=4, grey=_grey) # Alternative settings # return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=4,cthreshold=6, gmthreshold=40,dist=1,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey,show=true) # return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,tolerance= 12,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey,show=false) } #This function provides motion compensation for the remove dirt function, thus improving quality. function RemoveDirtMC(clip,int "limit", bool "_grey") { _grey=default(_grey, false) limit = default(limit,6) prefiltered = RemoveGrain(clip,2) superfilt = MSuper(prefiltered, hpad=32, vpad=32,pel=2) super=MSuper(clip, hpad=32, vpad=32,pel=2) bvec = MAnalyse(superfilt,isb=true, blksize=16, overlap=2,delta=1, truemotion=true) fvec = MAnalyse(superfilt,isb=false, blksize=16, overlap=2,delta=1, truemotion=true) bvec_re = Mrecalculate(super,bvec,blksize=8, overlap=0,thSAD=100) fvec_re = Mrecalculate(super,fvec,blksize=8, overlap=0,thSAD=100) backw = MFlow(clip,super,bvec_re) forw = MFlow(clip,super,fvec_re) clp=interleave(forw,clip,backw) clp=clp.RemoveDirt(limit,_grey) clp=clp.SelectEvery(3,1) return clp } # The following function will remove near duplicates ("0.1") or exact duplicates (change to "0.0"). # It replaces these duplicates with a motion estimated frame. It works really well (IMHO). # # Use: In your video editor, replace any single bad frame (burned frame, jump, missing frame from splice, etc.) with a duplicate of the # previous frame. Then, include a call to this function (see script above, where it is commented out). # # Here's an example of how this function can be use: # # http://www.youtube.com/watch?v=uzMFodrGHDs # function filldrops (clip c) { super=MSuper(c,pel=2) vfe=manalyse(super,truemotion=true,isb=false,delta=1) vbe=manalyse(super,truemotion=true,isb=true,delta=1) filldrops = mflowinter(c,super,vbe,vfe,time=50) fixed = ConditionalFilter(c, filldrops, c, "YDifferenceFromPrevious()", "lessthan", "0.1") return fixed } Prefetch(4) #return last Code:
ffmpeg.exe -i "test.avs" -c:v h264 -preset slow "test.mp4" Last edited by bassquake; 17th June 2019 at 14:26. Reason: avi should be avs. Remove versions in comments. |
17th June 2019, 10:01 | #1204 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
17th June 2019, 14:07 | #1205 | Link |
Registered User
Join Date: Jan 2019
Location: Lake District UK
Posts: 48
|
@bassquake Just to check the script you posted doesn't show the same versions as you listed in your previous post?
As StainlessS advised v0.10 Autolevels is latest, other differences are: avstp_x64.dll #x64 Version 1.0.3.0 30/12/2015 AutoLevels_x64.dll #x64 Version 0.10.0.0 11/06/2019 fft3dfilter.dll #x64 Version 2.6.0.0 31/01/2019 FredAverage_x64.dll #x64 Version 0.3.0.0 16/01/2019 GamMac_x64.dll #x64 Version 1.10.0.0 15/06/2018 RemoveDirt.dll #x64 Version 0.9.2 24/03/2019 warpsharp.dll #x64 15/06/2011 As I've adapted a version of the later 2017 johnmeyer script to x64 plugins. Also just to be clear, as per previous posts I'm processing in 2 passes i.e. Clean & Stabilise in 1st pass and Colour & White correction in 2nd. Edit otherwise all processing in 1 pass produces an average of 2fps (max) with my source. Heading off course again here though and as suggested a request has been made to the @Mods to get a separate dedicated thread to discuss performance of the VideoFred/JohnMeyer scripts and such posts moved there. Last edited by SnillorZ; 17th June 2019 at 14:11. Reason: Missed detail of 1 pass processing speeds/ |
17th June 2019, 14:24 | #1206 | Link |
Registered User
Join Date: Jan 2007
Posts: 45
|
@Snillorz: Yes, I left the versions in the comments, you can ignore those. The versions I have are the ones I bulleted earlier. Ill edit the avs code and remove them to avoid confusion!
Edit: I already have those versions you highlighted Snillorz. (avstp_x64, fft3dfilter.dll, FredAverage_x64.dll,GamMac_x64.dll). Last edited by bassquake; 17th June 2019 at 15:23. Reason: Add some info |
17th June 2019, 15:11 | #1207 | Link |
Registered User
Join Date: Dec 2018
Location: Massachusetts USA
Posts: 25
|
Other formats? 16mm? 35mm?
Are there any significant changes suggested in the current 8mm script, when processing frames of varying size and film formats?
My 16mm frame sequence captures are processed at a resolution of 2604x1738px. What operations (denoise, stabilize, sharpen, etc) require special consideration when taking into account frame size? |
17th June 2019, 18:05 | #1208 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
You should go through your script again. For example, this line:
Code:
cropped_source=source1.crop(in_bord_left,in_bord_top,-in_bord_right,-in_bord_bot) #temporarily remove any black borders on input video
__________________
Groucho's Avisynth Stuff Last edited by Groucho2004; 17th June 2019 at 23:30. |
18th June 2019, 02:46 | #1209 | Link |
Registered User
Join Date: Dec 2018
Location: Massachusetts USA
Posts: 25
|
I am still trying to get a working installation of AVISynth+, for film restoration..
Where am I able to find? FredAverage_x64.dll #x64 Version 0.3.0.0 16/01/2019 GamMac_x64.dll #x64 Version 1.10.0.0 15/06/2018 The link, for "FredAverage", at http://avisynth.nl/index.php/AviSynth%2B_x64_plugins is dead. The link for GamMac, on the same page, points to another post on this forum, and there is no clear download link anywhere I can find. |
18th June 2019, 02:57 | #1210 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
__________________
Groucho's Avisynth Stuff |
|
18th June 2019, 21:15 | #1212 | Link | |
Registered User
Join Date: Jan 2007
Posts: 45
|
Quote:
I decided to recreate the script a step at a time to see what frames I get when adding each feature:
I could probably live with 2fps but Autolevels seems to cause it to choke. |
|
18th June 2019, 21:56 | #1213 | Link |
Registered User
Join Date: Dec 2018
Location: Massachusetts USA
Posts: 25
|
I am doing something very similar. I would like to benchmark your script on my 32 core Threadripper, if someone could please provide me a link to a _x64 version of warpsharp. I think I have all the other 64 bit dlls.
What program are you running the 64 bit AviSynth+ in? How would you modify this script to write out a frame sequence? I have had some trouble with that. It may have been already mentioned, but with 8mm, you might get away with a lower source resolution and enjoy a higher speed. My old AviSynth script was using 2604x1738 px jpeg frames, and that was for 16mm films. My goal in AviSynth+ would be to export a high resolution frame sequence, for a final processing in Blender's fine compositor. Blender 3D would give me the final control of the levels, center box cropping and even stabilizing some inappropriate shakes from AviSynth's stabilizer. Blender's compositor functions may all be animated, so temporal adjustments are very practical. It is all also Open Source! I built my telecine from a Bell&Howell (filmosound) 1550, a eBay stepping motor controller, and Arduino Due, and bright LED lighting. My computer is a Threadripper 2950x (Windows 10) with 64GB memory. I sure would like to use all those threads! Who has a good link to a 64 bit warpsharp.dll ? Last edited by Meloware; 18th June 2019 at 22:01. |
18th June 2019, 23:03 | #1214 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Since it didn't do anything I would have expected that.
__________________
Groucho's Avisynth Stuff |
18th June 2019, 23:31 | #1216 | Link | ||
Registered User
Join Date: Sep 2007
Posts: 5,346
|
Quote:
Quote:
|
||
19th June 2019, 00:00 | #1217 | Link | |
Registered User
Join Date: Dec 2018
Location: Massachusetts USA
Posts: 25
|
Quote:
I had been using Virtualdub but I am now attempting to use 32 and 64 bit AvsPmod. Bassquake's script is now running. My input sequence images are 2604x1738 and his script is not modified. The script now runs in 64 bit AvsPmod at about 2 fps. I tried to use the "Save Image Sequence" macro, but it throws me an error "There is not bookmarks". An explanation would be helpful, but I do have to learn stuff on my own, as well. Getting Imagewriter() to work here will be priority this evening. It is not clear to me how you save rendered output in AvsPmod (such as in bassquake's version). |
|
19th June 2019, 07:59 | #1219 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,309
|
Quote:
|
|
19th June 2019, 09:31 | #1220 | Link | |
Registered User
Join Date: Jan 2007
Posts: 45
|
Quote:
Code:
ffmpeg -i "yourfile.avs" -r 1 "output_%04d.png" Or use jpgs to reduce disk size, setting the quality -q: Code:
ffmpeg -i "yourfile.avs" -q:v 1 "%05d.jpg" |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|