View Full Version : The power of Avisynth: restoring old 8mm films.
2Bdecided
16th July 2009, 15:30
Looking at 16.1.via...
Fred's being too polite - this transfer is terrible - it's not in focus - not even close! The levels are wrong, and it's not a frame-by-frame copy of the original - so it has frame blending throughout which makes it nearly impossible to use AVIsynth temporal denoisers properly.
It's just someone pointing a camcorder in full automode at a projector that's not set up properly. To be honest, it would be hard to do worse!
Find a proper frame-by-frame transfer service and have it done again.
...and please name and shame the cowboys who did this for you!
Cheers,
David.
superpat999
19th July 2009, 17:16
Hi David
I will not reveal the particular firm yet, I have to do a couple of things
Firstly I need to check the original film when projected, (I have to dig out the old Eumig, rescue it from the grave), and have a close look at the focus etc.
If it looks good, or even reasonable then, secondly, I need to complain about the quality of the avi's I got back!
It was supposed to be frame by frame transfer This is from the company I used, website's FAQ):-
How do you capture the image? I use frame by frame scanning which is by far the best way to capture the images from the film. This means they are flicker free and crystal clear and completely digital. Other company's use the useless method of an old projector with a camcorder at the side of it filming the projected image from the screen. Then there are others which use telecine machines from the 1980's which to be honest, is the same as the projector and camcorder method. It is still a projector but has a small camera built in which films the image in the gate rather than from on the screen. The problem here is that the cameras are from the eighties and not as good quality as todays camcorders, so you could say that you may even get a better image with the camcorder and projector method if it were not for the flicker problem.
Do you use analogue capturing methods? No. As stated above, because I use frame by frame scanning, the whole process is digital every step of the way. The quality of the transfer will be exactly as the film is, with no deterioration.
So there you go
regards
Patrick
rfmmars
19th July 2009, 19:07
First I can tell you that the film isn't that great. What you see projected is not always how the digitizing device sees it, different film brands have different color ranges. Can there be a better transfer, yes!!!
First things first, the camera I use is a Sony DXC 755 2/3" 3 chip camera with a Sony ANALOG video processor for color balance and B&W clamping, 760 lines 60db. s/n. I set for a medium gamma curve on capture so to have min. blocking in dark areas. I have a laser beam generator to put a red line on the capture anytime I stopped or reverse the projector for exposure adjustment correction, in post editing, that is taken out. No auto level/color ever. Then a custom avisynth / Vdub script is run on the entire assembled movie, average rendering time 2 days Then using Magix Edit Pro Plus 14, I do a manual scene by scene correction on the timeline using Vdub plugins.
Poor quality 2 hour movie will require my handywork for up to 8 hours, and a final render time of sometimes up to 1 day.
A company in the telecine business can not give you that kind of service, they would go broke.
There is simply not much good film out there to work with anymore. When it is good, the results are fantastic, better than video.
Not a simple business.
Richard
photorecall.net
henryperu77
20th July 2009, 22:40
Hello Fred
I was impress with your video restoration results. But could you upload some of your work in x264 or xvid in high resolutions, that online videos aren't really the proper way to watch them..
2Bdecided
22nd July 2009, 12:33
If you log in to vimeo (join - it's free) you can download the original files.
http://www.vimeo.com/2823934
Cheers,
David.
videoFred
23rd July 2009, 13:01
If you log in to vimeo (join - it's free) you can download the original files.
Thank you for explaining this while I was away David. :)
Those originals are in Microsofts Mpeg4 V3 codec, high bitrate. They will stay available for download because I have upgraded to Vimeo Pro.
Fred.
henryperu77
24th July 2009, 15:44
Ok thanks, just found the link on that page :P
bairradino
6th August 2009, 10:48
I'm trying to use the script but I have an 'Script error:there is no function named "SCSelect"'.
This error comes out when loading the Removedirt funtion.function RemoveDirt(clip input, bool "_grey", int "repmode")
{
_grey=default(_grey, false)
repmode=default(repmode, 16)
clmode=17
clensed=Clense(input, grey=_grey, cache=4)
sbegin = ForwardClense(input, grey=_grey, cache=-1)
send = BackwardClense(input, grey=_grey, cache=-1)
alt=Repair(SCSelect(input, sbegin, send, clensed, debug=true), input, mode=repmode, modeU = _grey ? -1 : repmode )
restore=Repair(clensed, input, mode=repmode, modeU = _grey ? -1 : repmode)
corrected=RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, gmthreshold=70, dist=1, dmode=2, debug=false, noise=10, noisy=12, grey=_grey)
return RemoveGrain(corrected, mode=clmode, modeU = _grey ? -1 : clmode )
}
Any help?
kemuri-_9
6th August 2009, 11:14
I'm trying to use the script but I have an 'Script error:there is no function named "SCSelect"'.
This error comes out when loading the Removedirt funtion.
Any help?
SCSelect and RestoreMotionBlocks are provided by the RemoveDirt.dll (the actual RemoveDirt plugin),
just be sure to load the proper version for your CPU
newlife007
6th August 2009, 14:30
I am getting a similar error in that the RemoveDirt.avs is telling me function Clense is not found. I have RemoveGrain 1.0 and have tried RemoveGrain 0.9. The dlls and the scripts are set
pref= stab2.blur(1.0).blur(1.0).RemoveDirt().tweak(sat=2.5)
noise_baseclip= stab2.unsharpmask(PRE_sharp_ness,PRE_radi_us,0).coloryuv(off_U=blue,off_V=red).tweak(sat=saturation)
vectors= pref.MVAnalyseMulti(refframes=denoising_frames, pel=2, blksize=block_size, overlap=block_over, idx=1)
denoised= noise_baseclip.MVDegrainMulti(vectors, thSAD=denoising_strenght, SadMode=1, idx=1).TemporalSoften(temp_radius,temp_luma,temp_chroma,15,2)
leveled=denoised.addborders(X,0,0,0,$FFFFFF).crop(X,0,-0,-0).deblock()
RemoveDirt.avs looks exactly like above
Loadplugin("c:\Program Files\AviSynth 2.5\plugins\Depan.dll")
LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\DepanEstimate.dll")
Loadplugin("c:\Program Files\AviSynth 2.5\plugins\RemoveGrain.dll")
Loadplugin("c:\Program Files\AviSynth 2.5\plugins\RemoveDirt.dll")
LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\Repair.dll")
LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\HDRAGC.dll")
LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\mvtools.dll")
LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\mvtools2.dll")
Loadplugin("c:\Program Files\AviSynth 2.5\plugins\mt_masktools-26.dll")
LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\MaskTools.dll")
Loadplugin("c:\Program Files\AviSynth 2.5\plugins\WarpSharp.dll")
LoadPlugIn("c:\Program Files\AviSynth 2.5\plugins\LimitedSupport_28Nov05.dll")
LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\MT.dll")
LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\autolevels.dll")
LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\AddGrainC.dll")
Import("c:\Program Files\AviSynth 2.5\plugins\LimitedSharpenFaster.avs")
Import("c:\Program Files\AviSynth 2.5\plugins\RemoveDirt.avs")
newlife007
7th August 2009, 00:57
Nevermind I found my answer. I changed the RemoveDirt.avs to RemoveDirt.avsi, error went away
videoFred
2nd September 2009, 14:44
I have done some new 8mm real filmshooting with a Canon 1014E. The filmstock was Kodak Ektachrome 64T.
The old Canon needs some greasing etc, so the result was good, but sometimes there where dark frames in an irregular pattern. Some kind of flickering. Fizicks deflicker() plugin followed by strong denoising has solved this isssue completely. :cool:
I have downscaled the original 1024x768 filmtransfer files to 980x720, so with two 150 pixels black borders, we have HD. I have also converted the frame rate from 18fps to 50fps with MFlowFPS(). You will notice the interpolation artefacts but, in general, the result is pretty good.
Clip:
http://www.vimeo.com/6377661
As usual, your feedback is very welcome.
Please register (free) and download the full version.
Fred.
videoFred
16th September 2009, 08:42
My improved script is available for download now, please see the first page of this thread. I have also added some links to find the needed plugins.
I have also uploaded lots of new film frames, all generated with the script of cource. All these frames are from recent films I have shot myself this summer. On Super-8 mm real film of cource. :)
The pictures can be found on the 'film frames' pages from my website.
Fred.
buzzqw
16th September 2009, 09:20
thanks for your work!
a little note the
MVTools.dll - special version, allows averaging of multiple frames.
is linked to rapidshare, and this is evil (and the link is broken)
i can host freely the package of all filters/script on my site (with direct link allowed)
please PM me if you are interested
BHH
videoFred
16th September 2009, 09:36
MVTools.dll - special version, allows averaging of multiple frames.
is linked to rapidshare, and this is evil (and the link is broken)
Thank you for reporting this! Perhaps someone else knows where to find it?
i can host freely the package of all filters/script on my site (with direct link allowed)
Thank you for the kind offer, but we must be very careful with the GPL rules. I have asked this at the moderator and he says the source code must also be included then.
Fred.
buzzqw
16th September 2009, 09:48
Thank you for reporting this! Perhaps someone else knows where to find it?
i can suggest you to made a big zip file of varius zipped filters needed (with source, as original package)
send me a pm with link to download it and i will publish it
BHH
videoFred
18th September 2009, 08:55
i can suggest you to made a big zip file of varius zipped filters needed (with source, as original package)
send me a pm with link to download it and i will publish it
BHH
Done!
It can be found on page 1 of this thread.
Fred.
tengo6dedos
22nd September 2009, 00:29
Hello videFred, thanks for the update and uploaded needs. I noticed the MT part is gone, does the script stoped supporting it or you just removed for compiability for all users?
saluts
videoFred
22nd September 2009, 06:27
I noticed the MT part is gone, does the script stoped supporting it or you just removed for compiability for all users?
Yes, and also because the slowest filter in the chain, MVToolsMulti, already supports multi core computers.
But please feel free to experiment with MT for the other filters.
If someone can speed up my script, I will be happy to hear it.
Fred.
pirej
14th January 2010, 23:41
Hi all.
This is my first post here on the forum, i just want to say THANK YOU all for sharing you're knowledge , especially to videoFred for the restoration script.
As i remember.. somewhere videoFred said that this script is not for VHS restoring, but i just wanted to give it a try.. :)
So, i have this crapy Pal VHS source that was originally captured in 1973 (i guess)with 8mm film > NTSC VHS > PAL VHS somewhere around 1995.
I have done a test capture in mjepg (720x576), and among (lot of)other things.. the lower fields are extremely bad.
I separated the fields, and served the script as video-source to this.. Fred's script, i made some modifications in it, and it really surprised me... positively :)
Maybe i have to do some more tweaking but.. im already happy with the result.
I have this screenshot of the processed lower field, so... judge you're self.
wonkey_monkey
15th January 2010, 03:13
videoFred, I had a look at some of your clips a week or two back - they're great examples of what AviSynth can do.
I was wondering if you have any clips that are - is there a word for this? - well exposed in some areas but too dark in areas? Like an indoor shot that includes a view outside to a bright day? I'm working on a filter and thought you might have something like that in your collection (like this (http://images.bit-tech.net/content_images/hl2_hdr_overview/hdr_archway_normalexposure.jpg)).
Thanks,
David
Blue_MiSfit
15th January 2010, 04:06
This thread continues to amaze me. You're doing fantastic stuff videoFred!
Cheers! Spread among my facebook friends!
FredThompson
15th January 2010, 19:03
What are the source of the agc and limitedsupport_20051128 dlls in the package?
The most recent limitedsupport from avisynth.org is version 20051221. Is there a reason to use verison 20051128?
Didée
15th January 2010, 20:13
LimitedSupport once was done by mg262 when MaskTools didn't have some of the needed filters, but actually they are included since many years. Versions of LSF that require LimitedSupport are stone old, and depreciated.
(I know there were reports that LimitedSupport versions were slightly faster - like 9.87 fps vs. 9.82 fps, you know ...)
FredThompson
16th January 2010, 16:14
LimitedSupport once was done by mg262 when MaskTools didn't have some of the needed filters, but actually they are included since many years. Versions of LSF that require LimitedSupport are stone old, and depreciated.
(I know there were reports that LimitedSupport versions were slightly faster - like 9.87 fps vs. 9.82 fps, you know ...)
So there's no reason to keep the LimitedSupport in the package, right?
knutinh
18th January 2010, 11:18
Thanks for this nice script. I have some questions that really are about "inverse telecine", but since my input is 8mm (most posts about IVTC seems to be about 24fps movie content) and I want to use it together with your script, I hope that it is ok for me to ask here.
I have been trying to process my 8mm films. I had them professionally transferred, and received 10GB of DV-PAL files.
The files appear to be 25/50 frames/fields interlaced, but the sequence seems to be somewhat irregular (tried stepping frame by frame in VirtualDub, and there appears to be no short pattern of combed/noncombed frames). I had hoped that each film-frame would be repeated in a regular pattern of 3 fields, meaning that the film would be slightly slowed down to 16.67fps.
I tried inserting Yadif in the script to get some kind of progressive input, but I guess there are some duplicate frames in the input. When looking at the output, it seems that I get very little denoising compared to your fantastic demo, no matter how many frames I use for averaging. So could it be that it is the duplicate frames that is fooling the denoising process?
BTW, there seems to be a slight error in your script (?). The trim_start parameter is used as expected, but trim_end is never used, and a hard-coded zero is used instead.
-k
videoFred
18th January 2010, 11:23
I was wondering if you have any clips that are - is there a word for this? - well exposed in some areas but too dark in areas?
David
Hi David,
In some cases, the HDR (AGC) filter does the trick.. But actualy I have changed my opinion about this kind of corrections. It often looks unnatural. A bit of gamma is often enough to brighten up the dark parts.
Anyhow, you can also do a search for Didee's 'Ylevels' filters. They are build in in MPlayer Classic.
Fred.
videoFred
18th January 2010, 11:29
Versions of LSF that require LimitedSupport are stone old, and depreciated.
It looks like I must update my plugins then :)
Fred.
videoFred
18th January 2010, 11:33
As i remember.. somewhere videoFred said that this script is not for VHS restoring, but i just wanted to give it a try.. :)
Sorry, but here are much better VHS restoring tools available here. Again, my script is made for improving real film transfers, straight to digital that is. The better the quality of the transfer, the better the script will work.
Fred.
videoFred
18th January 2010, 11:40
When looking at the output, it seems that I get very little denoising compared to your fantastic demo, no matter how many frames I use for averaging. So could it be that it is the duplicate frames that is fooling the denoising process?
Yes, of cource. You will have to remove the duplicate frames! Have you tried smoothdeinterlacer() for deinterlacing?
BTW, there seems to be a slight error in your script (?). The trim_start parameter is used as expected, but trim_end is never used, and a hard-coded zero is used instead.
I will have a look at this...
Fred.
Ovidiu
17th March 2010, 19:19
http://img697.imageshack.us/i/filmrestoration.jpg/Hi guys who want to help me with this scriptu not look good and I do not know what settings to look something like him
film="C:\Users\Ovidiu\Desktop\Passengers.avi"
short="L" # L=long clip S=short clip try it!
result="resultS3" # specify the wanted output here
trim_begin=6 trim_end=6 play_speed=18.75 #trim frames and play speed (PAL: 16.6666 or 18.75)
saturation=1.0 #saturation
X=4 gamma=0.7 # X is a special parameter for reducing the autolevels effect
black_level=0 white_level=255 output_black=0 output_white=255 # manual levels, when returning result4
AGC_max_sat=2 AGC_max_gain=1.0 #parameters of HDRAGC filter, improves colors and shadows
blue=-4 red=2 #manual color adjustment, when returning result2. Values can be positive or negative
denoising_strenght=800 #denoising level of first denoiser: MVDegrainMulti()
denoising_frames= 4 #number of frames for averaging (forwards and backwards) 3 is a good start value
block_size= 16 #block size of MVDegrainMulti()
block_over= 4 #block overlapping of MVDegrainMulti()
temp_radius=20 temp_luma=6 temp_chroma=6 #second denoiser: TemporalSoften
grain_luma=10 grain_chroma=10
# this will add some digital grain to the final result, set it to zero if you do not want it.
LSF_sharp_ness=250 LSF_radi_us=3 LSF_sub=1.5 #first sharpening parameters (LimitedSharpenFaster) sub=subsampling
USM_sharp_ness=40 USM_radi_us=2 USM_thres_hold=0 #second sharpening parameters (UnsharpMask)
USM_sharp_ness2=20 USM_radi_us2=1 USM_thres_hold2=0 #third sharpening parameters (UnsharpMask)
maxstab=60 #maximum values for the stabiliser (in pixels) 20 is a good start value
est_left=20 est_top=20 est_right=20 est_bottom=20 est_cont=0.8 #crop values for special Estimate clip
CLeft=30 CTop=30 CRight=30 CBottom=30 #crop values after Depan and before final resizing (40,30,40,30)
W=720 H=576 #final size from the returned clip
bord_left=0 bord_top=0 bord_right=0 bord_bot=0
SetMemoryMax(1024)
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ovidiu\DePan.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ovidiu\DePanEstimate.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ovidiu\RemoveGrain.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ovidiu\AGC.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ovidiu\mvtools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ovidiu\mt_masktools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ovidiu\MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ovidiu\WarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ovidiu\LimitedSupport_09Jan06B.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ovidiu\autolevels.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ovidiu\AddGrainC.dll")
Import("C:\Program Files\AviSynth 2.5\Plugins\ovidiu\LimitedSharpenFaster.avs")
source1= AVISource("C:\Users\Ovidiu\Desktop\Passengers.avi").assumefps(play_speed).trim(trim_begin,0).converttoYV12()
end= source1.framecount()
end2= end-trim_end
frames=end+trim_begin
skip= end2/5
skip0=skip+3
skipend= 3
skipend1= skip0+3
skip2= skipend1+skip
skipend2= skip2+3
skip3= skipend2+skip
skipend3= skip3+3
skip4= skipend3+skip
skipend4= skip4+3
skip5= end2-3
L= trim(source1,0,end2)
LS= trim(source1,0,end2).scriptclip("""subtitle("frame "+string(trim_begin+current_frame)\
+" from "+string(frames)+" trim_begin-"+string(trim_begin)+" trim_end-"\
+string(trim_end),x=100,y=60,size=32)""")
sourceT1= trim(source1,0,skipend).scriptclip("""subtitle("frame "+string(trim_begin+current_frame)\
+" from "+string(frames)+" trim_begin-"+string(trim_begin)+" trim_end-"+string(trim_end)\
+" steps: "+string(skip),x=100,y=60,size=32)""")
sourceT2= trim(source1,skip0,skipend1).scriptclip("""subtitle("frame "+string(trim_begin+skip0+current_frame)\
+" from "+string(frames)+" trim_begin-"+string(trim_begin)+" trim_end-"+string(trim_end)+" steps: "\
+string(skip),x=100,y=60,size=32)""")
sourceT3= trim(source1,skip2,skipend2).scriptclip("""subtitle("frame "+string(trim_begin+skip2+current_frame)\
+" from "+string(frames)+" trim_begin-"+string(trim_begin)+" trim_end-"+string(trim_end)+" steps:\
"+string(skip),x=100,y=60,size=32)""")
sourceT4= trim(source1,skip3,skipend3).scriptclip("""subtitle("frame "+string(trim_begin+skip3+current_frame)\
+" from "+string(frames)+" trim_begin-"+string(trim_begin)+" trim_end-"+string(trim_end)+\
" steps: "+string(skip),x=100,y=60,size=32)""")
sourceT5= trim(source1,skip4,skipend4).scriptclip("""subtitle("frame "+string(trim_begin+skip4+current_frame)\
+" from "+string(frames)+" trim_begin-"+string(trim_begin)+" trim_end-"+string(trim_end)+\
" steps: "+string(skip),x=100,y=60,size=32)""")
sourceT6= trim(source1,skip5,end2).scriptclip("""subtitle("frame "+string(trim_begin+skip5+current_frame)\
+" from "+string(frames)+" trim_begin-"+string(trim_begin)+" trim_end-"+string(trim_end)+\
" steps: "+string(skip),x=100,y=60,size=32)""")
SS= sourceT1+sourceT2+sourceT3+sourceT4+sourceT5+sourceT6
sourceT10= trim(source1,0,skipend)
sourceT20= trim(source1,skip0,skipend1)
sourceT30= trim(source1,skip2,skipend2)
sourceT40= trim(source1,skip3,skipend3)
sourceT50= trim(source1,skip4,skipend4)
sourceT60= trim(source1,skip5,end2)
S= sourceT10+sourceT20+sourceT30+sourceT40+sourceT50+sourceT60
stab_reference= eval(short).crop(est_left,est_top,-est_right,-est_bottom)\
.tweak(cont=est_cont).binarize(threshold=80).greyscale().invert()
mdata=DePanEstimate(stab_reference,trust=1.0,dxmax=maxstab,dymax=maxstab)
stab=DePanStabilize(eval(short),data=mdata,cutoff=0.5,dxmax=maxstab,dymax=maxstab,method=1,mirror=15)
stab2= stab.crop(CLeft,CTop,-CRight,-CBottom).tweak(sat=saturation)
stab3=DePanStabilize(eval(short),data=mdata,cutoff=0.5,dxmax=maxstab,dymax=maxstab,method=1,info=true)
WS= width(stab)
HS= height(stab)
stab4= stab3.addborders(10,10,10,10,$B1B1B1).Lanczos4Resize(WS,HS)
vectors= stab2.MVAnalyseMulti(refframes=denoising_frames, pel=2, blksize=block_size, overlap=block_over, idx=1)
denoised= stab2.MVDegrainMulti(vectors, thSAD=denoising_strenght, SadMode=1, idx=1).tweak(sat=saturation)
leveled= denoised.HDRAGC(coef_gain=2.0,max_gain=AGC_max_gain,min_gain=0.5,max_sat=AGC_max_sat,shadows=true)
sharp1=limitedSharpenFaster(leveled,smode=1,strength=LSF_sharp_ness,overshoot=50,\
radius=LSF_radi_us, ss_X=LSF_sub, SS_Y=LSF_sub, dest_x=W,dest_y=H)
sharp2= unsharpmask(sharp1,USM_sharp_ness,USM_radi_us,USM_thres_hold)
sharpX= unsharpmask(sharp2,USM_sharp_ness2,USM_radi_us2,USM_thres_hold2)
sharp3= sharpX.TemporalSoften(temp_radius,temp_luma,temp_chroma,15,2).addgrainC(grain_luma,grain_chroma,0.2,0.2,5)
#backward_vectors = sharp3.MVAnalyse(isb = true,truemotion=true,idx=2)
#forward_vectors = sharp3.MVAnalyse(isb = false,truemotion=true,idx=2)
#frameclip=MVFlowFps(sharp3,backward_vectors, forward_vectors, num=25, den=1, ml=100, idx=2)
result1= sharp3.addborders(X,0,0,0,$FFFFFF).levels(0,gamma,255,0,255).autolevels().coloryuv(autowhite=true)\
.crop(X,0,-0,-0).addborders(bord_left, bord_top, bord_right, bord_bot)
result2= sharp3.levels(black_level,gamma,white_level,0,255).coloryuv(autowhite=true)\
.addborders(bord_left, bord_top, bord_right, bord_bot)
result3= sharp3.coloryuv(off_U=blue,off_V=red).levels(0,gamma,255,0,255).addborders(X,0,0,0,$FFFFFF)\
.autolevels().crop(X,0,-0,-0).addborders(bord_left, bord_top, bord_right, bord_bot)
result4= sharp3.coloryuv(off_U=blue,off_V=red).levels(black_level,gamma,white_level,0,255)\
.addborders(bord_left, bord_top, bord_right, bord_bot)
result5= overlay(eval(short),stab_reference,x=est_left,y=est_top).addborders(2,2,2,2,$FFFFFF).Lanczos4Resize(WS,HS)
W2= W+bord_left+bord_right
H2= H+bord_top+bord_bot
short2=short+"S"
source2=Lanczos4Resize(eval(short2),W2,H2)
source3=Lanczos4Resize(eval(short2),W,H)
resultS1= stackhorizontal(subtitle(source2,"original",size=32,align=2)\
,subtitle(result1,"autolevels, autowhite",size=28,align=2))
resultS2= stackhorizontal(subtitle(source2,"original",size=32,align=2)\
,subtitle(result2,"autowhite, manual levels correction",size=28,align=2))
resultS3= stackhorizontal(subtitle(source2,"original",size=32,align=2)\
,subtitle(result3,"autolevels + manual color correction",size=28,align=2))
resultS4= stackhorizontal(subtitle(source2,"original",size=32,align=2)\
,subtitle(result4,"manual colors and levels correction",size=28,align=2))
resultS2H= stackhorizontal(subtitle(source2,"original",size=32,align=2)\
,subtitle(result2,"autowhite, manual levels correction",\
size=28,align=2).histogram(mode="levels"))
resultS3H= stackhorizontal(subtitle(source2,"original",size=32,align=2),\
subtitle(result3,"autolevels + manual color correction",\
size=28,align=2).histogram(mode="levels"))
resultS4H= stackhorizontal(subtitle(source2,"original",size=32,align=2),\
subtitle(result4,"manual colors and levels correction",\
size=28,align=2).histogram(mode="levels"))
result6= stackhorizontal(subtitle(result5,"baseclip for stabiliser -only the B/W clip is used",size=32,align=2)\
,subtitle(stab4,"test stabiliser: dx=horizontal, dy=vertical",size=32,align=5))
Eval(result)
Ovidiu
17th March 2010, 19:28
http://img697.imageshack.us/i/filmrestoration.jpg/
osgZach
18th March 2010, 16:27
Holy crap... Fred,
This work belongs in a museum !
Floatingshed
3rd April 2010, 17:14
I've been meaning to give this a go for ages. Today I made the attempt only to be halted by "unable to load warpsharp.dll".
I'm using the filter collection included with the script and I've disabled all other plugins. Avisynth 257 on windows xp sp3.
Any ideas most welcome...
Thanks.
videoFred
5th April 2010, 12:42
I've been meaning to give this a go for ages. Today I made the attempt only to be halted by "unable to load warpsharp.dll".
This is a known problem with certain versions of warpsharp.dll.
Please try this one: (right click, save target as..)
http://www.super-8.be/avisynth/warpsharp.dll
Please let me know if it works now!
Fred.
Floatingshed
6th April 2010, 05:08
That fixed it. Many thanks.
kopmjj
16th April 2010, 18:20
hey i have to say even tho its n ot intended for video on pc it does brilliant! i have managed to find my best settings but i have 1 problem, how do i keep the same framerate as input video?
i tried messing with the framerate settings on the script but it doesnt work. my video is ntsc .
because when i save the video file it plays in slow motion. what can i do thanks.
kopmjj
17th April 2010, 02:53
just what part of the script do i change or delete to keep the same framerate or not to touch the freamerate? please thanks
videoFred
19th April 2010, 06:42
just what part of the script do i change or delete to keep the same framerate or not to touch the freamerate? please thanks
1) Remove the "assumefps(play_speed)" from this line:
source1= AviSource(film).assumefps(play_speed).trim(trim_begin,0).converttoYV12()
New code:
source1= AviSource(film).trim(trim_begin,0).converttoYV12()
2) Remove this:
super2= denoised2.MSuper()
backward_vec2= MAnalyse(super2, isb=true)
forward_vec2= MAnalyse(super2, isb= false)
interpolated= denoised2.MFlowFps(super2, backward_vec2, forward_vec2, num=numerator, den= denumerator, ml=100).TemporalSoften(temp_radius,temp_luma,temp_chroma,15,2)
3) This must be changed then, because it refers to 'interpolated' but we just have removed it:
super3= interpolated.MSuper()
backward_vec3= MAnalyse(super3, isb=true)
forward_vec3= MAnalyse(super3, isb= false)
sharp3= interpolated.MFlowBlur(super3, backward_vec3, forward_vec3, blur=mo_blur)
4) so it must refer to the last clip in the script and this is denoised2. So this code must be :
super3= denoised2.MSuper()
backward_vec3= MAnalyse(super3, isb=true)
forward_vec3= MAnalyse(super3, isb= false)
sharp3= denoised2.MFlowBlur(super3, backward_vec3, forward_vec3, blur=mo_blur)
Everything that changes the play speed and the final frame rate is removed now. I have not tested this, but it should be OK. Please let me know if it works for you.
The TemporalSoften() was applied just after the interpolation, but we have removed this... So if you still want some TemporalSoften(), you must add it here:
denoised2= sharp2.MDegrain1(super, backward_vec,forward_vec,thSAD= second_denoising_strenght).sharpen(last_sharp).TemporalSoften(temp_radius,temp_luma,temp_chroma,15,2)
Keep the original script safe and do the editing on a copy!
Fred.
videoFred
22nd April 2010, 12:21
I'm still playing around with the script, to get optimal results.
Newest clip:
http://www.vimeo.com/11133342
This time I have used less sharpening radius 3 and a bit more radius 2 sharpening and no frame interpolation.
Again I notice that the grain removing by averaging 6 frames actualy makes more detail visible.
Fred.
CruNcher
22nd April 2010, 12:57
Especially the Debluring stage (guess that's mainly Didée LSF work) looks very nice playing around currently with super resolution i guess it could also help here getting the original feel back, of course the lost details are lost :)
Original = http://img689.imageshack.us/img689/815/originalw.jpg
Before SR = http://img689.imageshack.us/img689/754/nosr.jpg
After SR = http://img689.imageshack.us/img689/139/14790490.jpg
actually i expected more from SR but it might be the implementation in this case MotionDSPs consumer one (GPU) :(
kopmjj
24th April 2010, 09:46
thank you video fred 1 more question sometime on a dark scene i get white scatches or white marks in lines, but when i adjust pref= stab2.blur(0.00).blur(1.58).tweak(sat=10.0)
the blur bit it goes away but appears in other parts of the video do you know how i can get rid of it completely?
videoFred
26th April 2010, 06:41
thank you video fred 1 more question sometime on a dark scene i get white scatches or white marks in lines, but when i adjust pref= stab2.blur(0.00).blur(1.58).tweak(sat=10.0)
I must see an example to know what this is.
But I do not use the prefiltered clip any more.
I am preparing an update.
In the mean time you could delete or disable the 'pref=...' code.
The next code line must then be: "vectors= stab2.MVAnalyseMulti..."
Fred.
videoFred
27th April 2010, 09:40
Newest script and helpfile can be found here:
http://www.super-8.be/avisynth/Film_Restoring.zip
Fred.
kopmjj
28th April 2010, 03:56
thank you for this ill have a go at this.
edit: i had a quick preview and 2 questions how do i get rid of original vs final output preview? what line do i edit i didnt get that in previous script.
also with the framerate i want to leave my original 29.970 do i do the above instructions u gave or do i have to do anything different?
thanks a lot for this.
ok i read your manual for this i have figured it out thanks, if i can sort the fps out ill reply back but thanks you for this great script.
kopmjj
28th April 2010, 06:56
ok videofred 1 last help please im trying to figure this out but am really stuck.
from your script all i want to do is add the following only....
#COLOR AND LEVELS PARAMATERS
#----------------------------------------------------------------------------------------------------------------------------
saturation=1.3 #for all outputs
gamma=0.8 # for all outputs
blue= -0 red=-0 #manual color adjustment, when returning result3. Values can be positive or negative
black_level=0 white_level=255 output_black=0 output_white=255 # manual levels, when returning result4
#DENOISING PARAMETERS
#----------------------------------------------------------------------------------------------------------------------------
denoising_strenght=400 #denoising level of first denoiser: MVDegrainMulti()
denoising_frames= 6 #number of frames for averaging (forwards and backwards) 3 is a good start value
block_size= 16 #block size of MVDegrainMulti()
block_size_v= 16
block_over= 8 #block overlapping of MVDegrainMulti()
second_denoising_strenght= 300 #denoising level of second denoiser: MDegrain1()
temp_radius=4 temp_luma=3 temp_chroma=3 #final smoother: TemporalSoften()
#FOUR STEP SHARPENING PARAMETERS
#--------------------------------------------------------------------------------------------------------------------------------
PRE_sharp_ness=5 PRE_radi_us= 3 #presharpening (UnsharpMask) just after first denoising
LSF_sharp_ness=5 LSF_radi_us=2 LSF_sub=1.5 #second sharpening parameters (LimitedSharpenFaster) sub=subsampling
USM_sharp_ness2=5 USM_radi_us2=1 USM_thres_hold2=0 #third sharpening parameters (UnsharpMask)
last_sharp= 0.5 # final sharpening step after interpolation
mo_blur= 5 #this will add some motion blur, can be useful in panning scenes etc..
#AUTO LEVELS PARAMETER
#--------------------------------------------------------------------------------------------------------------------------------
X=0 # X is a special parameter for reducing the autolevels effect on the whites
X2=0 # X2 is a special parameter for reducing the autolevels effect on the blacks
basically i want to keep all the color,levels,denoising,sharpening filters and remove the rest eg: stablizing,crop,framerate etc.
how do i do this? please show me a script thanks.
videoFred
28th April 2010, 07:08
how do i do this? please show me a script thanks.
I am sorry my friend but:
:readguid:
Fred.
kopmjj
28th April 2010, 09:12
I am sorry my friend but:
:readguid:
Fred.
i read the guide but it doesnt tell me how to remove those things, and if i could use those filters i would but i dont know how.
all i want is that sharpening and noise filter, i have never seen that sharpening script before when i try that on its own it dont work.
even though i loaded the plugins. maybe a different way to type the script? also how do i use your noise reduction script on its own?
please man this will be a lifesaver thanks.
videoFred
28th April 2010, 09:38
I have showed you how to remove the interpolation, have I not? It's only a few postings above here.
That's it. If you do not want any stabilisation, set those parameters to zero.
If you do not want to resize, remove dest_x and dest_y from the limitedsharpen() call.
I do not write custom scripts for others. You realy should learn this yourself. Keep the original, and modify a copy. If it won't work, try to figure out why not. I have learned it myself this way, a few years ago. I was a complete novice myself. This approach is very good to learn how Avisynth works.
But if you modified script realy won't work, you can always ask here :)
Fred.
2Bdecided
28th April 2010, 10:54
I do not write custom scripts for others.More than that, it was very generous of Fred to share his work here - he could charge a lot for the quality of work he's doing, but he's shared so much information for free.
It'll discourage this level of sharing from others in future if people see one act of generosity, and assume this means that the author has infinite time to debug other people's problems for free!
I can second Fred's advise that learning by experimenting is the way to do. It's fine to ask "stupid" questions (I make a habit of it), but probably not fine to ask someone else directly to do all the work for you (even though, sometimes, someone will do exactly that in response to a new challenge/question that's not been tackled before).
Cheers,
David.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.