Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd September 2015, 21:10   #21  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,695
Quote:
Originally Posted by Bruce/Fl View Post
How much (length) of a sample would be best? Taking file size into consideration. The sample scan they sent me was approximately 10 minutes. I would assume you would only need 10, 15 seconds worth?
5-10 seconds, preferably something with motion (i.e., static shots of a building are not as useful as something where people are walking or cars are driving by, etc.).
johnmeyer is online now   Reply With Quote
Old 3rd September 2015, 22:24   #22  |  Link
Bruce/Fl
Registered User
 
Join Date: Aug 2015
Posts: 96
This should be about 6 seconds of my sample. Here is the link. I used Vegas, rendered it as .m2ts

https://www.dropbox.com/s/wpgso9p8aw...load.m2ts?dl=0
Bruce/Fl is offline   Reply With Quote
Old 3rd September 2015, 23:30   #23  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,695
Wow, that is really grainy. As a result, any attempt to use VideoFred's script will result in a fine mess because his scripts do quite a bit of sharpening. Sharpening grain, even after "degraining" is going to produce bad results. In fact, this is one of the main things that drove me to create my version of his script. If you click on the link below, you can see my post in his original film restoration thread -- complete with several images -- that shows the problems his original script created with my grainy footage:

The power of Avisynth: restoring old 8mm films

Also, when you actually do the work, make sure to work with the original MOV. This sample you uploaded has been recompressed using the Sony AVC codec, and there are a lot of additional artifacts added to the grain.

