Log in

View Full Version : The power of Avisynth: restoring old 8mm films.


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 [19] 20 21 22 23 24 25 26 27 28 29 30 31

Groucho2004
6th November 2014, 15:11
@papcom
Somehow the various hints about using an external image host are not sinking in.
If you attach a file here, a moderator has to approve the attachment first which can take a while.
So, as mentioned several times before, use postimg, imgur or something else.

papcom
6th November 2014, 17:51
@papcom
Somehow the various hints about using an external image host are not sinking in.
If you attach a file here, a moderator has to approve the attachment first which can take a while.
So, as mentioned several times before, use postimg, imgur or something else.
Yes definitely they are sinking in! I tried to do so. EVERY service wants a registration and tracks down other things.

I do not understand where exactely the problem with the moderator and the approvement is? Is it a question of speed or endeavor or what?

a propos...If doom9-forum does not want to have attachements to its forumthreads why not simply shut off the possibility to upload
attachements. Are You @groucho2004 a forum moderator?

Groucho2004
6th November 2014, 18:07
EVERY service wants a registration and tracks down other things.
Not my experience. For example - goto postimg.org or postimg.com, upload image, grab the link. Takes 10 seconds or less.

Are You @groucho2004 a forum moderator?
No.

papcom
6th November 2014, 18:18
I put it into my "dropbox" ...here the link again
https://www.dropbox.com/s/vibrmd5gbgw9sq6/runner_degrained.JPG?dl=0

poisondeathray
6th November 2014, 18:53
I do not understand where exactely the problem with the moderator and the approvement is? Is it a question of speed or endeavor or what?

a propos...If doom9-forum does not want to have attachements to its forumthreads why not simply shut off the possibility to upload
attachements.

In the past, this function has been abused. Put you mind in the gutter for a second and think of what nasty things you could upload. Because it's happened before.

So attachments now have to be reviewed. Obviously, moderators have real lives and cannot review everything immediately, so there is a lag time

On the other hand, some image hosts delete their content after "x" months . So if I go looking for some old threads, often some of the examples, images are missing. Keeping attachments within forum host should preserve them indefinitely

Anyways this is offtopic and if you want to disucuss it , it should be done in the feedback section

foxyshadis
13th November 2014, 01:35
Reporting your own post is the fastest way to get approval, since that emails us. PMing a mod is another option, but depends on the mod coming back in a timely manner. About the only reason it'll be rejected is being way too big, being adult content, or rule 6.

footageforpro
7th December 2014, 20:52
Hi guys. I use Freddy's script in 2 of my laptops and get incredible results with it. As the rendering time takes days and I have a big collection of 8 mm films I recently bought a third PC and run the script after installing AVIsynth and VirtualDubMod. If I try to open the interpolation script I get this error message: LoadPlugin: unable to load "plugins/removegrain.dll", error=0x7e
If I try to open, let's say, a simple video without using scripts that works perfectly.
In the last few days I've tried to search in this forum and in the whole internet, but I can't undestand what's wrong with my new PC. The main different I can find with the other 2 working computers of mine is that I run a 32 bit version of windows in the new one (Windows 7, while in the others I have Windows 7 64 bit and Windows 8 64 bit), Anyone can suggest what do I have to do? Thanks in advance, my friend.

Reel.Deel
7th December 2014, 20:56
If I try to open the interpolation script I get this error message: LoadPlugin: unable to load "plugins/removegrain.dll", error=0x7e

You're missing the runtime dependencies, what version of RemoveGrain are you using?

