Log in

View Full Version : Degraining is going well, add more to the script? Stabilization, or other?


Bruce/Fl
12th October 2015, 07:43
Hello all,

Once again, a big thank you to all who helped me a month or so ago. The degraining script you put together for me does what I had hoped it would.

I showed my sister the finished product of the script you all helped me with on the sample transfer I had done, and got the go ahead to get the rest done and she thinks its very much worth the expense. So, I sent in the majority of the old movies I have to be done as well. They should be done soon.

Now that I have a handle on some degraining, I was wondering if there was another process that would enhance my transfers once I get them. I think I read on here (although I could be wrong) advice stating that to get the most out of the degraining you should first stabilize the image first. Is that correct?

If so, is there a similar, in terms of simplicity/not too complicated, scripting that does some stabilizing that I could add to what I have? Here is what I have been using for degraining only (in conjunction with Vegas and a frame server)

source=AVISource("C:\Users\Bruce\Desktop\fs.avi").selecteven()
super = MSuper(source,pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(source,super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=1400)
final=assumefps(15/1.001)
return final
#stackhorizontal (source,final)

The thread is here http://forum.doom9.org/showthread.php?t=172553

So, would stabilizing it some before the degraining be the way to go? (I'm guessing that even if I am not remembering right, and there is no direct correlation between stabilizing and improved degraining results, stabilizing by itself would be a good thing regardless, right?) If not, is there some other rudimentary script I could/should be running to improve the amateur shot home movies I have? I have dug around the internet some, showing my wife what is possible with this scripting, showed her some of VideoFreds Vimeo samples, and John Meyers Youtubes and I am still awed and amazed. This is really some incredible stuff.

Thank you again,

Bruce

creaothceann
17th October 2015, 15:51
From my (amateur) understanding grain was added after the destabilization already happened, so it should be worked on first. But you should try it out both ways and see what looks better to you.

johnmeyer
18th October 2015, 04:22
I think I read on here (although I could be wrong) advice stating that to get the most out of the degraining you should first stabilize the image first. Is that correct?Sort of. To make temporal degraining (i.e., using the difference between frames to remove noise) more effective, you want to move all the pixels in the two adjacent frames so that they are in the same location as the pixels in the current frame. If this could be done perfectly, the only remaining differences would be the random noise, which could then be removed.

The script you posted does exactly that, so doing stabilization prior to denoising won't do anything that you aren't already doing.

hello_hello
18th October 2015, 10:05
I haven't read the other thread, but it'd be worth keeping QTGMC (http://forum.doom9.org/showthread.php?t=156028) in mind. For progressive video (when it's running in progressive mode) QTGMC does a good job of stabilising and also removing noise.

For stabilisation using the default settings:
QTGMC(InputType=1)

That'll remove light noise anyway, but for extra noise removal enable EzDegrain and adjust it as need be.

QTGMC(InputType=1, EzDegrain=1.5)

There's some small sample encodes here (http://forum.videohelp.com/threads/358043-A-comparison-of-AVIsynth-denoise-filters?p=2283228&viewfull=1#post2283228) from when I first started playing around with QTGMC for denoising.

Bruce/Fl
17th November 2015, 11:35
John, hello-hello,

I got tied up the past few weeks and couldn't break away to work on my transfers.

Looks like I will be able to now some though.

A quick question. After looking at the films my father shot (hand held 8mm, no tripod) and seeing the results I've seen online, Videofreds come to mind, I'd like to take a stab at stabilizing (might not be the right word in this context) them some. And by that I mean reducing to some extent the inherent shakiness due to the camera being hand held. I assume it is done by trimming the various outer edges of the film to a small degree to eliminate the movements some, and understanding that large movements will just have to be lived with mostly, the only option being trimming so much to buffer them that you aren't left with much in the middle of the image.

So I'm looking to run it through a script that will do that, smooth out some of the smaller shakes, and lessen as much as is prudent of the bigger ones.

I remember seeing someone post about "deshaker", but then in a reply videofred said he recommended "depanestimate/stabilize".

Or would this QTGMC be a better route to get me there? Or possibly something not even mentioned?

I took a simple depan script I found over at VideoHelp, and tried to insert it into the working degraining script I have already, but of course it has issues. (I put it in after the beginning "source =" command line, and before the degraining section, that is what made the most sense to me. But of course I could be way off on that) I won't post what I am trying with that here yet until I see if I am on the right track in selecting an appropriate script.

Thank you

hello_hello
17th November 2015, 14:08
I doubt QTGMC would help with camera shakiness, but I've not had any experience with that. I was referring to "stabilising" in respect to repairing bad de-interlacing or noisy video or excessive compression etc, but reducing shakiness due to camera movement is a totally different thing.

Bruce/Fl
17th November 2015, 16:27
I doubt QTGMC would help with camera shakiness, but I've not had any experience with that. I was referring to "stabilising" in respect to repairing bad de-interlacing or noisy video or excessive compression etc, but reducing shakiness due to camera movement is a totally different thing.

Thank you for the reply, this is the kind of insight and information I need. Now hopefully somebody will be able to let me know if "depan" is the program I need, or something similar.

johnmeyer
17th November 2015, 20:40
QTGMC has absolutely nothing to do with motion stabilization and is completely the wrong thing to use. It is primarily for deinterlacing (something you most certainly do not need to do with film) and also has denoising features.

Depan does have a stabilization mode, and VideoFred's script uses that to remove film gate weave, and also reduce some of the shakiness from using a hand-held film camera.

A more complete and versatile motion stabilization program is Deshaker. You can Google my name and Deshaker and find a guide I wrote a decade ago for using the program to stabilize video (and film) footage. The original site that hosted the guide has closed, but the guide got copied all over the place, so you should be able to find it somewhere.

StainlessS
17th November 2015, 20:55
You can Google my name and Deshaker and find a guide

here is one of them:- http://vegas.digitalmedianet.com/article/A-Guide-to-Using-DeShaker-28849


And another by Gunnar Thalin (deshaker author):- http://www.guthspot.se/video/deshaker.htm

johnmeyer
18th November 2015, 00:31
Thanks for the link. The reason I didn't provide one is that many of the places that stole, er, copied the article never bothered to include all the nice links I created. Those really help people who don't want to read the whole thing and instead simply skip to the sections that interest them. They also lost all the pictures. Those were pretty important.

Bruce/Fl
18th November 2015, 09:04
Thank you John, SS.

I read through it here at work. A few off the cuff questions for you. I can't download the program here at work to see what options there are in the various dropdowns, for instance it is geared towards DV, it mentions 720 x 480, so they may be answered once I get home in front of my own PC. I may see something closer to my raw material, which I believe is right around 1440 x 1080

You mentioned and recommended a few different codecs, and also not using one, although it makes for huge files. Since the article seemed to be directed towards DV camera users, and I am using HD quality scans from a Rank Cintel, should I go uncompressed? The output will be .avi, regardless if I use a codec or not though, correct?

So my workflow should be:
do the 2 pass deshaker,
then Vegas for tweaks and edits then rendered out to a frame server,
then the avisynth script and back into Vegas,
and render out to what I need it for (What we have already discussed, the best render settings for BD and DVD, or other, ie possibly memory stick)

Do I have that right?

Thank you

johnmeyer
18th November 2015, 17:08
Deshaker works with HD.

Motenai Yoda
18th November 2015, 19:24
I use
rx = 8
cutoff = 1.0
stab = 6.0
trust = 2.0
stab_reference = removegrain(4,-1,-1).mt_edge(mode="min/max",U=-128,V=-128).RequestLinear(rlim = 10, clim = 10)
data = depanestimate(stab_reference, trust=trust, dxmax=rx,dymax=rx,stab=stab,zoommax=1.0)
DePanStabilize(cutoff=cutoff,data=data,dxmax=rx,dymax=rx,zoommax=1.0,rotmax=0.0,mirror=15,blur=30,method=1,subpixel=2)
somewhere I read using autogain for reference can help

foxyshadis
19th November 2015, 01:38
Has anyone ever done a comparison of deshaker, depan, and mvdepan? I have a few things I'd like to correct the gate weave on (Blu-rays of Blade Runner and The Prisoner especially), it'd be nice to not have to do a lot of tests with each. If they're all basically equivalent, that's fine too.

Motenai Yoda
19th November 2015, 15:51
I think maybe deshaker, I'm not sure what gate weave should be, something like rolling shutter?

foxyshadis
19th November 2015, 20:59
Gate weave is when the film doesn't perfectly line up each frame in the projector or scanner, so it moves a bit compared to the last; it's most noticeable on still shots and slow pans. The picture isn't damaged like rolling shutter. A pixel or three of gate weave is pretty much universal for pre-digital movies, but sometimes they shake enough to be very distracting.

I was wondering about the others partly because I'd rather not convert to RGB if possible.

johnmeyer
20th November 2015, 05:15
I have used Mercalli, Deshaker, and Depan for removing gate weave. I have not done any formal comparison testing, but all three worked well.

The key thing is to turn down the settings that you would normally use for camera shake. By using small settings, you stop the algorithms from making unneeded corrections. I use my version of VideoFred's restoration script for all my film transfers, and the settings in that script are way too much if all you want to do is get rid of the weave. In my version of the script, the default is 20/20 horizontal/vertical. For gate weave-only corrections, I reduce these to 5/5, or less. Also, for each set of film, you might want to take a few minutes to look at the nature of the weave. The weave is introduced both in the camera and also in the projector, but both devices typically have more vertical than horizontal movement because the film is violently starting and stopping in the vertical direction. Therefore, you might get slightly better results using a stronger correction in the vertical than horizontal direction.

Having said that, I actually haven't done any tests to prove out this theory.