8mm Avisynth film restoring script

Forum covering all aspects of small gauge cinematography! This is the main discussion forum.

Moderator: Andreas Wideroe

User avatar
VideoFred
Senior member
Posts: 1940
Joined: Tue May 25, 2004 10:15 am
Location: Flanders - Belgium - Europe
Contact:

8mm Avisynth film restoring script

Post by VideoFred »

Good morning everybody,

I have worked hard lately on an Avisynth 8mm film restoring script.
The script does the following:

- stabilizing both jitter and camera shaking
- removing flickering
- resizing/cropping
- subtile 3 step sharpening
- removing dirt spots etc..
- heavy degraining
- changing frame rate by interpolation

Example clip:
http://www.vimeo.com/13173031

Thread about the scipt:
http://forum.doom9.org/showthread.php?t=144271

Your feedback is most welcome,
Fred.
my website:
http://www.super-8.be

about film transfering:
https://www.youtube.com/channel/UC_k0IKckACujwT_fZHN6jlg
User avatar
Juergen
Posts: 680
Joined: Sun Jun 06, 2004 11:56 am
Contact:

Re: 8mm Avisynth film restoring script

Post by Juergen »

Dear Freddy,

great work - and great improvements. Congratulations! schmalfilm already put some lines into the news section on www.schmalfilm.de with your example on vimeo.

Of course not everybody is interested in improving his film in this way - some may love grain and unsteadyness as this is typical for 8mm - but those may use the other parts of your skript to improve colors and sharpness.

Your're invited to write another article for schmalfilm magazine about your great work!

Juergen
http://www.atollmedien.de
the books about all cameras and projectors ever built
User avatar
superadio
Posts: 101
Joined: Fri May 09, 2008 11:50 am
Real name: Magnus Tveiten
Location: Norway

Re: 8mm Avisynth film restoring script

Post by superadio »

Hi. Yes, this really look great. Is this something for amateurs like me? or is this proff stuff?
User avatar
VideoFred
Senior member
Posts: 1940
Joined: Tue May 25, 2004 10:15 am
Location: Flanders - Belgium - Europe
Contact:

Re: 8mm Avisynth film restoring script

Post by VideoFred »

Juergen wrote:
great work - and great improvements. Congratulations!
Again, thank you Jürgen :oops:

Fred.
my website:
http://www.super-8.be

about film transfering:
https://www.youtube.com/channel/UC_k0IKckACujwT_fZHN6jlg
User avatar
VideoFred
Senior member
Posts: 1940
Joined: Tue May 25, 2004 10:15 am
Location: Flanders - Belgium - Europe
Contact:

Re: 8mm Avisynth film restoring script

Post by VideoFred »

superadio wrote:Hi. Yes, this really look great. Is this something for amateurs like me? or is this proff stuff?
I am an amateur myself! What you need is a good transfer machine (progressive, no interlacing!) and all the rest is freeware (Avisynth, VirtualDub etc..). And lots of time and experiments.

Fred.
my website:
http://www.super-8.be

about film transfering:
https://www.youtube.com/channel/UC_k0IKckACujwT_fZHN6jlg
User avatar
Andreas Wideroe
Site Admin
Posts: 2273
Joined: Tue Apr 30, 2002 4:50 pm
Real name: Andreas Wideroe
Location: Kristiansand, Norway
Contact:

Re: 8mm Avisynth film restoring script

Post by Andreas Wideroe »

Impressive Fred! Great work.

Can Avisynth handle 10bit files or other codecs like v210, blackmagic, aja or bluefish444? Do you know?

SD and HD?

Cheers,
Andreas
Andreas Wideroe
Filmshooting | Com - Administrator

Please help support the Filmshooting forum with donations
User avatar
VideoFred
Senior member
Posts: 1940
Joined: Tue May 25, 2004 10:15 am
Location: Flanders - Belgium - Europe
Contact:

Re: 8mm Avisynth film restoring script

Post by VideoFred »