Edit: Read this post here (https://www.doom9.org/showpost.php?p=1700245&postcount=33).

johnmeyer
7th December 2014, 22:11
Hi guys. I use Freddy's script in 2 of my laptops and get incredible results with it. As the rendering time takes days and I have a big collection of 8 mm films I recently bought a third PC and run the script after installing AVIsynth and VirtualDubMod. You are welcome to try my version of VideoFred's script:

film restoration script, based on work by videoFred. (http://forum.doom9.org/showthread.php?p=1595607#post1595607)

It is 4-6 times faster, but only if you are able to use the MT version of AVISynth.

footageforpro
7th December 2014, 23:35
Thank you very much for your answers my friends. John: I'll have a look at your script as soon as possible. Reel.Deel: first forgive me but I'm not so good in using AVIsynth, so my answer can not be the right one. I'm using RemoveGrain dated 10th January 2006, if the date is the one of RemoveGrain DLL situated inside the plugins folder inside the script folder of Freddy's dezipped file.

johnmeyer
8th December 2014, 02:28
If you do use my script, you should read my post immediately above the one I linked to above. It provides information on what changes I made to both Fred's script and also to my earlier revision of his script:

http://forum.doom9.org/showthread.php?p=1595606#post1595606

footageforpro
8th December 2014, 09:48
Thank you John, I've tried to load your script and I get almost the same error as the one I had with Fred's, but this time with mvtools2.dll, so I finally think that all of this has something to do with the loading of plugins I have in the plugin subfolder of the script folder. Any suggestion?

StainlessS
8th December 2014, 17:59
Point this at the mvtools2.dll that you are using, it will tell you what it relies upon (supplied by MS in Visual Studio).
http://www.dependencywalker.com/

EDIT: Think may also be supplied on Windows CD/DVD in Support Tools (not sure, EDIT: Yes it is for XP/Server 2003).

footageforpro
9th December 2014, 10:56
Thank you very much StainlessS, with your suggestion I solved the issue with Loading plugin I had with Freddy script (not the one with JM's but I will handle it soon). Now I have another problem. I use to work with uncompressed FULL hd videos: with my other 2 computers everything works, importing and exporting. If I try to do that with my new PC I get this message while trying to open "Error decompressing video frame 0: The source image format is not acceptable. (error code -2)." It means that I have no preview of the video. When I try to export it I get this error "The decompression codec cannon decompress to an RGB format. This is very unusual. Check that nay "Force YUY2" options are not enabled in the codec's properties." The strange thing is that if I try to open that same AVI and export it without using the script but just using "File/Open video file" of VirtualDubMod everything works. Any suggestion?

StainlessS
9th December 2014, 15:09
By "uncompressed" I take it you mean RGB (24/32) and not eg uncompressed YV12.
Suggest post script and MediaInfo output.
Those symptoms might happen if eg YV12 and not mod 4 resolution.

VDub has its own (EDIT: built-in) decompression codecs which can quite often handle awkward sources.

footageforpro
9th December 2014, 19:39
Thank you very much Stainless. I see you're from London, please have a look at this 8 mm footage I restored: it's about your city in the 60's during Christmas time:
http://youtu.be/2gVMGTK6l4c

Talking about the script. This is my workflow: I scan frame by frame films with Moviestuff Retro 8 and finally have a jpg sequence. I transform that sequence in an AVI file uncompressed RGB, 16 of 18 fps, using VirtualDubMod without any software error. I finally have a 100 Gb file for a 200 ft reel. Then I open it using the script, for restoration and for interpolating 18 frames to 25. It's almost like the original Freddy's, exept the resolution and few other things. In my opinion it's about setting the right memory, because with my 2 other newer PC I don't get the same software crash.

Anyway here's my script:
# 8mm film restoration script by videoFred.
# www.super-8.be
# info@super-8.be

# version 01.A with frame interpolation
# release date: june 20, 2012
#============================================================================================

# august 2010: added removerdirtMC() as suggested by John Meyer
# october 2010: auto sharpening parameters

# march 2011: new autolevels.dll by Jim Battle
# www.thebattles.net/video/autolevels.html

# june 2012: improved stabilisation


#=============================================================================================

# cleaning, degraining, resizing, stabilizing, sharpening, auto-levels and auto-white balance.
#=============================================================================================


film= "F:\166-2.avi" # source clip, you must specify the full path here






#PARAMETERS
#----------------------------------------------------------------------------------------------------------------------------
result="result1" # specify the wanted output here

trim_begin=0 trim_end=0 play_speed=18 #trim frames and play speed (PAL: 16.6666 or 18.75)

numerator= 25 #numerator for the interpolator (final frame rate)
denumerator= 1 #denumerator example: 60000/1001= 59.94fps


#COLOR AND LEVELS PARAMATERS
#----------------------------------------------------------------------------------------------------------------------------
saturation=1.2 #for all outputs

gamma= 1.2 # for all outputs

blue= 0 red= 0 #manual color adjustment, when returning result3 or result4. Values can be positive or negative


black_level=0 white_level=255 output_black=0 output_white=255 # manual levels, when returning result4


#AUTO LEVELS PARAMETERS
#--------------------------------------------------------------------------------------------------------------------------------

autolev_low= 6 # limit of autolevels low output
autolev_high= 225 # limit of autolevels high output



#SIZE, CROP AND BORDERS PARAMETERS
#----------------------------------------------------------------------------------------------------------------------------
CLeft=32 CTop=32 CRight=32 CBottom=32 #crop values after Depan and before final resizing

W=1920 H=1080 #final size after cropping

bord_left=0 bord_top=0 bord_right=0 bord_bot=0 #720p= borders 150


#STABILISING PARAMETERS, YOU REALY MUST USE RESULTS7 TO CHECK STABILISATION!
#----------------------------------------------------------------------------------------------------------------------------
maxstabH=20
maxstabV=20 #maximum values for the stabiliser (in pixels) 20 is a good start value

est_left=40 est_top=40 est_right=40 est_bottom=40 #crop values for special Estimate clip

trust_value= 1.0 # scene change detection, higher= more sensitive
cutoff_value= 0.5 # no need to change this, but you can play with it and see what you get





#CLEANING PARAMETERS
#--------------------------------------------------------------------------------------------------------------

dirt_strenght=30 # set this lower for clean films.


#DENOISING PARAMETERS
#----------------------------------------------------------------------------------------------------------------------------


denoising_strenght= 300 #denoising level of second denoiser: MVDegrainMulti()
denoising_frames= 3 #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()




# SHARPENING PARAMETERS
#--------------------------------------------------------------------------------------------------------------------------------

USM_sharp_ness= 40 USM_radi_us=3 #this is the start value for the unsharpmask sharpening
#do not set radius less then 3
#the script will automatically add two other steps with lower radius



last_sharp= 0.1 #final sharpening step after interpolation

last_blur= 0.1 #this smooths out the heavy sharpening effects





# END VARIABLES, BEGIN SCRIPT
#=================================================================================================================================


SetMemoryMax(800) #set this to 1/3 of the available memory




LoadPlugin("plugins/Deflicker.dll")
Loadplugin("plugins/Depan.dll")
LoadPlugin("plugins/DepanEstimate.dll")
Loadplugin("plugins/removegrain.dll")
LoadPlugin("plugins/removedirt.dll")
LoadPlugin("plugins/MVTools.dll")
LoadPlugin("plugins/MVTools2.dll")
Loadplugin("plugins/warpsharp.dll")
LoadPlugin("plugins/autolevels_06.dll")
Import("plugins/03_RemoveDirtMC.avs")






source= AviSource(film).assumefps(play_speed).trim(trim_begin,0).converttoYV12()
trimming= framecount(source)-trim_end
source1= trim(source,0,trimming)






#STABILIZING/CROPPING
#...........................................................................................................................................

stab_reference= source1.crop(20,20,-20,-20).colorYUV(autogain=true).crop(est_left,est_top,-est_right,-est_bottom)

mdata=DePanEstimate(stab_reference,trust=trust_value,dxmax=maxstabH,dymax=maxstabV)
stab=DePanStabilize(source1,data=mdata,cutoff=cutoff_value,dxmax=maxstabH,dymax=maxstabV,method=0,mirror=15).deflicker()
stab2= stab.crop(CLeft,CTop,-CRight,-CBottom)
stab3=DePanStabilize(source1,data=mdata,cutoff=cutoff_value,dxmax=maxstabH,dymax=maxstabV,method=0,info=true)


WS= width(stab)
HS= height(stab)
stab4= stab3.addborders(10,10,10,10,$B1B1B1).Lanczos4Resize(WS,HS)
stab5= Lanczos4Resize(stab2,W,H).sharpen(0.5)


#UNSHARPMASK AUTO_PARAMETERS
#-------------------------------------------------------------------------------------------------------------------------------------------

USM_sharp_ness1 = USM_sharp_ness
USM_sharp_ness2 = USM_sharp_ness+(USM_sharp_ness/2)
USM_sharp_ness3 = USM_sharp_ness*2

USM_radi_us1 = USM_radi_us
USM_radi_us2 = USM_radi_us-1
USM_radi_us3 = USM_radi_us2-1


#CLEANING/PRESHARPENING/RESIZING
#..........................................................................................................................................


noise_baseclip= stab2.levels(0,gamma,255,0,255).tweak(sat=saturation)




cleaned= RemoveDirtMC(noise_baseclip,dirt_strenght).unsharpmask(USM_sharp_ness1,USM_radi_us1,0)\
.unsharpmask(USM_sharp_ness2,USM_radi_us2,0).Lanczos4Resize(W,H)



#DEGRAINING/SHARPENING
#...................................................................................................................................................................


vectors= cleaned.MVAnalyseMulti(refframes=denoising_frames, pel=2, blksize=block_size, blksizev= block_size_v, overlap=block_over, idx=1)
denoised= cleaned.MVDegrainMulti(vectors, thSAD=denoising_strenght, SadMode=1, idx=2).unsharpmask(USM_sharp_ness3,USM_radi_us3,0)






#CHANGING FRAME RATE WITH INTERPOLATION/FINALSHARPENING
#............................................................................................................................................................

super= denoised.MSuper()
backward_vec= MAnalyse(super, blksize=block_size, blksizev= block_size_v, overlap=block_over, isb=true)
forward_vec= MAnalyse(super,blksize=block_size, blksizev= block_size_v, overlap=block_over, isb= false)

interpolated= denoised.MFlowFps(super, backward_vec, forward_vec, num=numerator, den= denumerator, ml=100)\
.sharpen(last_sharp,mmx=false).sharpen(last_sharp,mmx=false).blur(last_blur,mmx=false)


#RESULT1: AUTOLEVELS,AUTOWHITE
#......................................................................................................................................................................
result1= interpolated.converttoRGB24().autolevels(output_low= autolev_low, output_high= autolev_high)\
.converttoYV12().coloryuv(autowhite=true).addborders(bord_left, bord_top, bord_right, bord_bot)

#RESULT2: MANUAL LEVELS, AUTOWHITE
#......................................................................................................................................................................
result2= interpolated.levels(black_level,1.0,white_level,0,255).coloryuv(autowhite=true)\
.addborders(bord_left, bord_top, bord_right, bord_bot)

#RESULT3: AUTOLEVELS, MANUAL COLOR CORRECTIONS
#.....................................................................................................................................................................
result3= interpolated.coloryuv(off_U=blue,off_V=red).converttoRGB24().autolevels(output_low= autolev_low, output_high= autolev_high)\
.converttoYV12().addborders(bord_left, bord_top, bord_right, bord_bot)

#RESULT4: MANUAL LEVELS, MANUAL COLOR CORRECTIONS
#.....................................................................................................................................................................
result4= interpolated.coloryuv(off_U=blue,off_V=red).levels(black_level,1.0,white_level,0,255)\
.addborders(bord_left, bord_top, bord_right, bord_bot)

#RESULT5: SPECIAL SERVICE CLIP FOR RESULT S5
#.....................................................................................................................................................................
result5= overlay(source1,greyscale(stab_reference),x=est_left,y=est_top).addborders(2,2,2,2,$FFFFFF).Lanczos4Resize(WS,HS)




#PARAMETERS FOR THE COMPARISONS
#.....................................................................................................................................................................
W2= W+bord_left+bord_right
H2= H+bord_top+bord_bot




final_framerate= numerator/denumerator
source4=Lanczos4Resize(source1,W2,H2).changeFPS(final_framerate)



#COMPARISONS: ORIGINAL VS RESULTS
#......................................................................................................................................................................
resultS1= stackhorizontal(subtitle(source4,"original",size=28,align=2),subtitle(result1,"result1: autolevels, autowhite",size=28,align=2))
resultS2= stackhorizontal(subtitle(source4,"original",size=28,align=2),subtitle(result2,"result2: autowhite, manual levels correction",size=28,align=2))
resultS3= stackhorizontal(subtitle(source4,"original",size=28,align=2),subtitle(result3,"result3: autolevels, manual color correction",size=28,align=2))
resultS4= stackhorizontal(subtitle(source4,"original",size=28,align=2),subtitle(result4,"result4: manual colors and levels correction",size=28,align=2))
resultS5= stackhorizontal(subtitle(result3,"result3: auto levels, manual color correction",size=28,align=2),subtitle(result4,"result4: manual colors and levels correction",size=28,align=2))
resultS6= stackhorizontal(subtitle(result1,"result1: autolevels, autowhite",size=28,align=2),subtitle(result2,"result2: manual levels, autowhite",size=28,align=2))

#SPECIAL COMPARISON CLIP FOR TESTING THE STABILIZER
#.........................................................................................................................................................................
resultS7= 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)).converttoYUY2()




Eval(result)#.converttoRGB24()


Where do you think I have to change the script?

StainlessS
9th December 2014, 20:44
I see you're from London

Good God no! :eek: [just live there]
I, is from that magical Kingdom Of Northumbria, unfortunately they moved it further north a few miles (Tyne & Wear just dont have that same magic).http://en.wikipedia.org/wiki/Kingdom_of_Northumbria
(well they moved Northumberland) http://en.wikipedia.org/wiki/Northumberland

I use neither Freds nor Johns scripts, so I shall leave suggestions for those that do, as you posted a sample they probably dont need MediaInfo output.

johnmeyer
9th December 2014, 21:11
I am not sure why you decided to use uncompressed. You sure don't need it in order to preserve fine details! :)

I would recommend using any decent codec that supports variable frame rates and compresses each frame individually, i.e., stay away from GOP codecs like AVC, MPEG-2 etc. Good codecs are Cineform (free from GoPro), DV (MainConcept sells one), MJPEG, or any of the free lossless codecs like HuffYUV or its newer cousin, Lagarith. Using a codec will not only save a huge amount of disk space, but should also make the playback during editing much smoother.

As for London, here is some much older footage that I transferred for a friend:

1930s London (http://www.youtube.com/watch?v=NR55kyQj098)

StainlessS
9th December 2014, 21:33
Nice clip John, also liked to catch a glimpse of the Hindenburg in your other NY clip [not in flames].

UT_Video is also a good codec.

johnmeyer
9th December 2014, 21:37
Nice clip John, also liked to catch a glimpse of the Hindenburg in you other NY clip.They are actually both from the same source: a German who owned a movie camera factory in Dresden, prior to the war. He knew how to use a camera, and took lots of movies until he had to flee the country in 1938 (for the usual reasons). He settled here in the USA, and many years later, also took these amazing nightime NYC movies:

1957 New York Times Square at Night (silent film) (https://www.youtube.com/watch?v=TIPnMB_KOsM)

StainlessS
9th December 2014, 21:55
HaHa great stuff, especially the Puffin' Bilko ad, cant even drag on an electronic ciggy here today in public (crazy PC-ness)

footageforpro
10th December 2014, 10:01
Well John, congratulation for the home movies you posted. I have a big collection, but it's difficult for me to buy so great footage because there are no garage sales here in Italy and also transport cost and taxes for Ebay american auctions are usually too much for my small budget.
Anyway, I use to work with uncompressed AVI files because after restoring footage with AVI synth I transform them with MPEG streamclip in Apple Prores to edit in Final Cut Pro. My idea is that is not fine to have to compress videos with 2 different codecs. I can work with Photojpeg or Mjpeg, they will save me a lot of time and space but I feel more confortable with uncompressed. Anyway, my workflow is fine with my 2 laptops (8 Gb and 6 Gb Ram), but it crashes with my Desktop with only 2 Gb Ram. Where do you think I can change settings of the script to make it work?

johnmeyer
10th December 2014, 17:03
In my version of the script, change SetMemoryMax(). In Fred's script, I don't know.

A lot depends on whether it crashes right away; whether it crashes after just a few frames, or whether it makes it most of the way and then crashes. Crashes that happen later usually indicate some sort of memory issue. Crashes that happen right away often indicate that a DLL conflicts with the version of AVISynth you are using.

I think you have already made sure that you are using only the plugins that came bundled with Fred's script. If your system has other versions of the plugins, you must make sure your script doesn't "grab" those instead. Loading the DLLs explicitly (drive and path) is the ultimate way to ensure that the proper plugins get loaded.

BTW, none of the film I posted is stock footage that I purchased. Instead, these are film transfers that I have done for friends and clients.

wdwms
8th April 2015, 18:08
Sorry to dig up an old thread, but I wanted to thank everyone for their efforts on these scripts. I've been lurking here for at least 1.5 years, queitly absorbing everything.

Now I'd like to show people what I have been doing and the results of everyone's input and efforts.

I've taken johnmeyers script, watered it down a bit, paired it with my own scripts, virtualdub plugins and then added in the full paid version of Neat Video. It is a two step process (three if you count the compression with handbrake), but the results are nothing but amazing.

All of the films I've restored are on YouTube and Vimeo:
https://vimeo.com/retrowdw/videos
https://www.youtube.com/c/retrodisneyworld

Our most popular films, and the best in terms of restoration are:
http://www.retrodisneyworld.com/imageworks/films/a-pristine-magic-kingdom-from-nov-71-restored-home-movie-footage
http://www.retrodisneyworld.com/imageworks/films/1972-wdw-home-movie-in-hd-final-restoration
http://www.retrodisneyworld.com/imageworks/films/a-gift-to-all-my-personal-1980-wdw-film-30-minutes

I've struggled a bit when the color is really bad. We haven't found a plugin for virtualdub or avisynth that can auto color correct well with scene changes. So if you have any ideas please let me know. A few of the restoration are less than perfect when it comes to color.

We also have blog setup on my website that discusses each film in detail that we restore:
http://www.retrodisneyworld.com/imageworks/films

I have nearly 15,000 feet of personal film to restore, but I've been buying disney world footage from ebay and restoring it as well. So i've been busy to say the least!

With that said, again thank you to all who have put in their time and efforts in participating in this thread, much appreciated!

Todd
www.retrodisneyworld.com

johnmeyer
8th April 2015, 19:44
... I wanted to thank everyone for their efforts on these scripts. I've been lurking here for at least 1.5 years, queitly absorbing everything ... I've struggled a bit when the color is really bad. We haven't found a plugin for virtualdub or avisynth that can auto color correct well with scene changes. So if you have any ideas please let me know. A few of the restoration are less than perfect when it comes to color.Your color restoration actually looks amazing. In my experience, there is no "auto white balance" plugin that works very well. This includes free plugins for VirtualDub, as well as high-end paid plugins for NLEs. The best path is to do the color correction scene-by-scene using your NLE's color balance tools. Hopefully it lets you balance the shadows, highlights, and midtones using separate settings.

What I'd like to know is exactly what did you do to get such great color correction results? I just tried to do a better job, using your "before" clip from Vimeo, and couldn't get close to the color quality that you achieved. I too do this for a living, so if you had to use some sort of commercial product, I'd be willing to buy it. Please share!

Finally, I want to commend you on your restoration sensibilities. You resisted the temptation to turn up the "knobs" on each restoration step, and as a result ended up with a very natural-looking result, even though it still has a little dirt, and a little motion. The only thing I would have done differently was to do a little more motion stabilization to get rid of the gate weave. It looks as though you decided to do very little motion stabilization, perhaps none at all.

John

P.S. This is my attempt to restore some "red and white" 8mm footage that someone purchased in 1962 at the Seattle Worlds Fair. Like most print movie film, everything except for the red dye layer was very unstable and had faded. This result was the best I could do, but nowhere near as good as the result you achieved:

1962 Seattle Worlds Fair (stock shots) (https://www.youtube.com/watch?v=Yjot8XeQ3Jg)

wdwms
8th April 2015, 20:26
john,
Thanks for the comments! Its been a lot of trial and error, let me type up a quick few comments here; if you want a more detailed dive into the process and scripts, please let me know.

For color correction I am using ColorMill for Virtualdub. Believe it or not, the color adjustments you see are 100% done by eye. I sit there and move the sliders inside ColorMill until I am satisfied. I generally apply a color correction that works for 90% of the film. I don't have the time to break each film into scenes and color correct each one. Generally most 3 minute reels were shot within the same day so exposure and such is generally balanced. Its the commercial films from Disney that are a disaster to work on, not only are the dyes crap, but each scene had different exposure and color saturation to begin with.

Thanks for realizing I didn't crank up the knobs. You have to be delicate with this, too much sharpness brings out artifacts and increases grain. There is a fine balance between all as I've learned.

For dirt, i'm using the RemoveDirtSSE2.dll avisynth plugin in conjunction with the RemoveDirtMC function. I usually set that between 60 and 80. Each film is different and some are so far gone.

Neat Video is the other secret weapon. It removes grain, and does a basic sharpen, but I purposely don't crank it up. Leaving some grain and nostalgic feel. Again, the final sharpen then has to be carefully done in order to not make the grain that is left look artifical.

Motion stabilization is on maxstabH=6 and maxstabV=8. I found that higher was actually causing artificial gate weave - my films are scanned on some crazy $100k machine and there is 0 gate weave when I get the uncompressed files from Pixcel.com Higher stab #s were also causing very odd artifacts and motion issues especially on horizontal pans. I probably could crop a bit more, I'm possibly too much of a fan of seeing everything and need to get over that and crop another 10 pixels all around.

The end result that I'm going for is not one that turns film into video, i still want a bit of older fee, some grain, but it to be nostalgic, colorful and clear. if that makes sense. I had a hard time debating leaving them at 18fps or moving to 24 or 29.97fps. In the end, they looked best at 29.97 for the medium we now view these on as much as pained me to nearly double the frame rate and make fake frames. :)

I can try to see what i can do to your seattle clip, however what is on youtube has lost much of its color information. Do you have the original scan perhaps? I can see what I can do with it. Seems to be in much better shape than this one that I restored:

http://www.retrodisneyworld.com/images/imageworks/compared.jpg

Red doesn't have to be dead! :)

Todd

papcom
1st June 2015, 13:51
...I had a hard time debating leaving them at 18fps or moving to 24 or 29.97fps. In the end, they looked best at 29.97 for the medium we now view these on as much as pained me to nearly double the frame rate and make fake frames. :)Todd
@todd - nice work You do. Congratulation.
I do not really understand what You did with the 18fps and what You mean with the "double Frame rate" and the "fake Frames". I am searching for an effective method to bring my 18 films into a good and fluent Motion flow .

johnmeyer
1st June 2015, 16:54
I do not really understand what You did with the 18fps and what You mean with the "double Frame rate" and the "fake Frames". I am searching for an effective method to bring my 18 films into a good and fluent Motion flow .You have four choices:

1. Encode at 18 fps and play back on a device that accepts that frame rate. Your computer can play back any frame rate, and most modern TV sets can also play back at any frame rate if you play from a memory stick inserted into the TV's USB port.

2. Add pulldown frames to play at the standard 29.97 (NTSC) or 25 (PAL) frame rate. This is the traditional way of doing it and has the advantage that you introduce zero spatial artifacts. Each frame will be just as clear and sharp as the original. The downside is that the natural judder of the low 18 fps frame rate will be accentuated, and horizontal camera panning will look quite jumpy.

3. Synthesize additional, new frames in order to bring the frame rate to 25, 29.97, 50, or 59.94 fps. This will provide very fluid, smooth motion, but you almost always create significant spatial artifacts on some scenes. Also, the result will no longer "feel" like film, but instead will feel like video. People have strong opinions and preferences both ways, and in the end the "feel" part of the decision to synthesize these frames is an artistic one. Be warned however, that when this technology fails, it often fails spectacularly, with people's legs "breaking" as they walk quickly across the frame, and picket fences warping and breaking as the camera pans horizontally across the fence.

4. Blend adjacent frames in order to create the additional frames needed to play more frames per second. This creates no surprise artifacts, and does create smoother motion. However, because the new frames are simply blends of adjacent frames, you can get very fuzzy results on fast motion.

I always use #1 when I can. It is the easiest and produces no new artifacts.

When I encode for DVD or any other situation where the playback has to be at one of the traditional TV standard frame rates, I use #2. Why? It just plain works. Yes, it results in judder, but judder has always been an issue with film, and if you use a little motion stabilization, that technology also smooths the panning so that the judder isn't quite as noticeable.

Once in awhile, when I have a lot of panning, I will create two versions, one with pulldown fields (#2) and the other with motion estimation (#3) and I switch between them, using the motion estimation for horizontal panning, and the pulldown fields elsewhere.

I have occasionally used #3 (motion estimation) for entire clips when the frame rate of the original was really low, and the amount of horizontal panning was unusually high. Here is an example of a 1930 15 fps original clip. I increased the frame rate to 30 fps, which means that half of the frames are exactly the same as the original. You'd need to see the original to be able to appreciate the huge difference, but when I originally uploaded this clip to YouTube at 15 fps, it was almost unwatchable.

1930s San Francisco (https://www.youtube.com/watch?v=2moHDbxUodk)

Skip ahead to the 1:05 mark to see the most interesting scenes.

The parts of the clip where the camera pans wildly across the streetcars at the intersection of Embarcadero and Market was particularly hard to follow at the native 15 fps.

The difference between 15 fps and 18 fps is actually quite large, and I seldom feel like I need to do motion estimation when doing 18 or 24 fps film transfers.

I should also point out that because of all the dirt on film, if you can't get each frame perfectly clean, any technique which synthesizes additional frames, rather than simply repeating fields or frames, will produce really nasty surprises.

papcom
1st June 2015, 18:28
@johnmeyer - thank you for the listing of all possibilities.
Usually I use method 2, because it preserves the quality of the original Picture. Unfortunately Scenes with movements in the film are displayed rather juddery.(as You write)

I experimented with lots of other methods, e.g. with After Effects, or Dynapel, or Optical Flow on macs. Some results are almost perfect others are not satisfying. The reason You explained very well in Your post.

A good method is the small script You posted some time ago, as:
AssumeFPS(16.0)
ChangeFPS(50,1)
AssumeTFF() # or BFF, as required
SeparateFields()
SelectEvery(4, 0, 3)
Weave()

This method works fine for interlaced material for a DVD.

Now I saw the post of @wdwms, and I took a look to his sample Videoclip, which has a fairly good fluent movement. So I am interested to know how he did this.

johnmeyer
1st June 2015, 18:56
He describes his process, in detail, on this page:

Restoration Process (http://www.retrodisneyworld.com/imageworks/restoration-process)

He is a little vague on which of the options I listed he is actually using. Here is what he says on that page:

The computer software uses interpolation, that is it actually creates those 6 frames by comparing the 18 it already knows about. Confused? Don't be, it works and the end result is great!

Since he is using much of the code developed by VideoFred, and later modified by me, and since VideoFred's code uses motion interpolation, my educated guess is that he is using MVFLowFPS or MFlowFPS to interpolate new intermediate frames. As I already mentioned, this works great for large objects and for camera panning, but can break down rather badly not only with the situations I already mentioned, but even more so when something enters or leaves the frame close to the camera.

I've used Twixtor, Dynapel (MotionPerfect), and MVTools2, and have also seen the results from AE. They all suffer from the same problems, to one degree or another. One advantage of MVTools2 is that you can modify a lot of internal options that, under some circumstances, can make quite a dramatic difference. In most circumstances, I have found that using a large block size reduces artifacts. I have published some of my settings in various thread elsewhere in this forum. There is no "one size fits all" script, and you have to tune your settings for each film or video.

wdwms
2nd June 2015, 13:11
I'm actually using Interframe to do all my 18->24 or 18-> 29.97 conversion. Very little of Fred or Johns' code is left, in fact I think just the dirt removal and stabilization are the only components. The rest is all through my own scripts, majority of it being in virtualdub plugins.

Interframe is here: http://www.spirton.com/interframe/

All my FPS upconversion is done after the initial cleaning. Here is how my restoration works:

Pass #1
Stabilize (avisynth), dirt removal (avisynth), color adjustment (ColorMill in VD), grain removal (NeatVideo in VD), minor sharpening (VD) - Save as full frame AVI
Pass #2
Interframe to 30pfs (avisynth), Crop, resize, final sharpen - Save as Lossless AVI via Lagarith codec - Archived as "restored"
Pass #3
Handbrake with custom settings to compress for distribution. Uses H.264 and outputs as Mp4 - Archived as "distribution file" to share with friends/family


I plan on changing it to this soon:


Pass #1
Stabilize (avisynth), dirt removal (avisynth), color adjustment (ColorMill in VD), grain removal (NeatVideo in VD), minor sharpening (VD), Crop/resize/final sharpen (VD), Save as full frame AVI, uncompressed as "RESTORED"
Pass #2
Interframe to 30pfs (avisynth), Save as Lossless AVI via Lagarith codec - Archived as Restored/Upconverted
Pass #3
Handbrake with custom settings to compress for distribution. Uses H.264 and outputs as Mp4 - Archived as "distribution file" to share with friends/family

johnmeyer
2nd June 2015, 16:34
Just to be clear, so Papcom is not confused, Interframe is, at its core, the same thing as MVTools2.

MVTools was updated by its author to MVTools2. That code was then re-written by someone else to run on certain GPUs, thus allowing real-time interpolation. Finally, someone wrote a front end to SVP called Interframe which shields the user from the slightly convoluted SVP syntax. Read about it here:

InterFrame (http://forum.doom9.org/showthread.php?t=160226)

The reason I post this is to point out that the results from Interframe will be nearly identical (perhaps exactly identical ??) to what you get with MVTools2, if you set the MVTools2 settings to be the same.

The reason I don't use either SVP or Interframe (although I do include the commented out code in my version of Fred's scripts) is that I found that the Interframe front end made it difficult for me to adjust several parameters which I found made a huge improvement when interpolating low frame rate film transfers. Remember that the main point for the existence of the SVP and Interframe extensions was to improve the speed of motion interpolation for real time interpolation while watching normal TV. I put that in italics to emphasize the point that the settings have been tuned for fairly high frame rate material, and you therefore may not get good results with material that contains large temporal gaps between adjacent frames.

As I noted in my previous posts, I find wdwms' results to be really excellent, especially his custom color corrections. However, the motion estimation is neither better, nor worse, than what I've seen elsewhere. It contains all of the usual advantages as well as the usual artifacts.

So, my recommendation is to use MVTools2 and modify the MAnalyze and MFlowFPS settings to reduce the inevitable interpolation artifacts.

FWIW, here is the commented out code in my scripts, showing all three versions: MVTools2/MFlowFPS; SVP; and Interframe.


#FRAME INTERPOLATION (optional)
#...................................................................................................................................................................

#superfps= MSuper(PreBorderFrame,pel=2)
#backward_vec2 = MAnalyse(superfps, isb = true,blksize=16)
#forward_vec2 = MAnalyse(superfps, isb = false,blksize=16)
#PreBorderFrame = MFlowFps(PreBorderFrame,superfps, backward_vec2, forward_vec2, num=60000, den=1001, ml=200).SeparateFields().SelectEvery(4, 0, 3).Weave()

#...................................................................................................................................................................
#The following alternative can provide synthesized frames for hi-def material that causes MSuper to choke
#////// Begin alternative to MFlowFPS ////
#super_params="{pel:2,gpu:1}"
#analyse_params="""{block:{w:32,h:32},
# main:{search:{coarse:{distance:-10}}},
# refine:[{thsad:200}]
# }"""

#smoothfps_params="{rate:{num:60,den:16,abs:false},scene:{mode:0,limits:{scene:8500}},algo:21,cubic:1}"

#...................................................................................................................................................................
#The following provides smooth output
#super = SVSuper(PreBorderFrame,super_params)
#vectors = SVAnalyse(super, analyse_params)
#PreBorderFrame = SVSmoothFps(PreBorderFrame,super, vectors, smoothfps_params, url="www.svp-team.com", mt=threads).SeparateFields().SelectEvery(4, 0, 3).Weave().assumefps(29.97)
#////// End alternative to MFlowFPS ////

#...................................................................................................................................................................
#The following is another alternative that can provide synthesized frames for hi-def material that causes MSuper to choke. Probably better than the one above.
#////// Begin alternative to MFlowFPS ////
#PreBorderFrame=InterFrame(NewNum=30000,NewDen=1001,PreBorderFrame,GPU=true,Cores=threads)
#////// End alternative to MFlowFPS ////

wdwms
2nd June 2015, 16:43
Thanks John, i'll give your code a whirl in my next project to see how it goes

wdwms
4th November 2015, 03:58
Just wanted to share with you all some more comparisons, this is not final but wanted to show you what i'm doing with some 16mm I just got digitally transferred and I'm almost done with the restoration... This time around I think i've been able to restore the color even better than the last film I did..

I'll make a full length comparison film so you can see the side by side..
-t

http://www.retrodisneyworld.com/images/tease/comparenew1.jpg
http://www.retrodisneyworld.com/images/tease/comparenew2.jpg
http://www.retrodisneyworld.com/images/tease/comparenew3.jpg
http://www.retrodisneyworld.com/images/tease/comparenew4.jpg
http://www.retrodisneyworld.com/images/tease/comparenew5.jpg
http://www.retrodisneyworld.com/images/tease/comparenew6.jpg

videoFred
5th November 2015, 14:04
Your Colormill color correction is incredible! I will have a closer look at this filter myself.

Fred.

johnmeyer
5th November 2015, 16:48
As I've said in countless posts in both this thread and elsewhere, automatic white balance is a noble goal, but one that remains elusive. I have yet to see anything that doesn't fail (make the video worse) as often as it succeeds.

When he posted the last time, and said he got his amazing results using just the Colormill plugin, I was amazed by his results, so I downloaded and used Colormill. Here's what I found: there is nothing unusual or different about it, and in fact it does the same thing that I do inside of Vegas with the color corrector included in that NLE.

So, why is he able to get such stunning results? I think there are three reason these results look so good:

1. The Colormill plugin provides the necessary controls, although nothing more than standard color channel sliders.

2. The samples chosen still have enough residual color in the two faded channels that the color can be recovered. This is extremely important. I've dealt with a LOT of red&white, blue&white, and yellow&white film to know that sometimes there simply isn't any color left in the other channels.

3. The guy doing this has a great eye, and understands what he's doing.

#3 is the key. People who do "color timing" for movies are skilled artisans, and the quality of their work could not be duplicated by me, or most other people, even if we had access to the same tools.

This guy is good!! Hire him for your next film project.

wdwms
6th November 2015, 01:21
John,
Thanks for #3, humbled by your comments. Maybe my monitor and eye are configured to work in harmony, or I may have gotten lucky w/the films I'm restoring that they have just the right amount of color left. I love doing this and bringing films back to life!

I will say that I've tried other color plugins, none gave me the adjustments I needed to get the color just right. Also I've been doing the color restoration in 2 steps. In the final I had to adjust the hue a bit after the initial correction.

I work in the red gamma first, bringing that down, then I adjust the dark-mid-light for each channel. Final tweaks are the contrast and brightness and such, as well as saturation.

Now if i could just do something about those scratches! (aside from frame by frame restoration).

Would you guys like to see a full side by side comparison of the 30 minute film?

-t

StainlessS
6th November 2015, 01:39
Now if i could just do something about those scratches! (aside from frame by frame restoration).

Perhaps this could assist if using Descratch, AreaOp() limit affect to an area of frame.
http://forum.doom9.org/showthread.php?p=1603343#post1603343

wdwms
6th November 2015, 03:04
Perhaps this could assist if using Descratch, AreaOp() limit affect to an area of frame.
http://forum.doom9.org/showthread.php?p=1603343#post1603343

I tried descratch and it was a mess, the scratches are so bad that it really isn't salvageable.. :(

johnmeyer
6th November 2015, 03:13
I'm always interested in before/after footage, although I wouldn't be able to watch all 30 minutes.

As for scratches, go ahead and try StainlessS' suggestion, but don't expect much. The problem with scratches is that, unlike dirt, they persists from frame to frame, so you can't use the tricks used by RemoveDirtMC which looks at adjacent frames to determine what to remove, and then fills in the removed mark with material from those frames (at least that is how I think it works).

If scratches were in precisely the same place from frame-to-frame, like a TV logo, then they could be removed using masking technology, like Delogo. However, as you well know, they tend to wander around, left to right, and also change length from one frame to the next. The only thing you can count on, because of how they are created, is that they are almost perfectly vertical.

The only solution I know of that works is to do a wet gate transfer. This involves coating the film with a slow drying solution that physically fills in the scratches. You can Google "wet gate transfer" and see how amazingly effective this technique is. You will probably find several posts by VideoFred because he uses wet gate transfer for his amazing film transfers.

wdwms
6th November 2015, 03:15
At this point we are going to leave the restoration as it is. Maybe someday I'll find a better print. But as it was, the cost was pretty high to get this xferred, and we did it via a crowdfunding effort by our followers...

johnmeyer
6th November 2015, 03:45
P.S. Here is a link to a before/after showing the significant improvement from a wet gate transfer:

Wet Gate Transfer (https://www.youtube.com/watch?v=xNu0LpoKLVM)

Even if you don't want to re-transfer for this project, you should know about this for the future.

greg
14th December 2015, 18:28
Hi,

I just got my reels (2 hours) of regular 8 film (recorded in the 70s with a Yashica UL Power Zoom camera) professionally transferred with the MWA Flashscan HD telecine. I'd like to clean them with Fred's script or JohnMeyer's one but I have three main problems:


-The video files I have are ProRes 422 .mov, uncompressed. I tried QTReader plugin and I opened the avs. file with VirtualDubMod, but I see the frame upside down and if I press play I get the error "Couldn't initialize timer!"

-The original filming speed was 16 fps, but now the .mov file is 25 fps progressive. I can see there are duplicate frames and I know I have to delete them with Avisynth but I can't understand which plugin I have to use (Decimate? Decomb?) and I don't know the parameters

-The video files I have are HD 16:9 so there are black pillarboxes on the sides. How can I crop them with Avisynth? Do I have to use ''AutoCrop''?


I uploaded on Dropbox some samples if you want to see them (uncompressed, same format I have on my PC).

Here's the link to the folder: https://www.dropbox.com/sh/vbe5vggru0rp20o/AAD-T5mkQFGjREsSlKi6BXgha?dl=0

If someone can help me, I'd really appreciate it.

Thanks in advance

manono
14th December 2015, 20:51
Hello and welcome to the forum,

I used FFVideoSource (part of FFmpegSource (http://avisynth.nl/index.php/FFmpegSource)) to open the first sample in Virtual Dub and had no problem.

I used TDecimate (part of the TIVTC (http://avisynth.nl/index.php/TIVTC) filter) to remove the duplicate frames and return it to 16fps:

TDecimate(Cycle=25,CycleR=9)

I suppose you could use Autocrop, but I do such things like this:

Crop(240,0,-240,0)

That crops to 1440x1080 (1.33:1) but doesn't remove all the black. You can play around with it yourself. It's all explained in the Crop (http://avisynth.nl/index.php/Crop) page on the AviSynth site.

johnmeyer
14th December 2015, 22:50
[edit]My TDecimate logic (below) is wrong. Manono's (directly above) is correct.[/end edit]

I used ffmpeg to convert to uncompressed, and then imported that. You can also use ffmpeg to convert to lossless or other formats that consume less disc space. This is an example of how to convert to uncompressed:

ffmpeg -i "8mm sample_01.mov" -an -vcodec rawvideo -pix_fmt yuv420p -y output.avi

I looked at your film, and every other frame is a repeat. Thus, the pulldown that was added was NOT trying to go from 16 fps to 25 fps, but simply to get the file to play back at 25 fps. Therefore, the TFM/TDecimate parameters given in that previous post actually are not what you want to use. Instead, use this:

TDecimate(Cycle=3,CycleR=1)
AssumeFPS(16)

This will recover the original frames, so you have a frame accurate result, and then the AssumeFPS will cause those frames to be played back at 16 fps, the common speed for 8mm and silent 16mm film.

You can then add a crop, as needed:

Crop(250,0,-260,0)

This seemed to be about right for your first example (the only one I downloaded).

manono
15th December 2015, 00:49
I looked at your film, and every other frame is a repeat.
Maybe you meant to say every third frame is a repeat? Either you're not decoding it correctly, or I'm not (always possible), or you're not counting enough cycles to be sure what it is. greg said it was converted from 16->25fps with the addition of duplicate frames which is what I see. You seem to be saying one of three frames is a duplicate. I'm seeing sometimes one of four frames being a duplicate. Every eighth cycle comprises four frames and not three. You're seeing 16.67fps and I'm seeing 16fps. Here's what I get with the script I suggested:

https://mega.nz/#!ThQCGLZR!yi1UrDGj0KyPcEQWtSeBNMb90qgrQfkPsS0z3o6ErWI

johnmeyer
15th December 2015, 04:00
I went back and looked at "8mm sample_01.mov" again, and I clearly didn't "walk" far enough through the clip to see the more complex pattern. I looked at fields (just in case in was telecined for interlaced viewing) and got this field pattern:

4-2-4-2-4-2-4-2-2

Translating to frames:

2-1-2-1-2-1-2-1-1

So in each group of thirteen frames, each of the "2's" must be decimated. There are 13 frames total (Cycle) and 4 that must be decimated (CycleR).

TDecimate(Cycle=13,CycleR=4)

However, after my previous error, I wanted to test this code, so I walked through the entire clip, using the above decimation.

Darn, I still found several repeats.

I am an idiot.

So the OP should definitely follow Manono's advice because I haven't had the time to walk the entire clip and pick up on what is a more complex pattern than I initially expected.

His code will exactly translate a 25 fps clip back to 16 fps, and some of you may wonder why I didn't just go with that to begin with. After all, the math is trivial (25 - 9 = 16). The reason is that I've done enough film transfers to know that the playback speed set for the frame accurate transfer (16 fps in this case) and for the playback (25 fps) don't necessarily have to reflect the speed of the original film, and the telecine sometimes first gets done, and then the playback speed adjusted, or the speed is first adjusted to something other than 16 fps, and then the telecine is done. So, sometimes these "oddball" telecines don't go according to the math.

This one did.

I'll edit my original post so no one gets misled.

manono
18th December 2015, 08:02
I came back to have a look and something didn't seem right and I began counting again and realized I had been wrong, too. There's a large cycle of 25 frames before everything repeats again, and within the grand cycle are eight 'mini-cycles', like so:

3 3 3 3 3 3 3 4

Each number represents the number of unique frames plus a duplicate. The '3's represent 122 (unique, unique, dupe), and the '4' 1233 (unique, unique, unique, dupe). It's a different counting convention than yours, johnmeyer, so I'm not sure it makes sense to you. All those 3s and 4s total up the the 'grand cycle' of 25 frames and there are 8 'mini-cycles' which also tells you that within the 25 frame cycles there are 8 duplicate frames. The correct TDecimate line should be:

TDecimate(Cycle=25,CycleR=8)

That makes 17fps and greg can use an AssumeFPS line to slow it to 16fps as you showed earlier, if he wishes. I'm an idiot, too. :)

greg
19th December 2015, 11:56
Thanks for helping me!

EDIT: Problem below solved
--------------------------------------------------------------------------------------------------------------------------------
I seem to have problems with the basics: I tried using FFmpeg source, but once opened the .avs file with the command

LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\ffms2.dll")
FFVideoSource("D:\8mm sample_1.mov")

with VirtualDubMod, I get the error
Avisynth open failure. Evaluate: System exception - Acces Violation (C:\Users\Giacomo\Desktop\test.avs, line 2)

To install the FFmpeg source plugin I downloaded the file ''ffms2-2.22-msvc.7z'' from here https://github.com/FFMS/ffms2/releases (I got the link through this page http://avisynth.nl/index.php/FFmpegSource), then I just unzipped it and copied the files in the folder "x86" (there's a .dll) into Avisynth plugins folder.

Is that the right way to install the plugin?
--------------------------------------------------------------------------------------------------------------------------------


The other question is: how do I know that the telecine duplication cycle pattern always starts at the same point in every .mov file?
I mean, maybe in a .mov file the video starts when the cycle pattern is already halfway through, in that particular case the command
TDecimate(Cycle=25,CycleR=8)
will not work?

Thanks again

Groucho2004
19th December 2015, 12:17
with VirtualDubMod, I get the error

To install the FFmpeg source plugin I downloaded the file ''ffms2-2.22-msvc.7z'' from here https://github.com/FFMS/ffms2/releases (I got the link through this page http://avisynth.nl/index.php/FFmpegSource), then I just unzipped it and copied the files in the folder "x86" (there's a .dll) into Avisynth plugins folder.

Is that the right way to install the plugin?
That version (2.22) crashes for me as well with various files. Try the previous one (2.21).
Also, either put the plugin into the auto-load directory or use an explicit "loadplugin()", not both.

Edit: 2.22 doesn't crash if I use "threads = 1" in the ffvideosource() call.