Finally, if this clip really accurately represents the original (i.e., you didn't screw up when you rendered it), then you need to decimate half the frames before you do any degraining. This is because the frames are all duplicated, and the degraining will choke when it sees zero motion between half of the frames.

Here is the script I just used on your clip. I frameserved it from Vegas, which is what I always do in order to avoid having to figure out how to read dozens of different formats into AVISynth. I let Vegas do that job because uses professional codecs that seldom glitch or fail. Note the "selecteven()" statement in the first line. This gets rid of every other frame, thus eliminating all the duplicates. The Assumefps statement gets you back to the correct playback speed.

So, you will need to replace the AVISource() statement with whatever you have found works for getting your MOV files into AVISynth. As I remember from our PMs last week, you did figure that out and got it working.

Hopefully other people will provide some additional ideas. I'm sure they will be glad to critique my work

Code:
source=AVISource("e:\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)
johnmeyer is online now   Reply With Quote
Old 4th September 2015, 00:44   #24  |  Link
Bruce/Fl
Registered User
 
Join Date: Aug 2015
Posts: 96
Quote:
Originally Posted by johnmeyer View Post
This sample you uploaded has been recompressed using the Sony AVC codec, and there are a lot of additional artifacts added to the grain.
Does anyone here know if Vegas can trim a .mov clip losslessly, or if not, what is the best option for rendering a .mov file? I tried the quicktime 7 (.mov) options, but even to my eye they looked very splotchy. (<---- ya, my word)

Or possibly some other program? I'd love for these samples I'm uploading to be simply shorter versions with the same quality as what I received.

Thank you,

Bruce
Bruce/Fl is offline   Reply With Quote
Old 4th September 2015, 01:34   #25  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,695
Use Mediainfo or similar tool to find out what codec is used by the MOV file. Vegas may give this to you if your right-click on the media and select "properties."

In general, Vegas does not "smart render" (a.k.a., lossless cuts) most video. It can smart render DV AVI and some forms of MPEG-2, but that's about it.

Having said that, if the version of ProRes (I think that's what you said this is) does not do interframe compression, Vegas may well be able to render it losslessly.

It is easy to tell: just start the render and watch the preview screen in Vegas while rendering. If the video is not being re-rendered, the display will show "no compression needed."

Did my script work for you?
johnmeyer is online now   Reply With Quote
Old 4th September 2015, 03:51   #26  |  Link
Bruce/Fl
Registered User
 
Join Date: Aug 2015
Posts: 96
Quote:
Originally Posted by johnmeyer View Post
Use Mediainfo or similar tool to find out what codec is used by the MOV file. Vegas may give this to you if your right-click on the media and select "properties."

In general, Vegas does not "smart render" (a.k.a., lossless cuts) most video. It can smart render DV AVI and some forms of MPEG-2, but that's about it.

Having said that, if the version of ProRes (I think that's what you said this is) does not do interframe compression, Vegas may well be able to render it losslessly.

It is easy to tell: just start the render and watch the preview screen in Vegas while rendering. If the video is not being re-rendered, the display will show "no compression needed."

Did my script work for you?
No, it said "Avisynth open failure, there is no function named "MSuper" "

I also linked it to a .avi render I did, so that it would work with what you gave me as written.

Attached are the media info screen caps from the original .mov and also my AVC render, just because.

Quote:
Originally Posted by johnmeyer View Post
This is because the frames are all duplicated, and the degraining will choke when it sees zero motion between half of the frames.
I was curious about this, after reading your explanation about how the degraining process worked, when I suspected that I did have duplicate frames. The reason I suspected that was, when I was trying to find the first frame of a scene in Vegas, using the frame advance button, it always seemed like I needed to click it twice to see any change in the image.
Attached Images
  
Bruce/Fl is offline   Reply With Quote
Old 4th September 2015, 04:44   #27  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,695
Quote:
Originally Posted by Bruce/Fl View Post
No, it said "Avisynth open failure, there is no function named "MSuper" "
You have to put the MVTools2 DLL in your AVISynth plugins folder.
johnmeyer is online now   Reply With Quote
Old 4th September 2015, 05:16   #28  |  Link
Bruce/Fl
Registered User
 
Join Date: Aug 2015
Posts: 96
Quote:
Originally Posted by johnmeyer View Post
You have to put the MVTools2 DLL in your AVISynth plugins folder.
It is now in there, now it says: "MSuper: Clip must be YV12 or YUY2

Attached is the media info on the avi. It's huge, it's 4:2:2 and it says it's lossless.

I can probably uplaod it if you'd like to see it, better quality than the m2ts maybe?
Attached Images
 
Bruce/Fl is offline   Reply With Quote
Old 4th September 2015, 05:54   #29  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Bruce/Fl,

You can just copy and paste MediaInfo text into post, click 'Go Advanced', and then select text and click on the Hash symbol above the post entry box, it can take a long time for attachments to clear approval.

You can see what colorspace Avisynth thinks clip is by pasting

Code:
Return Info.ConvertToRGB32
immediately after the line that loads the clip.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 4th September 2015, 07:36   #30  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
And here's some help for cutting down that huge source file.
raffriff42 is offline   Reply With Quote
Old 4th September 2015, 16:33   #31  |  Link
Bruce/Fl
Registered User
 
Join Date: Aug 2015
Posts: 96
Quote:
Originally Posted by raffriff42 View Post
And here's some help for cutting down that huge source file.
That worked great, thank you so much for that.

Now I'll upload a few seconds of the original, for anyone wanting to see it un-reencoded.

Bruce
Bruce/Fl is offline   Reply With Quote
Old 4th September 2015, 16:43   #32  |  Link
Bruce/Fl
Registered User
 
Join Date: Aug 2015
Posts: 96
Here is a sample in the original format, .mov


https://www.dropbox.com/s/2xk8v5r36e...8mm_1.mov?dl=0
Bruce/Fl is offline   Reply With Quote
Old 4th September 2015, 16:56   #33  |  Link
Bruce/Fl
Registered User
 
Join Date: Aug 2015
Posts: 96
Quote:
Originally Posted by StainlessS View Post
Bruce/Fl,

You can see what colorspace Avisynth thinks clip is by pasting

Code:
Return Info.ConvertToRGB32
immediately after the line that loads the clip.
I added it. Now it says, "I don't know what "info" means"

And just to be sure there are no mistakes I've made, here is what I have writtin:

Code:
source=AVISource("C:\Users\Bruce\Desktop\upload.avi").selecteven()
Return Info.ConvertToRGB32
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)
Bruce/Fl is offline   Reply With Quote
Old 4th September 2015, 17:21   #34  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Quote:
Originally Posted by Bruce/Fl View Post
It is now in there, now it says: "MSuper: Clip must be YV12 or YUY2
Avisynth is telling you that MSuper requires YV12 or YUY2 colorspace. How to fix this? By changing color space from the input of cource.

Change your first line like this:
Code:
source=AVISource("C:\Users\Bruce\Desktop\upload.avi").selecteven().converttoYV12()
Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest
videoFred is offline   Reply With Quote
Old 4th September 2015, 17:47   #35  |  Link
Bruce/Fl
Registered User
 
Join Date: Aug 2015
Posts: 96
Quote:
Originally Posted by videoFred View Post
Avisynth is telling you that MSuper requires YV12 or YUY2 colorspace. How to fix this? By changing color space from the input of cource.

Change your first line like this:
Code:
source=AVISource("C:\Users\Bruce\Desktop\upload.avi").selecteven().converttoYV12()
Fred.
Thanks Fred, that got rid of the trouble boxes, and I have an image in virtualdub now. A very large image, but an image, and it moves, slowly.

Unfortunately I have to run now, but will return to this later today and see what I can do/see.

Again, thanks all.

Bruce
Bruce/Fl is offline   Reply With Quote
Old 4th September 2015, 19:08   #36  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
Based on my experiences, you definitely want to preclean the clip you analyse motion from if the amount of noise or grain is extreme. I'd try FFT3DFilter or some of those NLMeans-type denoisers.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 4th September 2015, 23:17   #37  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by Bruce/Fl View Post
I added it. Now it says, "I don't know what "info" means"

And just to be sure there are no mistakes I've made, here is what I have writtin:

Code:
source=AVISource("C:\Users\Bruce\Desktop\upload.avi").selecteven()
Return Info.ConvertToRGB32
Arh, OK, you assigned clip to source variable, so I should have posted:
Code:
return source.info.ConvertToRGB32
instead.
I assumed that you have not assigned to any named variable and so would have been assigned to the special 'implied' Last clip variable.

What I originally posted was equivalent to this:
Code:
AVISource("C:\Users\Bruce\Desktop\upload.avi").selecteven()  # Implied assignment to special Last variable.
return Last.info.ConvertToRGB32
# return info.ConvertToRGB32              # EDIT: Or use implied Last without explicit naming
JFYI.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 5th September 2015 at 02:52.
StainlessS is offline   Reply With Quote
Old 5th September 2015, 04:09   #38  |  Link
mawen1250
Registered User
 
Join Date: Aug 2011
Posts: 103
About thSAD, from what I have read before(just a glance at the mvtools code):
It actually affacts the denoising strength of MDegrain, since MDegrain weighted average the matched blocks, and the weighting is calculated from SAD and thSAD. Thus, a higher thSAD results in dissimilar blocks to have larger weight, and it can increase denoising strength as well as introduce more blending artifacts.
As for MCompensate based denoising, thSAD might just be a threshold to determine bad matches.
mawen1250 is offline   Reply With Quote
Old 5th September 2015, 04:33   #39  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Code:
inline float DegrainWeight(double thSAD, double blockSAD) {
    if (blockSAD >= thSAD)
        return 0.f;

    return float((thSAD - blockSAD) * (thSAD + blockSAD) * 256 / (thSAD * thSAD + blockSAD * blockSAD));
}
Quote:
if (blockSAD >= thSAD)
return 0.f;
threshold

weight = 256 * (thSAD^2 - blockSAD^2) / (thSAD^2 + blockSAD^2)
you got thSAD at both multiplication and division part, who knows what will happen to the weight if you increase it, not doing a monotonicity determination of "y = (x^2 - a)/(x^2 + a)" here
feisty2 is offline   Reply With Quote
Old 5th September 2015, 05:06   #40  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
well... I just did it anyways, cuz that's just some 15 years old simple math
turns out "y' = 4ax / (x^2 + a)^2", and y' always > 0
so, guess mawen1250's right, you increase the weight by increasing thSAD

EDIT:
but that doesn't really matter, you know, it's an "x/x^4" kinda thing... it grows really, really, really, slow, yeah, you know what I mean....

Last edited by feisty2; 5th September 2015 at 05:18.
feisty2 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:56.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.