awand wrote:Impressive Fred! Great work.
Thank you too Andreas!
Can Avisynth handle 10bit files or other codecs like v210, blackmagic, aja or bluefish444? Do you know?
Avisynth works with 8 bits internal. I guess it will be possible to open your 10bit files, but Avisynth will convert them to 8 bits, unfortunately. On the other hand, as you can see, my 8-bits files are still pretty good in quality. I'm not a big fan of heavy color corrections.
SD and HD?
The size of the frame can be anything, the used codec is another matter. But the Avisynth command 'DirectShowSource()' will open almost anything, if the codec is intalled on your system of cource.

But Christoph knows a lot more about all this. :wink:

Fred.
my website:
http://www.super-8.be

about film transfering:
https://www.youtube.com/channel/UC_k0IKckACujwT_fZHN6jlg
christoph
Senior member
Posts: 2486
Joined: Fri Jul 25, 2003 2:36 pm
Location: atm Berlin, Germany

Re: 8mm Avisynth film restoring script

Post by christoph »

i agree that this script is most likely the best source for those who want to improve their super8 transfers (myself i'm more of a soft, grainy guy ;).

avisynth works only in 8bit internally, but that's really not a problem for screen playback because a well done 8bit frame looks identical to the eye to a 10 or 16bit frame. actually everybody who uses a normal screen sees 8bit max anyway (more likely 6-7bit unless they spent a lot of money), and nearly all printers use 8bit color space.

you only need more then 8bit if the original transfer is way too dark or too high contrast, and even then it's only useful if the component used are of high quality (no use to record audio with 192kHz 24bit on a 200EUR device either).

most avisynth filters work only in YV12 mode (which is something like YUV 4:2:0).. that means color subsampling is not the best, but then again most people will watch it in this color space anyway in the end (mpeg2, mpeg4, h264, DV, DVD, Blu-Ray etc), so if carefully done you don't loose anything, and in HD this is a non issue anyway.

it is advisable to use an uncompressed or visual lossless codec on the original transfer and intermediate steps though for critical work.

anyway the proof is in the pudding - or in this case in fred's clip!
(btw, download the original avi file on vimeo for best quality)

also it's worth mentioning that the clip is only PAL sized, yet i dare any HD system to get more detail out of it (sorry couldn't resist ;)

++ christoph
User avatar
VideoFred
Senior member
Posts: 1940
Joined: Tue May 25, 2004 10:15 am
Location: Flanders - Belgium - Europe
Contact:

Re: 8mm Avisynth film restoring script

Post by VideoFred »

christoph wrote: also it's worth mentioning that the clip is only PAL sized, yet i dare any HD system to get more detail out of it (sorry couldn't resist ;)

++ christoph
I agree :D

Fred.
my website:
http://www.super-8.be

about film transfering:
https://www.youtube.com/channel/UC_k0IKckACujwT_fZHN6jlg
User avatar
Andreas Wideroe
Site Admin
Posts: 2273
Joined: Tue Apr 30, 2002 4:50 pm
Real name: Andreas Wideroe
Location: Kristiansand, Norway
Contact:

Re: 8mm Avisynth film restoring script

Post by Andreas Wideroe »

Hi Fred,
Just playing around with your script here and I've never used AVISYNTH before so here are 3 newbie questions:

1. If I want less contour correction/sharpening. What parameters do I play with?
2. How do I add a deinterlacer to the script so that interlaced video first is deinterlaced and what filter+settings do you recommend?
3. I have some 72op files I'd like to try. To get 16x9 aspect and 1280x720, do I only change this line? W=720 H=576 #final size after cropping

PS! It seems to open and work well with 10bit blackmagic files.

Cheers!
Andreas
Andreas Wideroe
Filmshooting | Com - Administrator

Please help support the Filmshooting forum with donations
User avatar
Blue Audio Visual
Posts: 794
Joined: Fri May 05, 2006 7:40 pm
Location: London
Contact:

Re: 8mm Avisynth film restoring script

Post by Blue Audio Visual »

Hi Andreas,

You can use the deinterlace filter in Virtual Dub, but this will just replace an interlaced frame with frames before or after it.

I'm pretty sure you can download the same filter into AviSynth.

In AviSynth you can use the SelectEvery command, but this will depend on your pulldown pattern.

