View Full Version : The power of Avisynth: restoring old 8mm films.
Okay - while "LOTS of money" is made behind the scenes via PM:p;), I'll continue publicly ...
Oh, that probably means you didn't use SRestore like it should in this case here. Above all, to use SRestore you don't start with TFM a/o TDecimate, but with a simple bob filter.
The following script:
mpeg2source("sample_(fpp).d2v")
o=last
o.bob(-.2,.6)
SRestore(frate=20.0)
requestlinear()
rest=last
calm = rest.temporalsoften(1,255,255,32,2).merge(rest,0.25)#.repair(rest,1).removegrain(11)
calm = calm.temporalsoften(1,255,255,16,2).merge(calm,0.25)
LOP = calm.bicubicresize(180,144).bicubicresize(720,576,1,0)
HIP = rest.bicubicresize(180,144).bicubicresize(720,576,1,0)
HIP = mt_makediff(rest,HIP)
mix = LOP.mt_adddiff(HIP,U=2,V=2)
sup1=rest.msuper(levels=1)
sup2=mix.removegrain(11).msuper()
bv2=sup2.manalyse(isb=true, delta=2,blksize=16,overlap=8,DCT=5)
bv1=sup2.manalyse(isb=true, delta=1,blksize=16,overlap=8,DCT=5)
fv1=sup2.manalyse(isb=false,delta=1,blksize=16,overlap=8,DCT=5)
fv2=sup2.manalyse(isb=false,delta=2,blksize=16,overlap=8,DCT=5)
rest.mdegrain2(sup1,bv1,fv1,bv2,fv2,thSAD=640)
produced the following result: <KLICK> (http://www.mediafire.com/?7hm4cn80y2k82ra) (MediaFire, ~10MB)
Script made up in five minutes (between mowing the lawn and watering the hedgerow). Surely not perfect, but seems like a good start.
BTW, I didn't use DCT=1 because I didn't have the time for that (DCT=1 is very slow with blocksize=8, and pretty much unusably-slow with other blocksizes). Hence, I did a manual flicker-removal for MVTools' search clip. Runs much faster.
Which part of the script is the manual flicker-removal? Is it the lines I've marked in red? I'd like to try it in a different situation where I've needed to use DCT=1 to get satisfactory results.
Hi all, everyone asleep ? :-)
Here is a question for recent contributors (John, Dirée, Gavino...) and especially for Fred (this is "his" topic after all :-)...
You have all been wonderfully helpful and patient with my barging into this topic in total ignorance, and helping me out with a problem that is related to Fred's original subject , but quite different in practice.
Now I would like to give back to this great community, and sum up all I've had explained to me or found using those clues, into something like a (hopefully) comprehensive "Howto"... just in case another newbie comes along some day, with exactly the same goal that I had : salvaging a botched transfer with only a DVD to work from :-)
The question is simply this : do I write this up right here, which would mean keeping everything "8mm related" in one place, but also more highjacking of Fred's topic, taking it further from its real intent ? Or would it be better to create a separate topic, linking back to this one in the introduction ?
I subscribed to Doom9 specifically to participate in this one topic, so I don't know how these things are done here -- or even *if* there is an agreed-upon way to do them :-)
Thanks for your opinions,
fp
Edit : PS - something fun and on-topic that came through my RSS feeds :
http://www.peaceman.de/blog/index.php/lego-technic-super-8-movie-projector
:-)
videoFred
17th May 2011, 16:00
The question is simply this : do I write this up right here, which would mean keeping everything "8mm related" in one place
I suggest to start a new thread because this one becomes pretty heavy. Then I will place a link in the first post of this thread. You can do the same in your thread. This way, people with 8mm transfers on VHS will not have to search this entire thread. And people with frame-to frame transfers will find their way to my thread. :)
Fred.
Sounds good, will do !
Thanks,
Fred
amendegw
28th May 2011, 17:57
All,
I'm a real newbie with AviSynth, so this might be a stupid question (on the other hand, that might make the answer easy).
In another forum, Johnmeyer referred me to the following script (authored by Didee, I believe). I made minor mods to fit my directory structure.
Loadplugin("C:\Program Files (x86)\AviSynth 2.5\plugins\MVTools\mvtools2.dll")
import("c:\Program Files (x86)\AviSynth 2.5\plugins\srestore.avs")
avisource("C:\Users\Jerry\Documents\Vegas Projects\Testing\WhiteSands\WhiteSands.avi").ConvertToYV12(interlaced=true)
o=last
o.bob(-.2,.6)
SRestore(frate=17.36)
requestlinear()
rest=last
calm = rest.temporalsoften(1,255,255,32,2).merge(rest,0.25)#.repair(rest,1).removegrain(11)
calm = calm.temporalsoften(1,255,255,16,2).merge(calm,0.25)
LOP = calm.bicubicresize(180,144).bicubicresize(720,480,1,0)
HIP = rest.bicubicresize(180,144).bicubicresize(720,480,1,0)
HIP = mt_makediff(rest,HIP)
mix = LOP.mt_adddiff(HIP,U=2,V=2)
sup1=rest.msuper(levels=1)
sup2=mix.removegrain(11).msuper()
bv2=sup2.manalyse(isb=true, delta=2,blksize=16,overlap=8,DCT=5)
bv1=sup2.manalyse(isb=true, delta=1,blksize=16,overlap=8,DCT=5)
fv1=sup2.manalyse(isb=false,delta=1,blksize=16,overlap=8,DCT=5)
fv2=sup2.manalyse(isb=false,delta=2,blksize=16,overlap=8,DCT=5)
rest.mdegrain2(sup1,bv1,fv1,bv2,fv2,thSAD=640)
Since I'm starting from nearly ground zero with AviSynth, I've found that I've had to install numerous additional plugins & windows\system32 dll's to get the script to execute.
Now, I'm stuck now with the following error:
http://dl.dropbox.com/u/20447760/AviSynth-FFTW3-Error.png
I've found, downloaded & placed fftw3.dll in my windows/system32 folder, but there still seems to be a problem.
Here's my AviSynth plugin folder:
http://dl.dropbox.com/u/20447760/AviSynth-Plugins.png
I've spent about a hour with Google to no avail. Can anyone here help me out?
...Jerry
Didée
28th May 2011, 18:14
If you're on a 64-bit version of Win-7 (or Vista), you have to put fftw3.dll in the "windows/SysWow64" folder.
And you should *not* have *both* versions of mt_masktools in your Avisynth folder. Only the ..-25.dll if you're using Avisynth 2.5.x, or only ..-26.dll if you're using Avisynth 2.6.
amendegw
28th May 2011, 18:43
If you're on a 64-bit version of Win-7 (or Vista), you have to put fftw3.dll in the "windows/SysWow64" folder.
And you should *not* have *both* versions of mt_masktools in your Avisynth folder. Only the ..-25.dll if you're using Avisynth 2.5.x, or only ..-26.dll if you're using Avisynth 2.6.
Wunderbar! That fixed it. I'm now down to the last line of the script and get "Script error: there is no function named "mdegrain2" C:\Users\Jerry\Documents\Vegas
Projects\Testing\WhiteSands\deflicker.avs, line 29﴿"
...Jerry
Didée
28th May 2011, 19:06
That's strange. Mdegrain2 is part of MVTools2.dll, and your script is correctly importing that dll. Are you using a recent version of the dll, from avisynth.org.ru (http://avisynth.org.ru/mvtools/mvtools2.html)?
Uh, that server doesn't answer right now. What's the file date of your mvtools2.dll?
Edit: Here's a mirror of Fizick's latest MVTools2: v2.5.11.2 (http://www.mediafire.com/?35o8i667h62xdnt) - (unalterd original ZIP package)
amendegw
28th May 2011, 19:44
Yeah, when I couldn't connect to avisynth.org.ru I got downloaded mvtools2 elsewhere. Unfortunately, in the throws of gathering all the plugins I needed, I forget the source site. Here's some screen prints that might help:
http://dl.dropbox.com/u/20447760/mvtools2-details.png
http://dl.dropbox.com/u/20447760/mvtools2-details2.png
If the solution isn't immediately apparent, I'll wait 'til avisynth.org.ru gets back online and download from there.
Thanks so much for your help. Once I get your script working, I'll report back with the results.
...Jerry
Hi folks,
I am *really* pleased -- and relieved -- to announce that I have just finished burning the first DVD of my "salvaging the botched transfer of Dad's Super 8 reels" project :-)
It has been just a bit over three weeks since my initial plea for help in this forum (5/5), which is a good deal less than I feared !
Actually, the relevant part (getting the AVIsynth script right, and re-encoding the source) was over on May 19th : the authoring took me a lot longer than I expected, because my previous experience was mostly with DV tape source, and did not serve me well with this new material. I had to find and learn new tools, like for encoding sound from external sources.
But all's well that ends well, and this is of course 100% thanks to the knowledgeable (and patient !) people in this thread, who put up with my silly questions and kept me busy with hints, code, explanations and support for all that time.
To John, Didée, Fred, Gavino & all the others, again, a thousand thanks !
Now that I've met this milestone, and have at least the first disk in stock for my father's birthday, I'm going to take a little break, hoping the second one will go much smoother... and meanwhile, work on keeping my promise : documenting the entire adventure in a specific thread, before it all slips out of my mind :-)
Here's to AVIsynth, Doom9 and its resident wizards,
Fred
In preparation for the new topic I needed some "before/after" video examples. To avoid readers having to download them I put them online on Vimeo, so you can look at them in the meantime :
http://vimeo.com/24361245 is the original clip from the DVD. It's the same scene I posted in my first message, only about 50% longer.
http://vimeo.com/24361560 is the result of my bespoke Avisynth script, that went on the new DVD I made for my father.
http://vimeo.com/24690815 is a side-by-side, before/after comparison -- added as suggested by John in the post below.
The clip on the left side is not *exactly* the same as the original above (in fact it is a bit better), but it still gets the message across :-)
johnmeyer
28th May 2011, 23:22
Great before/after comparison. If your editing software permits it, it is sometimes useful to do a split screen, either like VideoFred did in the Vimeo post in the first post in this thread, or else by showing the scene only once, but with the left side showing the "before" and the right side showing "after." This makes it much easier to get across the amazing difference between the original and the improved versions.
I look forward to reading which things you ended up doing. It looks like you did the excellent Didée flicker reduction, but may also have done a little color correction as well.
I am not at my main computer right now, and that computer has a properly calibrated monitor. On my laptop, however, your "after" shot still looks like it has too much contrast. If this is because of my uncalibrated monitor, then ignore the following suggestion. However, if others also think it is too contrasty, you might want to consider using one of several plugins and/or AVISynth functions to remedy that. These remedies have been discussed in earlier posts in this thread, and some are incorporated into VideoFred's script.
So, great job. I'm sure your dad must be thrilled!! I did this for my dad many years ago. He is gone now, but long before he died, he watched them all and I set up a microphone and recorded what he had to say about each scene. I then re-burned the DVDs, but with his audio track added. This may or may not be important for you, but I thought I'd mention it just in case you hadn't thought of it. I learned an amazing amount about each scene in each movie that neither I nor the rest of my family would have otherwise have known.
amendegw
29th May 2011, 00:46
Okay, I've got this script working thanks to Didée's reference to an MVtools2 mirror site.
Publicly, I'd like to say "thanks" to Didée and johnmeyer. This script is quite amazing!
Click here (http://www.jazzythedog.com/testing/whitesands.html) for my test. (I also did some color correction in Sony Vegas).
...Jerry
PS: I also learned I'm going to have to do a re-capture - some focus problems, etc. This was amateur 16mm color video captured in 1949!!!
PPS: I'm the kid with my Mom. Dad rolls down the sand dune - 62 years ago!
johnmeyer
29th May 2011, 02:44
This was amateur 16mm color video captured in 1949!!!Probably color film, not video.
amendegw
29th May 2011, 09:49
Probably color film, not video.Correct! I just had senior moment. Now a color "video" in 1949 would really be something.
...Jerry
Great before/after comparison. If your editing software permits it, it is sometimes useful to do a split screen, either like VideoFred did in the Vimeo post in the first post in this thread, or else by showing the scene only once, but with the left side showing the "before" and the right side showing "after." This makes it much easier to get across the amazing difference between the original and the improved versions.
Thanks for the compliment. Of course you know you played no small part in the achievement :-)
And you know what ? The split scene idea occurred to me just as I finished uploading the two separate clips... but it was a bit late at night to act upon it. I gave it a try this morning, thinking it would be child's play with Avisynth, but I hit a snag: the original is standard 25fps interlaced mpeg from DVD, while the processed clip is progressive, 19.75fps with pulldown. When I encode them side-to-side I get good synchronisation between the two, but whatever I try, the right one (processed) is much degraded with combed frames that are not supposed to be there... I'm a bit stumped about that.
I look forward to reading which things you ended up doing. It looks like you did the excellent Didée flicker reduction, but may also have done a little color correction as well.
Oh yes, I invented nothing, it's just a patchwork of various recipes from you guys, with due credit... The main issues were finding out what worked on such a bad source and what didn't, keeping the encoding time to something reasonable (about 10 for 1)... and knowing when to stop :-)
There are so many possibilities that one can spend ages trying them all out, tweaking this and that... and I didn't have forever. Besides, all this will probably have to be redone at some point, so it wasn't worthwhile.
I am not at my main computer right now, and that computer has a properly calibrated monitor. On my laptop, however, your "after" shot still looks like it has too much contrast. If this is because of my uncalibrated monitor, then ignore the following suggestion. However, if others also think it is too contrasty, you might want to consider using one of several plugins and/or AVISynth functions to remedy that. These remedies have been discussed in earlier posts in this thread, and some are incorporated into VideoFred's script.
Do tell me what you think when you get a chance to see it on the right monitor. This sounds like something I could add easily to the next batch, without increasing encoding time, but I don't have the trained eye and experience to evaluate it myself...
So, great job. I'm sure your dad must be thrilled!!
Thanks again. Well, he is thrilled... in anticipation, as his bday is later in June :-)
Actually they dropped by a fortnight ago on the return leg of a trip, and I showed him a few of the individual clips I'd just encoded. He was amazed at the difference, and much comforted. What he'll get with the full DVD is the authoring : menus, clips cut & reordered for a better narrative, title screens and relevant sound tracks...
(I forgot to say that the original transfer, adding insult to injury, had unbearable elevator music muxed in :-).
I did this for my dad many years ago. He is gone now, but long before he died, he watched them all and I set up a microphone and recorded what he had to say about each scene. I then re-burned the DVDs, but with his audio track added. This may or may not be important for you, but I thought I'd mention it just in case you hadn't thought of it. I learned an amazing amount about each scene in each movie that neither I nor the rest of my family would have otherwise have known.
What an amazing notion, it would never have occurred to me, thanks ! I will ask him if he'd like to do that, although sadly his memory is not what it used to be : when I questioned him about certain scenes while authoring, his answers were sometimes uncertain. But the value lies elsewhere, I guess...
johnmeyer
30th May 2011, 01:53
.. What an amazing notion, it would never have occurred to me, thanks ! I will ask him if he'd like to do that,I have posted many short clips of my film transfers. In most cases I stripped out my dad's narration, but FWIW, here is a short clip that includes him talking. You can decide if this sort of thing would be appropriate.
Oak Park and Chicago 1930 (http://www.youtube.com/watch?v=d2dcV7hUOJA&feature=channel_video_title)
I have posted many short clips of my film transfers. In most cases I stripped out my dad's narration, but FWIW, here is a short clip that includes him talking. You can decide if this sort of thing would be appropriate.
Oak Park and Chicago 1930 (http://www.youtube.com/watch?v=d2dcV7hUOJA&feature=channel_video_title)
Thanks John, I'll listen to that tonight.
I'm also "upping" my current question in the post above, which maybe got lost in the noise :
Anyone knows how I could create a side-by-side display of two clips, one a standard 25fps interlaced mpeg from DVD, and the other a progressive .m2v with 19.75/25 pulldown, without degrading the latter ?...
Well, that was enlightening. Beforehand I had trouble envisioning an off-voice monologue along the reel, but it turns out it's more like a conversation, with you and another person commenting and prompting him when he falters, and it's actually quite lively and authentic. Thanks for the idea !
And of course, I don't know how good the film was to begin with, but the quality of the picture you got out of it is unbelievable for something that ancient. "Chapeau" ! :-)
johnmeyer
31st May 2011, 18:54
De rien.
I suggest to start a new thread because this one becomes pretty heavy. Then I will place a link in the first post of this thread. You can do the same in your thread. This way, people with 8mm transfers on VHS will not have to search this entire thread. And people with frame-to frame transfers will find their way to my thread. :)
Fred.
As promised, the new topic is online :
http://forum.doom9.org/showthread.php?t=161493
I tried to cram a lot of stuff inside, and may have gone a bit overboard.
Comments & suggestions welcome :-)
Hello !
Those scripts are really amazing !
What can I expect from a capture I made with a DV camera (shutter speed 1/50 s, the movie being played around 16,6 fps) ?
What should be added to the script ? (deinterlace, duplicate frame remover or something )
Aymeric,
Maybe this is a little bit late, but probably some of the notions explained in my new topic (see previous post) could be adapted to your case...
I finally gathered back some common sense and succeeded in making a side-by-side, before/after comparison, as suggested earlier by John:
http://vimeo.com/24690815
clive18
7th July 2011, 20:42
Hi.
I have been making nice progress with the script, thanks very much for this magical software.
My difficulty has come from the fact that some of my captures were done in 16:9 (wide screen) and some in "regular" 4:3 aspect ratio. After the script has run , I cannot get the wide screen captures to play in a wide format, so everyone looks thinner than they should be :)
The settings I am wondering about are on this line:
"W=720 H=576 #final size from the returned clip"
I was thinking maybe I need to change these setting for wide screen, but I am not sure.
Also what would one change these settings to if one were to capture in HD? 1920 X 1080 ? (planning for the future..:)
Any comments are welcome, and I appologise if this is a video newbie question.
regards
Clive
videoFred
8th July 2011, 06:24
The settings I am wondering about are on this line:
"W=720 H=576 #final size from the returned clip"
I was thinking maybe I need to change these setting for wide screen, but I am not sure.
Why do you not try it?
Fred.
Pieter8mm
8th July 2011, 19:38
Originally Posted by clive18
My difficulty has come from the fact that some of my captures were done in 16:9 (wide screen) and some in "regular" 4:3 aspect ratio. After the script has run , I cannot get the wide screen captures to play in a wide format, so everyone looks thinner than they should be
I got very nice footage to 16x9 with this script from Robert Martens. See his tutorial on;
http://www.gyroshot.com/simpleslug.htm
2Bdecided
8th July 2011, 21:46
The settings I am wondering about are on this line:
"W=720 H=576 #final size from the returned clip"For "PAL" DVD, all content is 720x576 (704x576, or, rarely, some lower resolution version). Whether it's displayed as 16x9 or 4x3 depends on a flag in the encoding, not the number of pixels - you must set the flag in your MPEG encoder (or hack it after encoding) - AVIsynth cannot set the flag in the AVI file because there is none to set.
For web use, it's usual to render square pixels - e.g. 768x576 for 4x3, 1024x576 for 16x9. The "NTSC" frame sizes are more usual on the web - e.g. 640x480 for 4x3 and 640x360 or something like 856x480 for 16x9. It's quite common to upscale to 1280x720 for YouTube to make it deliver higher quality, even if the original isn't HD.
Cheers,
David.
mathmax
14th July 2011, 13:53
I always have a problem with this script. Some frames are badly processed... colors are suddenly very dark. Please look:
http://img843.imageshack.us/img843/5847/0000pfj.jpg
http://img232.imageshack.us/img232/8166/0001ng.jpg
What is that problem?
johnmeyer
14th July 2011, 17:05
Make sure you crop the black borders before you feed the video to the script.
mathmax
14th July 2011, 20:28
indeed, I added the black borders before I applied the script. Does that cause the problem?
johnmeyer
14th July 2011, 21:10
indeed, I added the black borders before I applied the script. Does that cause the problem?
VideoFred may have to reply to this. It has been over a year since I posted all my suggestions and updates to his script, and I am now forgetting some of the things I found back then.
You will find that he temporarily adds a border before doing the Autolevels in order to "soften" (his words) the effect. I seem to remember that I played around with that quite a bit and ended up with something similar to what you posted, namely that a frame would suddenly go very dark, and then, a few frames later, the levels would "pop" back up to normal again.
I was initially using the script on 8mm film which is almost exactly square. Because of this, you end up with pillar borders when you capture and edit using a 4:3 aspect ratio. These pillars resulted in very bad things happening with the Depan motion stabilization, so I modified his script to permit you to remove them before submitting the video to the script, and then adding them back in as the last step. That solved the Depan problems, and seemed to make everything else in the script "happier."
If you look at my version of the script, posted in one of my first responses in this thread, and you'll see how I did that.
mathmax
14th July 2011, 21:23
VideoFred may have to reply to this. It has been over a year since I posted all my suggestions and updates to his script, and I am now forgetting some of the things I found back then.
You will find that he temporarily adds a border before doing the Autolevels in order to "soften" (his words) the effect. I seem to remember that I played around with that quite a bit and ended up with something similar to what you posted, namely that a frame would suddenly go very dark, and then, a few frames later, the levels would "pop" back up to normal again.
I was initially using the script on 8mm film which is almost exactly square. Because of this, you end up with pillar borders when you capture and edit using a 4:3 aspect ratio. These pillars resulted in very bad things happening with the Depan motion stabilization, so I modified his script to permit you to remove them before submitting the video to the script, and then adding them back in as the last step. That solved the Depan problems, and seemed to make everything else in the script "happier."
If you look at my version of the script, posted in one of my first responses in this thread, and you'll see how I did that.
In fact, I have the same problem with MDegrain2() or MVDegrainMulti() isolated in a script.. the error seem to come from these functions...
videoFred
15th July 2011, 06:42
You will find that he temporarily adds a border before doing the Autolevels in order to "soften" (his words) the effect.
Yes, I did this because the original Autolevels was far from perfect. Frustum has tracked a colorspace bug in this filter and he has fixed this. His modified version of Autolevels is working pretty good now. He has added lots of new parameters also. The autolevels effect can now be limited with output_high and output_low. So there is no reason anymore now to add borders before processing.
I have my new scripts ready, the are all using the modified autolevels filter. I have also improved the stabilizing and the sharpening. And I have made a new helpfile.
Upload is coming soon :)
Fred.
mathmax
15th July 2011, 14:21
Yes, I did this because the original Autolevels was far from perfect. Frustum has tracked a colorspace bug in this filter and he has fixed this. His modified version of Autolevels is working pretty good now. He has added lots of new parameters also. The autolevels effect can now be limited with output_high and output_low. So there is no reason anymore now to add borders before processing.
I have my new scripts ready, the are all using the modified autolevels filter. I have also improved the stabilizing and the sharpening. And I have made a new helpfile.
Upload is coming soon :)
Fred.
videoFred, your script is very nice.. but unfortunatly I always have the error I mentioned before on some frames when I use it.. Any idea of the problem?
videoFred
16th July 2011, 15:20
videoFred, your script is very nice.. but unfortunatly I always have the error I mentioned before on some frames when I use it.. Any idea of the problem?
No, I have no idea. Never have seen this kind of error before. You are using my script on video, right? It's not made for this... There are other solutions for video.
Fred.
mathmax
16th July 2011, 17:33
No, I have no idea. Never have seen this kind of error before. You are using my script on video, right? It's not made for this... There are other solutions for video.
Fred.
well.. no matter the source. I always get this error when I perform the script. I'm pretty sure it comes from MVAnalyseMulti() cause I got the same kind of error on scripts containing that function
Maybe it's a problem with the DLL.. is that function part of mvtools 2?
videoFred
16th July 2011, 19:34
Maybe it's a problem with the DLL.. is that function part of mvtools 2?
No, MVTools2 is from Fizick and it's used in the script for the interpolation only.
MVAnalyseMulti() is part of -guess what- :) MVToolsMulti. MVToolsMulti is a modified version of the original MVTools. The dll is named MVTools.dll. Perhaps it would be better to rename it to MVToolsMulti.dll.
But there are several MVToolsMulti dll files, optimised for different computer systems. I just took the one that was working on all my computers. XP and Vista, I have not checked the script on Win7 yet.
Anyhow, you will find all these versions in the 'Source' directory of the package. Perhaps another dll will solve your problem. Be careful because they all have the same name: MVTools.dll.
Fred.
mathmax
16th July 2011, 19:46
No, MVTools2 is from Fizick and it's used in the script for the interpolation only.
MVAnalyseMulti() is part of -guess what- :) MVToolsMulti. MVToolsMulti is a modified version of the original MVTools. The dll is named MVTools.dll. Perhaps it would be better to rename it to MVToolsMulti.dll.
But there are several MVToolsMulti dll files, optimised for different computer systems. I just took the one that was working on all my computers. XP and Vista, I have not checked the script on Win7 yet.
Anyhow, you will find all these versions in the 'Source' directory of the package. Perhaps another dll will solve your problem. Be careful because they all have the same name: MVTools.dll.
Fred.
Indeed I didn't have this problem when working in XP. I'm on win 7 now. My processor is a core i5 but I removed the call to SetMTMode() to process the script on a single thread.. maybe that causes a problem.
The dll are all from 2008.. aren't there new version? Which one do you think I should use?
videoFred
17th July 2011, 10:29
The dll are all from 2008.. aren't there new version? Which one do you think I should use?
I do not know. Try them all :p
MVToolsMulti() is from Josey_Wells and you will find it in the MVTools thread around page 50. As far as I know there are no newer versions.
Fred.
clive18
16th August 2011, 23:24
Thanks Pieter8mm and 2Bdecided for your feedback regarding my widescreen capture. Its a bit strange that wide screen SD is the same resolution as 4:3 in SD. The pixels are actually rectangular, giving it the extra width.
I have decided to recapture in normal 4:3 aspect ratio as I now realise that by capturing in widescreen I have effectively reduced the number of vertical pixel resolution by 30%.
Thanks again
regards
Clive
stoffal
21st August 2011, 11:28
I am playing around with the 8mm script for some months now. It is AMAZING how many details and image quality it provides on my 50 years old material (I have never seen my grandpa that sharp! ;-)
I am wondering what codec you all use to output the processed video? Uncompressed? A special Photo-JPG? Xvid H264?
Like many of you, I am first processing the script and then edit the videos into one final movie in Premiere or FinalCut. So: What is your prefered codec to output 8mm from Fred's script?
fpp
21st August 2011, 12:44
All I know is that VideoFred's homemade machine outputs 1024 x 768 AVI, using the huffyuv codec :
http://neuron2.net/www.math.berkeley.edu/benrg/huffyuv.html
I am guessing his Avisynth scripts output to the same format to avoid losing quality in the editing step.
After that the result can be encoded according to whichever media you want : DVD, AVCHD, etc.
videoFred
21st August 2011, 17:03
Hello all,
I have done many tests, lately.
But let's begin with the codec issue. The output from my machine vision camera is 1024x768 BY8. This is an uncompressed, not debayered format. The debayering is done on the fly by the capturing software. Then, I can select a codec for saving the files. On my old 34bits XP machine, I was using Huffyuv for this. But now I have a new 8-core 64 bits machine and Huffyuv is not working on this machine. But I have plenty of HD space, so I capture in uncompressed RGB for now.
Now, about Avisynth:
---------------------------
The output of an Avisynth script is always uncompressed, no matter the input. The color space is the one we have specified in the script. The output of my filmscript is uncompressed YV12. This is what VDub will save in direct stream modus.
About resolution and aspect ratio:
----------------------------------------
I just got myself a new Sony Bravia TV. Full HD, 40".
Guess what: there's no need for software upscaling, the TV takes care of that.
It looks like the internal hardware upscaling is very good on these new flatscreens.
I can play standard 720x576 PAL files on my TV in full 1080p, with very good quality.
Those files are relative small in size and they can be streamed straight from my PC to my TV.
The TV is connected to the home network.(wifi). Great for testing purposes, no more DVD burning.
I had to install PS3 Media Server on my PC, this tool makes the files suitable for streaming.
Of cource everything is 16:9 these days. Film was 4:3. 720x576 is not exactly 4:3 so 768x576 is better.
We can do two things: adding borders left and right (pillarbox), or cropping to 16:9.
768x576 cropped to 16:9 is 768x432.
Those 768x432 files are playing fine in full 1080p HD on the Sony flatscreen.
I have done some tests with true 720p (1280x720) files and the difference is minor.
About frame rates:
----------------------
Regular-8 was captured in 16fps, Super-8 in 18fps.
Standard frame rates for HD are 25, 50 and 60fps.
Scenes with fast moving objects can be converted to 25fps with frame blending.
But if you like smooth panning and zooming, frame interpolation is the way to go.
Super-smooth playing can be archieved by frame interpolation from 16 or 18 to 50fps.
Many greetings from a sunny Belgium, :cool:
Fred.
fpp
21st August 2011, 20:24
Thanks for the (many) corrections Fred, I was way off-base :-)
Good news about the new TV ! I also have a 40" Sony, I must also try the upscaling on it.
Greetings from sunny (for once) Paris :-)
johnmeyer
22nd August 2011, 01:29
I agree with all of VideoFred's comments and suggestions posted above, but I would like to propose an alternative to the frame blending or frame interpolation.
The first alternative is to do nothing. Save the file at 16, 18, or (for sound film) 24 fps. Then, play this file back directly on the big screen TV. My TV lets me plug in a thumb drive and play most video files directly from that.
The second alternative is to add hard pulldown by duplicating fields using a simple script something like this (if you are making an NTSC DVD):
assumefps(18)
changefps(59.94)
separatefields()
selectevery(4,0,3)
weave()
I do like the smoother playback you can get from frame blending or frame interpolation that VideoFred recommends, but I do not like the fact that you introduce some level of distortion. Blended frames are fuzzy, and interpolated frames (using MVTools2) can be distorted. Yes, I understand that the old-fashioned pulldown fields mean that the film will exhibit judder during camera pans, and these pans are unfortunately much more prevalent on amateur film than professionally shot "Hollywood" films. However, that is what film looks like.
This is strictly an "artistic" decision, and each person needs to decide which "look" they prefer. I am posting just so everyone understands what alternatives are available.
[edit]Added "Weave()" at the end of the above script.
Baxich
22nd August 2011, 03:43
Then, I can select a codec for saving the files. On my old 34bits XP machine, I was using Huffyuv for this. But now I have a new 8-core 64 bits machine and Huffyuv is not working on this machine. But I have plenty of HD space, so I capture in uncompressed RGB for now.
There are several lossless options on 64-bit OS's - for example Lagarith (comes in 32 and 64-bit versions in the same package - http://lags.leetcode.net/codec.html) and ffdshow's FFV1 (http://www.free-codecs.com/ffdshow_download.htm - different installation package for 32 or 64-bit versions - you can actually install both).
FFV1 has somewhat better compression than Lagarith (both of these codecs have better compression than Huffyuv), but doesn't work with some apps (and I think is slower), so I combine them - whenever I can I use FFV1, but if incompatibility arrises, I use Lagarith.
videoFred
22nd August 2011, 07:53
The second alternative is to add hard pulldown by duplicating fields using a simple script something like this (if you are making an NTSC DVD):
assumefps(18)
changefps(59.94)
separatefields()
selectevery(4,0,3)
As usual, thank you for your input, John! :)
You have forgotten weave() at the end of your script :p
You are creating interlacing with this script. It might be a good alternative for frame blending. I will test it for sure.
Can you explain some more please? I do not have any experience with separatefields() and selectevery().
And how do I change this to go from 18fps to 25fps PAL?
Fred.
Gargamel
22nd August 2011, 11:09
Hi everybody,
Thank you for all these infos.
About codecs...
Capturing in SD mode, my original clips come out from the cam with the old DVSD codec.
Then, as long as I works using VirtualDub and AviSynth, I remain strictly in uncompressed RGB, till the point where the video is given to my NLE software for editing and burning.
But each capture clip (or some important intermediate video) is archived using the last Lagarith codec, which saves a lot of Gb... and many Gb usually make some Tb in the end...
Try it out a bit, Fred: Lagarith likes 64bit and multicore ;-)
Have a nice day !
videoFred
22nd August 2011, 11:50
Try it out a bit, Fred: Lagarith likes 64bit and multicore ;-)
Ok, I will try it out. Thank you both for the hint, Gargamel and Baxich!
Fred.
videoFred
22nd August 2011, 11:57
Good news about the new TV ! I also have a 40" Sony, I must also try the upscaling on it.
A Bravia, a smart TV? Then you can connect it to your home network, right? Then you realy must try PS3 media server. The Sony can not read to many codecs, only mpeg2 and h264. PS3 media server is transcoding everything (in real time) so the Sony can read it. I can even stream uncompressed RGB and YV12 this way. :)
Fred.
johnmeyer
22nd August 2011, 16:12
As usual, thank you for your input, John! :)
You have forgotten weave() at the end of your script.I edited my script above to add that. I was in a hurry and didn't grab enough of the script. Thanks for catching my error.
Can you explain some more please? I do not have any experience with separatefields() and selectevery().
And how do I change this to go from 18fps to 25fps PAL?
The above script is designed to go from 18 fps to 29.97 interlaced. This permits 18 fps progressive film to be displayed on a standard NTSC interlaced display. The script creates a variant of the traditional "3:2" pulldown which takes 23.976 (nominally 24 fps) and converts it to 29.97 (nominally 30 fps) interlaced. With traditional pulldown, the "fields" of the progressive film are repeated. (Progressive video can be broken down into odd and even fields, despite the fact that there is no temporal difference between those fields as is the case with interlaced video.) Thus, you get the first two fields from the first frame, followed by the two fields from the next frame, but then the first field displayed from the second frame is repeated (that's the "3" in the "3:2"). The two fields from the next frame are then displayed, and so on.
This same conversion could be done by repeating entire frames, but the stutter and judder would be twice as apparent. By repeating fields instead of frames, you end up with half the temporal disruption that you would get by duplicating entire frames.
The 3:2 pulldown is how film has been displayed on NTSC TVs since the beginning of time.
For PAL, 24 fps film is often just broadcast as is, resulting in slightly fast playback. No pulldown is done. However, for 18, 16, and slower film (a lot of my old film transfers from the 1920s and 1930s need to be played back even slower than 16 fps, probably because the cameras were still sometimes hand-cranked in those days) you have to add pulldown for PAL playback. This pulldown is done by repeating fields.
You can search these forums and find various scripts I've posted, mostly for adding pulldown to go from 18 fps progressive to 29.97 interlaced. However, many years ago, someone told me I was being rather thick and that I could use a much more generic script that would handle adding pulldown from any starting frame rate, and go to any desired final interlaced frame rate (including PAL 25 fps interlaced, i.e., 50i). The only things you need to change are:
1. Change the AssumeFPS in the first line of the above script to match your film frame rate (18 fps in the script example).
2. Alter the ChangeFPS to double the final frame rate (so that would be 50 for PAL instead of 59.94).
Here's a link to a very short, but useful, discussion about this from quite a number of years ago:
Telecine (http://forum.doom9.org/showthread.php?p=445906#post445906)
Hope that helps!
videoFred
22nd August 2011, 16:35
Here's a link to a very short, but useful, discussion about this from quite a number of years ago:
Telecine (http://forum.doom9.org/showthread.php?p=445906#post445906)
Hope that helps!
It sure helps, thank you John!
Fred.
bizz & buzz
24th September 2011, 23:10
This script does wonders! but I noticed that scene-changes remain dirty and not being cleaned... is there a way to fix it?
bizz & buzz
26th September 2011, 15:39
Please, any help will be much apperciated
videoFred
26th September 2011, 15:55
Because the denoiser is averaging several frames, it takes a few frames at scene change before it works like it should be. There's nothing we can do about that, you will have to cut a few frames at scene change manually. (after running the script).
Fred.
johnmeyer
26th September 2011, 18:21
The other alternative is to denoise each scene individually. This is what I do on critical film scenes. I also adjust the script parameter for each scene. One issue for any sort of denoising is that that is no "one size fits all" script, and even a great script like this one requires that the settings be tuned for the specific problems in each scene.
videoFred
27th September 2011, 06:27
The other alternative is to denoise each scene individually. This is what I do on critical film scenes. I also adjust the script parameter for each scene.
Yes, this is the only good way to do a realy perfect job. This is one of the reasons why I capture scenes, never an entire reel in one shot. So at the end of a capture session, I have reel#1.01.avi, reel#1.02.avi etc... Scriptwriter is a great help here, it creates one script for every scene. Then it's easy to tweak the parameters for every individual file. Then I run all the scripts in a VDub jobfile.
But if a filmreel contains not to many different scenes, you can get away with one setting for the entire reel.
Fred.
joka
27th September 2011, 16:10
bizz & buzz
I have tested the script some time ago and found also, that the last frame before and the first frame after a scene change is not cleaned (no dirt remomal). IIRC the RemoveDirt function do not care about scene changes.
bizz & buzz
27th September 2011, 22:13
Thanks for your comments guys.
Came across a little suggestion by Didée, (see the MC version HERE (http://forum.doom9.org/showthread.php?p=1206869#post1206869)), that did a great job.
LoadPlugin("RemoveDirt.dll") # v0.9 of RemoveDirt
LoadPlugin("MVTools.dll") # There're plenty of incompatible-to-each-other versions currently.
# v1.10.2.1 would be good for this little script here
source = last # whatever you have
prev = source.MVCompensate(source.MVanalyse(isb=false,blksize=16,overlap=8,idx=8),idx=8)
next = source.MVCompensate(source.MVanalyse(isb=true, blksize=16,overlap=8,idx=8),idx=8)
source.SCSelect(next,prev,source,dfactor=2.0)
Sure there are sometimes MC artifacts, but they are unnoticeable in normal playback speed.
Perhaps it will be a good idea to implement this as an option in VideoFred's script.
Thanks again :)
fpp
6th October 2011, 21:08
A Bravia, a smart TV? Then you can connect it to your home network, right? Then you realy must try PS3 media server. The Sony can not read to many codecs, only mpeg2 and h264. PS3 media server is transcoding everything (in real time) so the Sony can read it. I can even stream uncompressed RGB and YV12 this way. :)
Yes, a KDL40EX500. I did some tests for fun initially on Ethernet (the previous TV was a 12-year old CRT :-).
The inbuilt player is very limited indeed.
I also tried PS3 media server, which works really well... but I didn't like the idea of my PC transcoding stuff while the kids were watching a movie, so in the end I just added a Popcorn Hour A200 to take care of that :-)
It doesn't seem to like your uncompressed files however, so if I want to see the raw transfers on the TV I'll give PS3mp another try, thanks for the tip !
PS: sorry for answering so late, but somehow Doom9 decided to stop sending me notifications for this thread around August 22nd, so I though nothing was happening until I got suspicious and checked back in today...
dodgyknee
19th October 2011, 18:48
Sorry, novice here.
I have been very impressed with the results of this script - but so far this hasn't been possible for me!
I have an avi which is the output of a frame-by-frame scanned standard 8 film but when I plug the file into Fred's script it fails with an avisynth open failure, error code 2, on line 122 with the interpolation script and line 120 with the blending script. I have, honestly spent hours trying to figure this out but I am very stuck!
Can anyone give me a hand with this?
Sandy
videoFred
20th October 2011, 06:38
Sorry, novice here.
Hi Sandy, you are most welcome here. :)
It looks like Avisynth can not open your AVI file.
Line 120 and 122 is where the file is opened.
Please show me a screenshot of the error message.
Or at least give me the full error message.
Fred.
dodgyknee
20th October 2011, 18:56
Thank you very much Fred for the warm welcome, it is much appreciated.
I started typing out the error message for you and this made my mistake obvious! I had missed out part of the file directory (the folder). Having fixed this, I then was presented with another error which I have also sorted by installing yuvcodecs.exe.
The film is being restored now (slowly) but I'm not not sure what to do when it ends but I'll need to figure that out later.
This is really great Fred!
Sandy
mammo1789
26th October 2011, 03:04
Thanks Fred for the wonderful package. After I run you script the result is much sharper ( too much for my taste) and less blurry and stable. I recorded directly trough canon power shot a720 camera in 6400x480 30fps progressive. But the spots and lines ( like black not straight and constant lines are still there) I tough the script should solve that. Another question is how to see only the final video when encoding and not the original result ( and on the result part there is text describing the usage of auto levels and so on) I know that I should delete something from the script but I don't know what
Thanks
videoFred
26th October 2011, 06:21
Thanks Fred for the wonderful package.
You are welcome. But please read the helpfiles. :)
Fred.
mammo1789
26th October 2011, 16:07
You are welcome. But please read the help files
Thanks Fred I read the files but i still don't understand how to get only one picture. I changed the sharpening and blurring parameters to make it more subtle and i played with the denoising parameters. But if i try to delete some lines ( results lines ) i get script error. Can you just explain me plain simple how to get only the result output as a single picture without the text, I'm not to good in avisynth.
The screen i get is this i would like only the middle.
http://imageshack.us/photo/my-images/683/screenshot001ek.png/
mammo1789
26th October 2011, 16:09
http://http://imageshack.us/f/683/screenshot001ek.png/
johnmeyer
26th October 2011, 17:12
Thanks Fred I read the files but i still don't understand how to get only one picture. Remove the "S" from this line.
result="resultS4" #specify the wanted output here
videoFred
27th October 2011, 06:41
Thank you John. :)
Fred.
Boffee
28th October 2011, 20:49
I am afraid I am also having trouble with Fred's script. It just will not run. I only have a single core processor and hopefully I have edited the script to run it but I get the following error."Avisynth open failure. Evaluate System exception- Illegal Instruction (C:\Users\KEITHW\Documents\Film_Restore\05) Film_Restoring\Script_and Plugins\04_Film_Restoring_Frame_Blending.avs, line 160)"
Can anyone suggest what is wrong? Perhaps I have edited it wrongly. I must admit I am confused as to what lines are mt calls to disable. Can anyone post what Fred's script should look like edited ror single core working?
Pieter8mm
30th October 2011, 14:43
Erase al the SetMode lines. There are 3 of them in the script:
SetMTMode(5) #disable all MT calls if you are using a single core computer
SetMTMode(1,0)
SetMTMode(5)
Good luck ;)
Boffee
30th October 2011, 20:13
Thanks for that, still fails line 160 though. I have no idea how to fix this.
johnmeyer
31st October 2011, 02:27
You could try my version of the script, posted much earlier in this thread. I removed all references to the original MVTools, only using the newer MVTools2. This gets rid entirely of the MVAnalyzeMulti statement (line 160 in your script). However, I also made a lot of other changes, and considerably reduced the amount of sharpening. You are welcome to try it:
johnmeyer version of the script (http://forum.doom9.org/showpost.php?p=1406847&postcount=216)
If this doesn't work, then perhaps your problem with Fred's script lies somewhere else.
Boffee
31st October 2011, 20:31
Brilliant, your version of the script works. Thanks very much John. One thing I notice is I get a strange frosted glass type of effect over the picture for a few frames every time there is a scene change, see scene shot. Any ideas what this could be?
screen shot http://flic.kr/p/aCJY8R
johnmeyer
8th November 2011, 17:45
Brilliant, your version of the script works. Thanks very much John. One thing I notice is I get a strange frosted glass type of effect over the picture for a few frames every time there is a scene change, see scene shot. Any ideas what this could be? This has been discussed earlier in this thread:
Scene Changes (http://forum.doom9.org/showthread.php?p=1528482#post1528482)
The problem is that not all the plugins have scene change detection built in, and even for those that do, there is no practical way to "tune" these for the huge range of scene types one might find in amateur film. If you read the above link and the replies in the posts which immediately follow, you'll find a few suggestions for how to deal with the problem.
Gerry62
9th November 2011, 06:33
Just found a sort of issue that I cannot find a awnser for,
Nowm I want to output 29.970 FPS NTSC, Ok sounds fine, But when I change the:
play_speed=
numerator=
to 29.970 It comes up with the following Error
"The Named Argument 'num' to MFlowFps had the wrong Type"
Now Ive tried all variations of 29, 29.9, 29.97 etc.
Is is there something I'm Doing Wrong?
Oh and what's denumerator= used for? I have no idea what the following means 60000/1001= 59.94fps
Anyone help? Probably stupid questions
Gavino
9th November 2011, 08:34
Gerry, set numerator=30000 and denumerator=1001, since the NTSC frame rate is 30000/1001 (= 29.97 approx).
('denominator' would be the correct English word.)
Jan Evertsen
23rd November 2011, 13:11
First post, so i'll start with a big THANK YOU for all your hard work and useful comments.
Some time ago- March 2011, Pieter8mm wrote something about a script
I found a other script on this site wich I like to share with you all.
http://www.homedvd.nl/Site/avisynth.html
I haven't tried yet. Put the picture example looks nice.
This site is down...
Does anyone have this script and can maybe post it or PM it to me?
I've been working with Fred's script and John's script with great success, but I would like to have a look at this one, too.
Gerry62
23rd November 2011, 18:35
Yeah, what was that script that is now down?
johnmeyer
23rd November 2011, 19:03
All you have to do is go to the root page, and you'll find that it is a Dutch movie transfer site. Here is a link, translated to English, to conform to this board's English-only requirement:
High End Scanning and Digital Restoration (http://translate.google.com/translate?sl=nl&tl=en&js=n&prev=_t&hl=en&ie=UTF-8&layout=2&eotf=1&u=http%3A%2F%2Fwww.homedvd.nl%2FSite%2F)
Perhaps if you click on some of the links, you can find the script.
[edit] None of the movies on their main page appears to have been restored with anything similar to VideoFred's script, although the actual film transfers are exceptionally good.
Oh, wait, the very last examples DO show restoration, but clearly not using anything resembling VideoFred's approach (no stabilization, for instance, and the chain link fence details have not been enhanced).
Jan Evertsen
23rd November 2011, 21:23
Thanks John.
I am dutch and already searched all pages of this site but the script was nowhere to be found. I still hope that a reader of this forum downloaded the script when Pieter8mm mentioned it.
I agree that the maker of this site clearly uses another script and so I am curious about this one, because I like the results (although a bit more stabilisation would be nice).
Now i have another question. I have a nice clean black&white transfer but it is very grey.
When I use Johns script I can adjust the whites and blacks but the results are a bit unnatural, like the shadows in this baby's face.
Original:
http://img43.imageshack.us/img43/9243/012original.th.jpg (http://imageshack.us/photo/my-images/43/012original.jpg/)
Avisynth output:
http://img821.imageshack.us/img821/171/012autowhite.th.jpg (http://imageshack.us/photo/my-images/821/012autowhite.jpg/)
Does someone have an advice to 'smoothen' this effect?
johnmeyer
24th November 2011, 00:51
I have a nice clean black&white transfer but it is very grey. When I use Johns script I can adjust the whites and blacks but the results are a bit unnatural, like the shadows in this baby's face.
Does someone have an advice to 'smoothen' this effect?
My answer to that is similar to what I've posted before: AVISynth is not necessarily the answer to every problem. In this case, my approach is to do most of the "levels" work inside my editing program (which is Vegas). This program has a "Color Curves" interactive fX which lets me draw a Bezier transfer curve that alters the exposure of the film, but with a different gain applied to each level. Most film to video transfers result in video that is too dark in the shadows, a little dark in the midtones, but just right or a little too bright in the lightest areas. Each scene typically requires slightly different exposure correction. So, I apply a "generic" gamma curve, using this color curve fX, to each scene, and then, using a calibrated monitor and the built-in real-time histogram, I interactively tweak the exposure while watching the instantaneous results on both the monitor and histogram displays.
I do not use any of the automatic levels or color correctors built in to VideoFred's script.
Here's what the color curves dialog looks like, in case my description above doesn't make sense:
http://i177.photobucket.com/albums/w208/johnmeyer/ColorCurves.jpg
I'm using this exact dialog right at this moment to correct a 1933 amateur 16mm silent film that I'm restoring for a French documentary director.
I wish I knew of some autogain function in AVISynth that would do this, and many people have certainly tried to produce such a thing. One such plugin that I used quite a bit, before I discovered VideoFred's work, was the "High Dynamic Range Automatic Gain Control" plugin. You can search this forum and find the plugin. Try it out, and perhaps it will do what you want, without having to do all the manual labor I describe above. I think it has been updated since I last tried it.
videoFred
24th November 2011, 06:24
Yeah, what was that script that is now down?
It's a clone of my script. Do not worry about it.
Fred.
Jan Evertsen
24th November 2011, 23:41
John, thank you again for your reply.
I tried to adjust levels in another program. So far i am very happy with the results.
I do not use any of the automatic levels or color correctors built in to VideoFred's script.
So i presume you use "Result4", saturation=1 and gamma=1 and set all black levels to 0 and the whites to 255?
Another question about your script: what does the "0.9" do in
sharp1=denoised.sharpen(0.9)
I already had a look at HDRAGC and had some very nice results on color film. But now i'm working on some b&w films, adjusting the levels is a lot faster.
johnmeyer
26th November 2011, 07:04
So i presume you use "Result4", saturation=1 and gamma=1 and set all black levels to 0 and the whites to 255?Yes.
Another question about your script: what does the "0.9" do in
sharp1=denoised.sharpen(0.9)If that is in my version of VideoFred's script, I don't remember it.
videoFred
28th November 2011, 06:26
what does the "0.9" do in
sharp1=denoised.sharpen(0.9)
It's the strenght of the sharpen filter. :D
Fred.
johnmeyer
30th January 2012, 21:48
I thought that readers of this thread might be interested in something I did using not only VideoFred's script, but also using MVTools2 to synthesize frames to replace totally broken frames.
Have a look here at the before/after:
Restoring Jumpy Film (http://www.youtube.com/watch?v=uzMFodrGHDs)
This 8mm film was taken in 1954, and the camera (not the projector) malfunctioned and didn't bring the film to rest before opening the shutter. As a result, not only were the frames jumping up and down, but many of those which jumped were blurred. I verified that this problem was indeed on the film itself, and not a malfunction in my film-to-video transfer equipment.
I went through by hand (thousands of frames) and marked each jump frame. I did this by writing a script in Sony Vegas which let me replace any bad frame with a duplicate of the prior frame. I had to do this by hand because there was no pattern to the bad frames, and the frames which were displaced vertically, but not blurred, could be easily repaired using Deshaker or Mercalli (motion stabilization tools).
I then used a variation of the old AVISynth "filldrops" function software which can detect perfect duplicates and the replace them with interpolated frames using mflowinter
So, on the right-side "after" version of the clip, about 50% of those frames are computer-generated.
I then fed this into VideoFred's script which stabilized and sharpened the result.
Emulgator
30th January 2012, 23:14
Wow, this is awesome work !
Gargamel
31st January 2012, 09:58
+1 !
Congratulations, John, and thank you for sharing that idea.
Your film rescue is really wonderful !
jinkazuya
14th February 2012, 21:18
Just wonder if Fred could reupload the whole thing and tell us what version of the plugins that we could use. Because there are a lot of errors running the script and now we use MEGUI to encode MKV...
Really hope to try the script on the video but encounter a whole bunch of errors. If Fred has time and reorganize the script and even give us the script used for MKV and the plugin versions, it would be great.
Anyway, thanks a lot. Cuz most of the videos I have are of bad quality just wanna rescue them.
johnmeyer
14th February 2012, 23:19
... most of the videos I have are of bad quality just wanna rescue them.Just a quick clarification ...
You keep saying "videos." The script really isn't designed to do anything with video, but is instead oriented towards improving film that has been captured to video using a "frame accurate" film-to-video transfer system.
jinkazuya
15th February 2012, 00:42
Just a quick clarification ...
You keep saying "videos." The script really isn't designed to do anything with video, but is instead oriented towards improving film that has been captured to video using a "frame accurate" film-to-video transfer system.
Yes...I know. But it also help to improve the quality of the video such as movies as well right.
If you ever see something amazing like that, you really don't wanna try it out right away:D
videoFred
15th February 2012, 06:35
Just wonder if Fred could reupload the whole thing and tell us what version of the plugins that we could use. Because there are a lot of errors running the script and now we use MEGUI to encode MKV...
I have 3 XP computers, one Vista and one new 64bits 8-core Win7 machine. The script runs fine on all these machines,without any problems, with the plugins I have uploaded. :sly:
Fred.
jinkazuya
15th February 2012, 07:58
hehehe...don't get wrong :D, I am just afraid of the compatible issues.
I know the script is fine. However, whenever I ran the script, it just gave me a bunch of error message (does not have this filter or errors in certain line of the function).
Anyway, is it possible to use the script for the original ripped DVD VOB.
BTW...Used this with MEGUI to encode MKV.
Also the SetMTMode won't work...I already followed the instruction as described in the help folder, put the dll file of the avisynth into System32 or SysWOW64.
These are the basic inbuilt function of the MEGUI.
LoadPlugin("C:\Users\Desktop\MeGui\tools\dgindex\DGDecode.dll")
DGDecode_mpeg2source("C:\Users\Desktop\Encoded Movies\VIDEO_TS\VTS_01_1.d2v", info=3)
LoadPlugin("C:\Users\Desktop\MeGui\tools\avisynth_plugin\ColorMatrix.dll")
ColorMatrix(hints=true, interlaced=true, threads=0)
videoFred
15th February 2012, 08:24
I know the script is fine. However, whenever I ran the script, it just gave me a bunch of error message (does not have this filter or errors in certain line of the function).
What errors? We will solve them one by one. :p
Also the SetMTMode won't work...I already followed the instruction as described in the help folder, put the dll file of the avisynth into System32 or SysWOW64.
Forget the MT and please remove all MT calls. Instead, run multiple instances of my script if you have a multi core computer. On my 8-core I can easily run 4 instances at the same time.
Fred.
Undead Sega
18th February 2012, 04:42
Hi guys, I know this may seem abit random but still relevant, I thought I would like to share this very simple Flash app that shows the different colour layers from the film 'The Patriot' when reconstructing the faded Yellow layer:
http://www.history.org/foundation/journal/summer04/patrest.swf
Original site is here:
http://www.history.org/foundation/journal/summer04/patriot.cfm
I thought the work was amazing, and I never thought that one could reconstruct or restore a faded layer in film. Tell me what you think, been meaning to mention this kind of topic for ages but didnt know how to do it exactly :)
johnmeyer
18th February 2012, 23:29
Interesting ... but:
1. How did they separate the layers? Is this something to which any of us would have access?
2. Once they have the yellow layer, which appears to have virtually no information, how did they restore it?
[edit]Ah, I just read the second link. They had B&W separation masters. So, I "can't do this at home."
videoFred
19th February 2012, 09:55
Interesting ... but:
1. How did they separate the layers? Is this something to which any of us would have access?
2. Once they have the yellow layer, which appears to have virtually no information, how did they restore it?
[edit]Ah, I just read the second link. They had B&W separation masters. So, I "can't do this at home."
I was asking myself the same questions ;)
However, it might be possible with masktools but this is beyond my knowledge.
Fred.
Undead Sega
20th February 2012, 01:55
I was asking myself the same questions ;)
However, it might be possible with masktools but this is beyond my knowledge.
Fred.
What would be done exactly with MaskTools??? :D
videoFred
20th February 2012, 06:42
What would be done exactly with MaskTools??? :D
Making color masks :p
Fred.
Undead Sega
21st February 2012, 03:43
But wouldnt that be done manually?
johnmeyer
21st February 2012, 23:19
But wouldnt that be done manually?Yes, if it were possible (and I don't think it is) to create color masks in order to separate layers, it would certainly be a manual process. However, I'm pretty sure this sort of thing is not possible without having access to the three B&W separation prints, something that doesn't usually exist, even for many Hollywood films, and certainly not for anything that any of us ever have access to.
So, it is an interesting restoration story, but unfortunately not one that suggests any technique that we might be able to adapt and use with the tools available for AVISynth.
Abyssal
23rd February 2012, 00:12
Edit:
I have had countless amount of errors but it seems I solved them on my own so a tip - if you get any errors - is to replace the AviSynth.dll file in System32/SysWOW64 (I have 64bit Win7 Ultimate so my old AviSynth.dll file was in SysWOW64 and NOT in System32) with the other one. Personally I forgot this but I didn't find it at first either since it wasn't supplied with the .zip file but the one you need is supplied with the MT zip so get that one and pull the modified AviSynth.dll file out of the zip and replace your old one in System32/SysWOW64.
http://avisynth.org/mediawiki/MT
(Some of you might find this stupid but hey, someone might have done the same as me)
videoFred
25th February 2012, 08:35
New before/after examples on Vimeo:
http://vimeo.com/37394781
http://vimeo.com/37393841
Please download the XVid source files, they are much better than the Vimeo files.
For some reason XVid to Vimeo is reducing sharpness.
Fred.
rubento
26th February 2012, 22:12
Fred,
I have seen your new Super 8 restored footage on vimeo and it looks better than ever. Is the script you used the same posted here or has it been updated?
Thank you!
Undead Sega
27th February 2012, 01:42
Yes, if it were possible (and I don't think it is) to create color masks in order to separate layers, it would certainly be a manual process. However, I'm pretty sure this sort of thing is not possible without having access to the three B&W separation prints, something that doesn't usually exist, even for many Hollywood films, and certainly not for anything that any of us ever have access to.
So, it is an interesting restoration story, but unfortunately not one that suggests any technique that we might be able to adapt and use with the tools available for AVISynth.
Hmmm, I do understand where you are coming from, but I think theoretically this can be possible, like if there was somesort of reference frame (with all the colour layers) which can be used to help interpolate the missing colour, i.e. creating the missing or faded film layer.
I found some papers on people trying to do so but I need to do more research, but at the moment I stumbled something interesting:
(3rd post) http://www.apug.org/forums/forum40/75771-restoring-faded-transparency.html
Apprantly, this guy says soaking the right type of film in ferricyanide would restore the Cyan layer. Does anyone have any knowlege on this?
videoFred
27th February 2012, 06:26
Fred,
I have seen your new Super 8 restored footage on vimeo and it looks better than ever. Is the script you used the same posted here or has it been updated?
Thank you!
Hello Rubento,
The script is updated. I will upload it as soon as possible.
Fred.
rubento
27th February 2012, 16:31
Thank you Fred! Your work is awesome!
TheoRI
28th February 2012, 06:14
Dear Fred, I saw the new super8 16:9 conversions and they look very nice. Can you please provide the settings for each edit and the output you used for each (I am talking of result1, result2, result3, or result4 of the original script) and then the settings for color, sharpening etc?
Once again great work! Looking forward to the updated scripts!!
Theo
videoFred
28th February 2012, 06:27
Hi Theo,
It makes no sence to give you those settings because all sources are different.
many greetings,
Fred.
Gargamel
2nd March 2012, 09:31
Hello Fred,
"Bravo" again for your last two clips ++, terrific for regular 8mm.
- A first question: while processing, were your settings the same, all along each clip, or were they different from a scene to another one ?
- A second (more general) one: to interpole, did you test InterFrame-1.13 instead of MFlowFps ? In some quick moving scenes, sometimes InterFrame seems to be interesting... Yesterday, Bernard launched that idea in a thread about "L'interpolation des images", on "Le Transfert Pellicule".
videoFred
2nd March 2012, 14:37
Hello Fred,
"Bravo" again for your last two clips ++, terrific for regular 8mm.
- A first question: while processing, were your settings the same, all along each clip, or were they different from a scene to another one ?
Hello Gargamel,
Settings like sharpness, grain reduction etc. where all the same. On some scenes I had to change the gamma a bit.
- A second (more general) one: to interpole, did you test InterFrame-1.13 instead of MFlowFps ? In some quick moving scenes, sometimes InterFrame seems to be interesting... Yesterday, Bernard launched that idea in a thread about "L'interpolation des images", on "Le Transfert Pellicule".
No, I have never tested Interframe and I will have a look at it.
many greetings,
Fred.
Gargamel
2nd March 2012, 17:22
OK, thank you Fred !
Many greetings,
Andre.
TheoRI
5th March 2012, 00:37
Dear Fred,
While waiting for the new version of your scrip I had a couple of questions:
1) Have you thought of creating the script in a format that is compatible with AvsPmod that uses sliders and maybe section toggles
2) What are your thoughts on using SmoothAdjust plug in for color correction (http://forum.doom9.org/showthread.php?t=154971)
3) Any thoughts of integrating a tool like SmoothGradationRGB for color correction? (http://forum.doom9.org/showthread.php?p=1530964#post1530964)
4) Any thoughts on the interpolated portion using the Interframe vs the MflowFPS scripts
Kind Regards,
Theo
johnmeyer
5th March 2012, 00:52
While waiting for the new version of your scrip I had a couple of questions:
1) Have you thought of creating the script in a format that is compatible with AvsPmod that uses sliders and maybe section toggles
2) What are your thoughts on using SmoothAdjust plug in for color correction (http://forum.doom9.org/showthread.php?t=154971)
3) Any thoughts of integrating a tool like SmoothGradationRGB for color correction? (http://forum.doom9.org/showthread.php?p=1530964#post1530964)
4) Any thoughts on the interpolated portion using the Interframe vs the MflowFPS scriptsGood suggestions, but why not just try it yourself? You'd only have to replace one or two lines of code for each of these changes. If you do try any of these things, I'd be interested in the results.
TheoRI
5th March 2012, 07:00
John,
I tried converting videoFred's script to be AvsPMod compatible (see http://forum.doom9.org/showthread.php?p=1563069#post1563069)
However I have issues with AvsPMod being stable to process and adjust settings.
I also tried out integrating the smoothadjust plugins but have major issues with AvsPMod. It does not want to stay up and process much.
:(
rubento
13th March 2012, 12:18
Fred,
I am anxiously awaiting your new script...
Regards!
videoFred
13th March 2012, 12:26
John,
I tried converting videoFred's script to be AvsPMod compatible (see http://forum.doom9.org/showthread.php?p=1563069#post1563069)
However I have issues with AvsPMod being stable to process and adjust settings.
:(
I guess the grain reduction is to slow for AvsPMod. It takes several second to reload the script after modifying.
However, my script works fine with VirtualDubMod and the build in Avisynth editor.
Fred.
egrimisu
16th March 2012, 20:02
Hey guys,
i have tried to use the destrobing efect and get an error:
rest=last
calm = rest.temporalsoften(1,255,255,32,2).merge(rest,0.25)#.repair(rest,1).removegrain(11)
calm = calm.temporalsoften(1,255,255,16,2).merge(calm,0.25)
LOP = calm.bicubicresize(180,144).bicubicresize(720,576,1,0)
HIP = rest.bicubicresize(180,144).bicubicresize(720,576,1,0)
HIP = mt_makediff(rest,HIP)
mix = LOP.mt_adddiff(HIP,U=2,V=2)
sup1=rest.msuper(levels=1)
sup2=mix.removegrain(11).msuper()
bv2=sup2.manalyse(isb=true, delta=2,blksize=16,overlap=8,DCT=5)
bv1=sup2.manalyse(isb=true, delta=1,blksize=16,overlap=8,DCT=5)
fv1=sup2.manalyse(isb=false,delta=1,blksize=16,overlap=8,DCT=5)
fv2=sup2.manalyse(isb=false,delta=2,blksize=16,overlap=8,DCT=5)
rest.mdegrain2(sup1,bv1,fv1,bv2,fv2,thSAD=640)
return(last)
and error:
mdegrain2 : wrong source or super frame size
anyone know what this is ? Thanks in advance
Solved it:
LOP = calm.bicubicresize(180,144).bicubicresize(720,576,1,0)
HIP = rest.bicubicresize(180,144).bicubicresize(720,576,1,0)
should contain the input resolution on the second bicubic resize and at the first bicubic resize, the second/4. Ibelieve :)
librarian
16th March 2012, 22:12
A better way :
rest=last
w=rest.width()
h=rest.height()
calm = rest.temporalsoften(1,255,255,32,2).merge(rest,0.25)#.repair(rest,1).removegrain(11)
calm = calm.temporalsoften(1,255,255,16,2).merge(calm,0.25)
LOP = calm.bicubicresize(w/4,h/4).bicubicresize(w,h,1,0)#gaussianblur(4)#
HIP = rest.bicubicresize(w/4,h/4).bicubicresize(w,h,1,0)#gaussianblur(4)#
HIP = mt_makediff(rest,HIP)
mix = LOP.mt_adddiff(HIP,U=2,V=2)
sup1=rest.msuper(levels=1)
sup2=mix.removegrain(11).msuper()
bv2=sup2.manalyse(isb=true, delta=2,blksize=16,overlap=8,DCT=5)
bv1=sup2.manalyse(isb=true, delta=1,blksize=16,overlap=8,DCT=5)
fv1=sup2.manalyse(isb=false,delta=1,blksize=16,overlap=8,DCT=5)
fv2=sup2.manalyse(isb=false,delta=2,blksize=16,overlap=8,DCT=5)
return rest.mdegrain2(sup1,bv1,fv1,bv2,fv2,thSAD=640)
As to downsize 1/4 --> upsize 1 see here (http://forum.doom9.org/showthread.php?p=568119#post568119)
stoffal
18th March 2012, 18:32
Wonderful new clips, Fred! Quality work made in Flanders =)
I can't wait to see the updated script... Cheers!
Chris
phate89
18th March 2012, 18:55
Hello Rubento,
The script is updated. I will upload it as soon as possible.
Fred.
Great... I'm starting now for the first time to play with your script... But at this point i'll wait the version with updated plugins and script..
Thanks!
Boffee
21st March 2012, 14:46
I am trying Fred's script but now get error in Line 229:-
StackHorizontal:image heights do not match. I have tried changing the values from 28 to 32 but no differerence. Anyone help
videoFred
21st March 2012, 14:55
I am trying Fred's script but now get error in Line 229:-
StackHorizontal:image heights do not match. I have tried changing the values from 28 to 32 but no differerence. Anyone help
Hello Boffee,
What is the size of the source file?
Fred.
Boffee
21st March 2012, 17:48
Hello Fred
According to gspot it is 720 x 576 which was taken with a camcorder and a condensor lens, I have tried the script on another video taken from a CCTV camera pointing at the gate of a projector, which is 640 x 480 but I get the same error. I have changed your degraining/sharpening part to that as posted in post #37 as i get error "illegal instruction line 161" if I leave it as original. Don't think my single core pc will run MVDegrainMulti for some reason although I have all the plugins in the script and plugins folder.
videoFred
22nd March 2012, 06:31
Hi Boffee,
Your single core pc should run MVDegrainMulti and this has nothing to do with the StackHorizontal error.
Please upload a clip and send me the script you are using, I will take a look at it.
Fred.
Boffee
22nd March 2012, 11:50
Thanks for your help Fred. Video is at http://vimeo.com/39078729. I have send a copy of the script which causes error on line 160. Only difference is SETMTMODE is disabled as far as I can see.
egrimisu
22nd March 2012, 21:20
A better way :
rest=last
w=rest.width()
h=rest.height()
calm = rest.temporalsoften(1,255,255,32,2).merge(rest,0.25)#.repair(rest,1).removegrain(11)
calm = calm.temporalsoften(1,255,255,16,2).merge(calm,0.25)
LOP = calm.bicubicresize(w/4,h/4).bicubicresize(w,h,1,0)#gaussianblur(4)#
HIP = rest.bicubicresize(w/4,h/4).bicubicresize(w,h,1,0)#gaussianblur(4)#
HIP = mt_makediff(rest,HIP)
mix = LOP.mt_adddiff(HIP,U=2,V=2)
sup1=rest.msuper(levels=1)
sup2=mix.removegrain(11).msuper()
bv2=sup2.manalyse(isb=true, delta=2,blksize=16,overlap=8,DCT=5)
bv1=sup2.manalyse(isb=true, delta=1,blksize=16,overlap=8,DCT=5)
fv1=sup2.manalyse(isb=false,delta=1,blksize=16,overlap=8,DCT=5)
fv2=sup2.manalyse(isb=false,delta=2,blksize=16,overlap=8,DCT=5)
return rest.mdegrain2(sup1,bv1,fv1,bv2,fv2,thSAD=640)
As to downsize 1/4 --> upsize 1 see here (http://forum.doom9.org/showthread.php?p=568119#post568119)
Thanks for the script, strobes are removed but also alot of grains, is there a way to preserve the grains, i mean as much as possible. Also shadow are inserted like blending can this be fixed?
librarian
23rd March 2012, 01:22
Thanks for the script, strobes are removed but also alot of grains, is there a way to preserve the grains, i mean as much as possible. Also shadow are inserted like blending can this be fixed?
That script is essentially a degrainer (and temporal stabilizer).
Save grain (before the script):
grain=mt_makediff(removegrain(4))# any degrainer you like
reinsert grain (after the script):
mt_adddiff(grain)
In addition you can try to:
use mdegrain1 (and may be to lower blksize to 8 and overlap to 4),
and/or reduce the thresholds in temporalsoften,
but both operations may lessen the desired effects.
egrimisu
23rd March 2012, 10:40
That script is essentially a degrainer (and temporal stabilizer).
Save grain (before the script):
grain=mt_makediff(removegrain(4))# any degrainer you like
reinsert grain (after the script):
mt_adddiff(grain)
In addition you can try to:
use mdegrain1 (and may be to lower blksize to 8 and overlap to 4),
and/or reduce the thresholds in temporalsoften,
but both operations may lessen the desired effects.
Thanks, some of the grains are kept, much better than without it.
My last and more important concern is that the wholse script introduces blending, is this something that can be fixed?
TheoRI
31st March 2012, 16:25
Dear Fred,
I am waiting for the new script you mentioned earlier in the month and was wondering when you could upload it.
Kind Regards,
Theo
GMJCZP
1st April 2012, 05:54
Same here, heh, heh.
I like the work of videofred and tried to use part of your script into other applications. Now I would like to learning and use the stabilization.
I had problems with Deshaker and Depan package :helpful:, so I'd like to stabilize some videos with slight movement.
Thanks a lot.
TheoRI
14th April 2012, 15:07
Fred,
Is there any news on the new version of the script?
Kind Regards,
Theo
Emulgator
18th April 2012, 23:26
I had problems with Deshaker and Depan package :helpful:, so I'd like to stabilize some videos with slight movement.
Thanks a lot.
A simple Stab() works wonders sometimes.
GMJCZP
10th May 2012, 15:48
A simple Stab() works wonders sometimes.
Thanks Emulgator. I'll try.
GMJCZP
12th May 2012, 06:39
It works very well, I activate the mirror option for to fill the black parts. Thanks.
Just noticed that sometimes the right side of the image does not fill it, it will be offset = -1?
Honeyko
20th May 2012, 08:19
///Warning: total Avisynth newb///
- - - -
I have:
1. Installed Avisynth (v2.5; it's in my Program Items folder).
2. Installed VirtualDub-1.9.10
3. Downloaded Fred's stuff.
4. Have a file ready to process ("abc.avi") in C:\test
....what do I next?
Note: I don't want to change a thing as far as the basic settings of Fred's script go; it looks like he's done a phenominal job of tweaking the heck out of it.
stoffal
20th May 2012, 09:52
Hello Honeyko,
welcome to this forum and to digital film restauration...
If you have downloaded the latest version of Fred's script, you can unpack the zip file. Here you will find some help files explaining what to do with the files. After setting up everything, you will need to adapt the avisynth script to your needs. Open it and read through it, modify it so it works with your file. It is really no "one click solution" -- you will need to understand what the script does, but then you have it all in your hands ! It might help you to take a look at the Avisynth website and go through some tutorial scripts there. Hope it helps!
Honeyko
20th May 2012, 10:04
Hello Honeyko,
welcome to this forum and to digital film restauration...
If you have downloaded the latest version of Fred's script, you can unpack the zip file. Here you will find some help files explaining what to do with the files. After setting up everything...That's the tricky part. Just setting everything up is about as obtuse as it could possibly be. (By "total newb", I meant exactly that. I.e., how do you even open a script in Avisynth? -- There certainly seems to be a lot of other software which calls Avisynth, but using it straight-up is something I've never done.)
I'm trying to avoid massive duplication of learning-curves here. A link to a simple 1-2-3 guide would be handy here.you will need to adapt the avisynth script to your needs. Open it and read through it, modify it so it works with your file. It is really no "one click solution"....Well, actually, there should be, *in this case*. My file is a plain vanilla progressive XviD avi, already cropped, mod16, yadda yadda. XviD is installed. x264 is there as well (if that's used). I don't need to worry about audio, resizing, combing or anything at all other than modifying path names to point to it.
If the input is better handled as mpeg2 or something else, I can easily convert it ahead of time.
videoFred
20th May 2012, 10:39
how do you even open a script in Avisynth?
This is not the thread to discuss this. Learn the Avisynth basics first and then come back here. ;)
Fred.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.