For instance in the case of a simple 18fps film transferred as if it was 16.666fps the pulldown might be Frame1, Frame2, 1/2 Frame2 + 1/2 Frame3, Frame 3, frame 4, 1/2 Frame4 + 1/2 Frame5, Frame5 etc. etc.

So it is increasing the frame rate of 16.66 to 25 by adding an interlaced frame every third frame.

In that case the AviSynth command would be SelectEvery(3,0,2), or SelectEvery(3,1,2), or SelectEvery(3,0,1) depending on where in the sequence the interlaced pulldown occurs.

If it is a more complex pulldown you'll need to come up with a different pattern.

Fred's script will then render it back out as 25fps using interpolation instead (depends on which version you are using?).

I've only played around with deinterlacing a little bit, so there may well be a better method.
User avatar
VideoFred
Senior member
Posts: 1940
Joined: Tue May 25, 2004 10:15 am
Location: Flanders - Belgium - Europe
Contact:

Re: 8mm Avisynth film restoring script

Post by VideoFred »

awand wrote:Hi Fred,
Just playing around with your script here and I've never used AVISYNTH before so here are 3 newbie questions:
Nice! You have the newest RemoveDirt version I hope?
Also, I suggest to use VDubMod because there's a build-in Avisynth editer.
1. If I want less contour correction/sharpening. What parameters do I play with?
Please try:
PRE_sharp_ness =60
USM_sharp_ness= 30
last_sharp= 0.1

Or set all these parameters to zero and start with very low values. The first parameter is the most critical for halo's because the radius is bigger. You can also play with the radius and see what you get.
2. How do I add a deinterlacer to the script so that interlaced video first is deinterlaced and what filter+settings do you recommend?
Deinterlacing is always very tricky, start with progressive files if possible. But there is a SmoothDeinterlacer.dll available. Load this dll in the script and add " .Smoothdeinterlace()" at the end of the "source1= Avisource....." line. But perhaps Barts method works better. I have very limited experience with deinterlacing because I always work with progressive files.
3. I have some 72op files I'd like to try. To get 16x9 aspect and 1280x720, do I only change this line? W=720 H=576 #final size after cropping
Yes, that's all. But for the correct 16x9 aspect ratio you might have to change the crop values too.
PS! It seems to open and work well with 10bit blackmagic files.
Very good! I'm happy it works for you. :wink:

Fred.
my website:
http://www.super-8.be

about film transfering:
https://www.youtube.com/channel/UC_k0IKckACujwT_fZHN6jlg
User avatar
VideoFred
Senior member
Posts: 1940
Joined: Tue May 25, 2004 10:15 am
Location: Flanders - Belgium - Europe
Contact:

Re: 8mm Avisynth film restoring script

Post by VideoFred »

Blue Audio Visual wrote: Fred's script will then render it back out as 25fps using interpolation instead
Yes, but this can be disabled by setting play_speed and numerator to the same value. Denumerator must be set to 1 then. Rendering back to the needed FPS can be done with changeFPS() then. For those who do not like the interpolation artifacts. :)

Fred.
my website:
http://www.super-8.be

about film transfering:
https://www.youtube.com/channel/UC_k0IKckACujwT_fZHN6jlg
User avatar
Andreas Wideroe
Site Admin
Posts: 2273
Joined: Tue Apr 30, 2002 4:50 pm
Real name: Andreas Wideroe
Location: Kristiansand, Norway
Contact:

Re: 8mm Avisynth film restoring script

Post by Andreas Wideroe »

Fred and Bart,
Thanks for your replies. Will check it out further tomorrow at work if I find time for it.

Just one thing. I mostly work with 24fps and 25fps films. In the script I see that it's made for 16.666 and 18.75fps. If I want to render the final output file to Ie. 24fps or 25fps, what do I do then?

Cheers,
Andreas
Andreas Wideroe
Filmshooting | Com - Administrator

Please help support the Filmshooting forum with donations
User avatar
CineGuerrilha
Posts: 97
Joined: Thu Oct 25, 2007 11:14 pm

Re: 8mm Avisynth film restoring script

Post by CineGuerrilha »

unbelievable. Now I can see that the idea that s8 can hold large resolutions is true. I am dumping my 35mm!
Post Reply