#101  
10-15-2016, 06:19 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,311 Times in 984 Posts
Quote:
Originally Posted by koberulz View Post
Not sure if it's just my imagination, but there does seem to be more detail when I have -30 and 280 there than when I have 0 and 255.
There in;t more detail, there are just brighter darks. I don't think you applied the -30 or 280 values to 1stHalf.avi because those values don't exist in that video.



Even if lower and higher values did exist, the coded statement "Levels(-30,0.7,280,16,235)" wouldn't brighten anything. All it would do is compress existing values into a more narrow low midrange:



You might have used that Levels statement on the far brighter 2ndHalf.avi, but you would just be making tough work for yourself if you used it on the darker video.


Attached Images
File Type: png Fist Half - oiginal values.png (530.7 KB, 47 downloads)
File Type: jpg First Half -30 low 280 high.jpg (27.9 KB, 47 downloads)
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #102  
10-15-2016, 11:12 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,311 Times in 984 Posts
The coection image you posted earlier from 1stHalf.avi is a decent workable effort, even if it doesn't look as if it resulted from the Levels code posted earlier:

Quote:
Originally Posted by koberulz View Post
The image is certainly and improvement. I'd suggest that the background bleechers appear to be covered by a subtle orange haze, and contrast overall is low with no clean blacks in the image.

I had similar results straight from Avisynth, but I used this code:
Code:
ColorYUV(gain_y=120,cont_y=30,gamma_y=20,off_v=3)
SmoothTweak(saturation=3.0)
SmoothLevels(16, 1.0, 255, 16, 235,protect =6)


The code resulted in a rd haze in the darks and reddish blacks. So after some Virtualdub tweaks with two gradation curve, the darker bleachers look more detailed (even though they aren't) by throwing a little more contrast into black levels with the curves filters, which I exaggerated slightly here to show the effect.:



Any way you look at it, it's still pretty awful but you're correct to do what you can with what you have. I don't think recapturing this video would help -- color is wiped out in the original, so a brighter capture won't help.

Attached is my own YV12 Lagarith correction. Some of the noise is tamed, but underexposure will get you little more than noise and ghosting when brightened.


Attached Images
File Type: jpg First Half - gain controls.jpg (44.7 KB, 47 downloads)
File Type: png First HAlf - VirtualDub Tweaks.png (900.7 KB, 47 downloads)
Attached Files
File Type: avi First_00A.avi (40.71 MB, 2 downloads)
Reply With Quote
  #103  
10-16-2016, 01:22 AM
koberulz koberulz is offline
Premium Member
 
Join Date: Feb 2016
Location: Perth, Australia
Posts: 470
Thanked 3 Times in 2 Posts
The levels I mentioned earlier was for the second half, not the first half.

That capture for the first half was done through an AVT-8710 with brightness all the way up. A capture through the TBC-1000 was even darker.

For the first half:
Code:
ColorYUV(cont_v=300,cont_u=800,gain_y=70,off_v=3,off_u=-3)
Levels(35,1.5,210,16,235,coring=false, dither=true)
SmoothLevels(16, 1.0,255,16,255,protect=4)
AssumeTFF().QTGMC(Preset="medium", EZDenoise=3,denoiser="dfttest")
FluxSmoothT()
SmoothUV()
LimitedSharpenFaster()
AddGrainC(1,1)
AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
What does SmoothLevels actually do? I just have that sitting there from when we were working on the other game a while back, and you had that in your script.

EDIT: Going back over your second "Studio" script, you've got "RemoveSpotsMC().RemoveSpotsMC3()". I'm getting an error citing no function named RemoveSpotsMC3.

I still don't really understand the difference between RemoveSpots, RemoveSpotsMC, RemoveSpotsMC2x either, in terms of what happens visually or what visual issues each is best for or whatever.

EDIT 2: I like the color of the court better on my version, but you've got the jerseys to stand out a bit more. Yours also looks quite a bit noisier to me. I'm not really too fussed about the crowd as long as what's on-court looks...I was going to say 'good', but that's probably not the right word under the circumstances.

In VDub, I ran hue/saturation/intensity with hue -14, sat 0.84, intensity 1.09, then ran it again for cyan and blue with saturation 0.63. Gradation curves moving the bottom left corner up a bit, and Camcorder Color Denoise at 30.

Last edited by koberulz; 10-16-2016 at 01:42 AM.
Reply With Quote
  #104  
10-16-2016, 11:12 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,311 Times in 984 Posts
Quote:
Originally Posted by koberulz View Post
What does SmoothLevels actually do?
A more advanced version of "Levels", it applies stronger dithering that seems to produce a smoother transition between the darks and brights that it works on. It's one of several functions in SmoothADjust, which has more than 20 paragraphs explaining its settings. XP version and ReadMe documentation attached, for all versions of Windows. Later versions are for 64-bit WIn7/8/10.. I never found a link for the source code. Some complain that the author doesn't bother to clarify some obscure features, which is probably why many people use only selected parts of the filter and ignore others. Most use it as a smoother-looking version of Avisynth's v2.6 "Levels". SmoothAdjust2.62-XP.zip. Original discussion thread, http://forum.doom9.org/showthread.php?t=154971.

Quote:
Originally Posted by koberulz View Post
EDIT: Going back over your second "Studio" script, you've got "RemoveSpotsMC().RemoveSpotsMC3()". I'm getting an error citing no function named RemoveSpotsMC3.
That's because the RemoveSpotsMC avs plugin has no RemoveSpotsMC3 function. It's found in RemoveSpotsMC5, which you don't have and don't need. It's overkill, destroys details, and crashes if you try to use it like RemoveSpotsMC. Stick with RenoveSpotsMC2x in RemoveSpotsMC.avsi.

Quote:
Originally Posted by koberulz View Post
I still don't really understand the difference between RemoveSpots, RemoveSpotsMC, RemoveSpotsMC2x either, in terms of what happens visually or what visual issues each is best for or whatever.
Motion compensation (MC to you, or motion analysis) is used to make RemoveSpots more effective during shots with motion involved. The visual issues it's designed for are spots, comets, horizontal rips and tears, and many forms of scratches -- all of which are classed as defects known as dropouts or loss of signal in areas of the frame.

In the image below from post #44, there are two horizontal dropouts: a horizontal "rip" across the man's jacket and another short, thin black line in the upper right that passeds thru the edges of the logo. There are many such dropouts in that capture and others.



If you don't know what these bad guys look like or if they don't matter, don't use RemoveSpots, RemoveSpotsMC, DeSpot, DeVCR, or any such plugin, they will just be confusing.

Quote:
Originally Posted by koberulz View Post
EDIT 2: I like the color of the court better on my version, but you've got the jerseys to stand out a bit more. Yours also looks quite a bit noisier to me. I'm not really too fussed about the crowd as long as what's on-court looks...I was going to say 'good', but that's probably not the right word under the circumstances.

In VDub, I ran hue/saturation/intensity with hue -14, sat 0.84, intensity 1.09, then ran it again for cyan and blue with saturation 0.63. Gradation curves moving the bottom left corner up a bit, and Camcorder Color Denoise at 30.
Those are all effective techniques, and of course color balance is a personal preference and up to the user. It's a shame the original recording is such a mess, but there's only so much one can do with any available tool, even very expensive or sophisticated ones. For the YV12 avi I posted, I didn't use QTGMC or Hue/saturation/intensity, only dfttest alone and then gradation curves and Levels in VirtuaDub. I figured you would apply more adjustments than I did anyway and this was mostly a gain_y sample for ColorYUV. As for denoising, there's too little detail for extensive or aggressive denoising without ending up with a plastic look and losing more definition. Ghosting during motion is too dmaging already in that video, besides other problems.


Attached Files
File Type: zip SmoothAdjust2.62-XP.zip (361.9 KB, 3 downloads)

Last edited by sanlyn; 10-16-2016 at 11:24 AM.
Reply With Quote
  #105  
10-16-2016, 02:21 PM
koberulz koberulz is offline
Premium Member
 
Join Date: Feb 2016
Location: Perth, Australia
Posts: 470
Thanked 3 Times in 2 Posts
Quote:
Originally Posted by sanlyn View Post
A more advanced version of "Levels", it applies stronger dithering that seems to produce a smoother transition between the darks and brights that it works on.
What are you actually doing with it, though? Gamma's still 1, input and output are the same...and why is it now 16-255 instead of 16-235? I'm still not entirely sure I understand the 'protect' thing either.

Quote:
That's because the RemoveSpotsMC avs plugin has no RemoveSpotsMC3 function. It's found in RemoveSpotsMC5, which you don't have and don't need. It's overkill, destroys details, and crashes if you try to use it like RemoveSpotsMC. Stick with RenoveSpotsMC2x in RemoveSpotsMC.avsi.
So what would I use in place of MC5 in your sample script? Just leave that off entirely, since it's also running RemoveSpots, or add something else?

Motion compensation (MC to you, or motion analysis) is used to make RemoveSpots more effective during shots with motion involved. The visual issues it's designed for are spots, comets, horizontal rips and tears, and many forms of scratches -- all of which are classed as defects known as dropouts or loss of signal in areas of the frame.

Quote:
If you don't know what these bad guys look like or if they don't matter, don't use RemoveSpots, RemoveSpotsMC, DeSpot, DeVCR, or any such plugin, they will just be confusing.
Yay, more options!

I still don't really understand which to use when. If I've got footage with those sorts of issues...I assume there's more to it than just randomly picking one of those plugins.

EDIT: VDub crashed again. "out-of-bounds memory access (access violation) occurred in module 'ntdll'...writing address [bunch of zeroes]...while stopping filter "Color Tools [1.4]" (FilterInstance.cpp:1214)."
Reply With Quote
  #106  
10-16-2016, 05:53 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,311 Times in 984 Posts
Quote:
Originally Posted by koberulz View Post
What does SmoothLevels actually do? I just have that sitting there from when we were working on the other game a while back, and you had that in your script.
No, that line isn't my code. It's yours, posted here:

Quote:
Originally Posted by koberulz View Post
For the first half:
Code:
ColorYUV(cont_v=300,cont_u=800,gain_y=70,off_v=3,off_u=-3)
Levels(35,1.5,210,16,235,coring=false, dither=true)
SmoothLevels(16, 1.0,255,16,255,protect=4)
My code was different, posted here:
Quote:
Originally Posted by sanlyn View Post
Code:
ColorYUV(gain_y=120,cont_y=30,gamma_y=20,off_v=3)
SmoothTweak(saturation=3.0)
SmoothLevels(16, 1.0, 255, 16, 235,protect =6)
My SmoothLevels line is dithering the output to smooth gaps between luma and chroma values that were stretched and compressed by gain and saturation, as well as taming the y=255 brights by intetpolating them down gradually to y=235. What your version of the line is doing is dithering or smoothing output from the previous filters, which won't hurt but is unnecessary because you have already used the regular "Levels" filter and activated its own dithering. You're using versions of two filters designed to have the same or similar functionality.

quote=koberulz;46069]What are you actually doing with it, though? Gamma's still 1, input and output are the same...and why is it now 16-255 instead of 16-235? I'm still not entirely sure I understand the 'protect' thing either.[/quote]The two versions as posted above. and they are not identical, as a I've shown. You're definitely unsure about them, as evidenced by using both of them together in succession in your own script for no apparent reason.

The logic behind the "protect" parameter is in the documentation below, where I placed the explanation for "protect" in bold and quote a general description of the SMoothadjust plugin package. This documentation was attached to the SmoothAdjust plugin that was posted.

Code:
 I. DESCRIPTION :
 ================
  SmoothAdjust is a set of 5 plugins to make YUV adjustements:
   - SmoothLevels allows to change levels & gamma with optional limiting
   - SmoothTweak  allows to change brightness, contrast, saturation & hue
   - SmoothCurve  allows to change a plane according to a fixed curve
   - SmoothCustom allows to change a plane according to a custom expression
   - SmoothTools  allows to use all the previous filters in one single pass

  These 5 plugins have a smoothing & dithering algorithm to avoid banding issue.
  Calculations are made in 32bits float to avoid rounding errors and artifacts.
  SmoothAdjust is multithreaded (up to 64 threads) and optimized (SSE2/AVX).
......
......
......

 VIII. SMOOTHLEVELS - LIMITING SETTINGS :
 ========================================
......
......
    protect [default: -1]
    ---------------------
     -1  = protecting off
     >=0 = black zone protection
           ---> don't apply conversion on pixels egal or below this value 
                (ex: with 16, the black areas like borders 
                     and generic are untouched so they don't look washed out)
Quote:
Originally Posted by koberulz View Post
So what would I use in place of MC5 in your sample script? Just leave that off entirely, since it's also running RemoveSpots, or add something else?
Use any of the 3 RemoveSpots functions in RemovespotsMC.avsi. RemoveSpots() is the weaker function, but it doesn't harm fine detail very much. RemovespotsMC() is more effective for videos with motion. RemoveSpotsMC2x is the strongest of the three and required for fast motion. Use it the same way you saw it used in earlier scripts. An example was previously posted in "Script 3 (Optional)" near the bottom of post 71 at http://www.digitalfaq.com/forum/vide...html#post45935

Quote:
Originally Posted by koberulz View Post
I still don't really understand which to use when. If I've got footage with those sorts of issues...I assume there's more to it than just randomly picking one of those plugins.
This is the way most people do it when designing a script. Use one, and if it doesn't work, use the other. If neither of them work. use a third version if available. If none of them work, then (a) you're using the wrong filter for the job, or (b) the video is so bad nothi9ng will fix it, or (c) you should research to see if any other method is available for the specific problem. Meanwhile I can save you some trouble beforehand and advise that RemoveSpotsMC and RemoveSpotsMC2x are the functions to use to reduce the number of dropouts in action videos. Don't run these filters while a video is still interlaced. First, deinterlace or use SeparateFields.

Quote:
Originally Posted by koberulz View Post
EDIT: VDub crashed again. "out-of-bounds memory access (access violation) occurred in module 'ntdll'...writing address [bunch of zeroes]...while stopping filter "Color Tools [1.4]" (FilterInstance.cpp:1214)."
ntdll is a Vista systems file. Sounds as if you need to reboot and clear some memory.
Reply With Quote
  #107  
10-16-2016, 07:46 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,311 Times in 984 Posts
Great scot, I just re-read the previous post and was shocked at all my typo's. So why don'[t I see that junk before I hit Submit after reading it 5 or 6 times?

@koberules, everybody learns this stuff piecemeal. Years back a member started a thread on video restoration and repair but lasted barely four posts before everyone realized that a 6-volume book was the only way anyone would be able to cover the subject. Remember, some of us have been at this madness for quite a spell. They say you can tell by the weird look in our eyes. LOL!
Reply With Quote
  #108  
10-19-2016, 06:06 AM
koberulz koberulz is offline
Premium Member
 
Join Date: Feb 2016
Location: Perth, Australia
Posts: 470
Thanked 3 Times in 2 Posts
Quote:
Originally Posted by sanlyn View Post
You're using versions of two filters designed to have the same or similar functionality.
So SmoothLevels is used in place of Levels...when? What's the case for using one or the other (or SmoothTweak vs Tweak vs Tweak Color)?

Quote:
The logic behind the "protect" parameter is in the documentation below, where I placed the explanation for "protect" in bold and quote a general description of the SMoothadjust plugin package. This documentation was attached to the SmoothAdjust plugin that was posted.
I read that, it still didn't really click at the time. Occurred to me later on, though...if it's bringing the blacks closer to grey, it stops black borders from becoming greyer?

Quote:
RemovespotsMC() is more effective for videos with motion. RemoveSpotsMC2x is the strongest of the three and required for fast motion.
Okay, so I'm using this:
Code:
AVISource("..\Process\Studio_Intermediate.avi")
a = last
e = a.SelectEven().RemoveSpotsMC()
o = a.SelectOdd().RemoveSpotsMC()
Interleave(e,o)
#AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
x = last
y = AVISource("..\Process\Studio_Intermediate.avi")
return StackVertical(x,y)
But in VirtualDub, it does absolutely nothing except screw with the colors:
RemoveSpotsColors.jpg

Whereas in AvsPmod, I actually get some spot removal (with the same color issue):
You must be logged in to view this content; either login or register for the forum. The attached screen shots, before/after images, photos and graphics are created/posted for the benefit of site members. And you are invited to join our digital media community.


Using MC2x gets me the VirtualDub result in both VDub and AvsPmod.

It's the second of two scripts, so I ran QTGMC in the first script and left it deinterlaced, with the re-interlacing done in the second script after RemoveSpots(). Commented that line out so the frames would match for the StackVertical().

Quote:
@koberules, everybody learns this stuff piecemeal.
The biggest problem is the concern of patching a video up, and then weeks/months/years later finding out that some problems that remained could have been fixed, or problems that were fixed could have been fixed better. For example, I'd just assumed I was stuck with those dropouts. Which I might still be if RemoveSpots() insists on continuing to screw with me.


Reply With Quote
  #109  
10-19-2016, 08:04 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,311 Times in 984 Posts
Quote:
Originally Posted by koberulz View Post
So SmoothLevels is used in place of Levels...when? What's the case for using one or the other (or SmoothTweak vs Tweak vs Tweak Color)?
TweakColor and the newer version of Tweak have simlar functions. I think TweakColor is more precise with the hue ranges and looks smoother. Use the one you like.

Quote:
Originally Posted by koberulz View Post
if it's bringing the blacks closer to grey, it stops black borders from becoming greyer?
You don't have any superblacks (darker than y=16) because your capture card is clipping a y=16. I've been using SMoothLevels as well a Levels after using other filters that massage existing levels first (ColorYUV). Eitrher way, if you include black borders in the statement, Levels will make the video brighter than it should be at the dark end, so it looks washed out.

Quote:
Originally Posted by koberulz View Post
Okay, so I'm using this:
Code:
AVISource("..\Process\Studio_Intermediate.avi")
a = last
e = a.SelectEven().RemoveSpotsMC()
o = a.SelectOdd().RemoveSpotsMC()
Interleave(e,o)
#AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
x = last
y = AVISource("..\Process\Studio_Intermediate.avi")
return StackVertical(x,y)
But in VirtualDub, it does absolutely nothing except screw with the colors:
Attachment 6673

Whereas in AvsPmod, I actually get some spot removal (with the same color issue):
Attachment 6674

Using MC2x gets me the VirtualDub result in both VDub and AvsPmod.

It's the second of two scripts, so I ran QTGMC in the first script and left it deinterlaced, with the re-interlacing done in the second script after RemoveSpots(). Commented that line out so the frames would match for the StackVertical().
The pics don't look like the same processing stage to me, and I'm not sure what your two scripts are doing. How did you get your "Intermediate" again? Was Intermediate.avi the result of the first script, is that what you're saying?

Quote:
Originally Posted by koberulz View Post
The biggest problem is the concern of patching a video up, and then weeks/months/years later finding out that some problems that remained could have been fixed, or problems that were fixed could have been fixed better. For example, I'd just assumed I was stuck with those dropouts. Which I might still be if RemoveSpots() insists on continuing to screw with me.
All versions of RemoveSpots do some smoothing, even of chroma and can smooth some elements of color flicker, but they don't affect saturation and flicker the way your images show. The two sets of imagrs have different contrast levels, which I've not seen with RemoveSpots. You should show us what the first script is doing. Also, if you have filters mounted in VirtualDub, the results will be different. Again, U'm not using AvsPmod because I found no particular use for it, but many like it.

I still don't understand what's going on with the slow Vista machine. Your i7 CPU was benchmarked as only about 20% slower overall than my Intel i5 Ivy Bridge, so something else is wrong somewhere.
Reply With Quote
  #110  
10-19-2016, 08:18 AM
koberulz koberulz is offline
Premium Member
 
Join Date: Feb 2016
Location: Perth, Australia
Posts: 470
Thanked 3 Times in 2 Posts
Code:
AVISource("..\Captures\Capture Panasonic.avi")
Trim(1313,2147) ++ Trim(81511,82004) ++ Trim(152304,153380)
ConverttoYV12(matrix="rec601",interlaced=true)
ColorYUV(cont_v=-40)
AssumeTFF().QTGMC(preset="medium",Border=true,Ezdenoise=10.0,denoiser="dfttest",shownoise=false)
Dehalo_alpha()
StabMod()
FixChromaBleeding()
MergeChroma(MCTemporalDenoise(settings="very low"))
ChromaShift(C=10,L=-4)
MergeChroma(awarpsharp2(depth=30))
SmoothUV()
LimitedSharpenFaster(edgemode=2)
AddGrainC(2.0,2.5)
Reply With Quote
  #111  
10-19-2016, 11:31 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,311 Times in 984 Posts
Quote:
Originally Posted by koberulz View Post
Code:
AVISource("..\Captures\Capture Panasonic.avi")
Trim(1313,2147) ++ Trim(81511,82004) ++ Trim(152304,153380)
ConverttoYV12(matrix="rec601",interlaced=true)
ColorYUV(cont_v=-40)
AssumeTFF().QTGMC(preset="medium",Border=true,Ezdenoise=10.0,denoiser="dfttest",shownoise=false)
Dehalo_alpha()
StabMod()
FixChromaBleeding()
MergeChroma(MCTemporalDenoise(settings="very low"))
ChromaShift(C=10,L=-4)
MergeChroma(awarpsharp2(depth=30))
SmoothUV()
LimitedSharpenFaster(edgemode=2)
AddGrainC(2.0,2.5)
Thank you for the first script you used. "Very low" for MCTD won't stop the flicker, but I realize this is a demo only. I used the same script to get the attached Studio_intermediate.avi, but I omitted the Trim statement because I'm using the original Studio.avi submitted earlier and don't need to trim().

Code:
AviSource(path......+"Studio.avi")
ConverttoYV12(matrix="rec601",interlaced=true)
ColorYUV(cont_v=-40)
AssumeTFF().QTGMC(preset="medium",Border=true,Ezdenoise=10.0,denoiser="dfttest",shownoise=false)
Dehalo_alpha()
StabMod()
FixChromaBleeding()
MergeChroma(MCTemporalDenoise(settings="very low"))
ChromaShift(C=10,L=-4)
MergeChroma(awarpsharp2(depth=30))
SmoothUV()
LimitedSharpenFaster(edgemode=2)
AddGrainC(2.0,2.5)
The result is attached as Studio_intermediate.avi (losless Lagarith YV12, deinterlaced per the above script).

I used the script below which I copied from your own Script#2, but I used StackHorizontal to place the fames side by side for playback. Original on the right ("y"), RemoveSpotsMC version on the left6 ("X"). The comparison clip is attached as Studio_Intermediate2.mp4. Left and right look pretty similar to me. Although RemoveSpotsMC cleaned a little of it, that version of RemoveSpots isn't as strong as RemoveSpots2X and doesn't accomplish much here, but it doesn't do anything to the colors. The script:

Code:
AviSource(path.....+"Studio_Intermediate.avi")
a = last
e = a.SelectEven().RemoveSpotsMC()
o = a.SelectOdd().RemoveSpotsMC()
Interleave(e,o)
x = last
y = AviSource(path.....+"Studio_Intermediate.avi")
return StackHorizontal(x,y)
However, that's not the way I used any version of RemoveSpots. The scripts I posted show that the function was applied to re-interlaced video and used SeparateFields(), which breaks the frames and motion into smaller and dissimilar pieces. I also used RemoveSpots2X, shown below (attached as comparison clip Studio_Intermediate2X.mp4, interlaced), which looks slightly cleaner as far as dropouts go. The script I used:

Code:
AviSource(vidpath+"Studio_Intermediate.avi")
AssumeTFF()
SeparateFields().SelectEvery(4,0,3).Weave()
a = last
b = a.SeparateFields()
e = b.SelectEven().RemoveSpotsMC2x()
o = b.SelectOdd().RemoveSpotsMC2x()
Interleave(e,o).Weave()
x = last
y = a
return StackHorizontal(x,y)
Note that "y=a" in the above script refers to the re-interlaced version of the input. You might remember that the original filtered version of Studio.avi posted a while back used RemoveSpotsMC3, not RemoveSpots2x, and I even threw in RemoveSpotsMC for good measure (that was little much, too much softening). Considering all the damage in Studio.avi, RemoveSpots3 did more cleanup of dropouts. I ran another script on Studio_intermediate avi, this time using RmeoveSpots3. I also cleaned up the borders that were changed bv stabmod in Studio_intermediate.avi::

Code:
Import("D:\Avisynth 2.5\plugins\RemoveSpotsMC4.avs")
AviSource(path.....+"Studio_Intermediate.avi")
Crop(12,10,-18,-6).AddBorders(14,8,16,8)
AssumeTFF()
SeparateFields().SelectEvery(4,0,3).Weave()
a = last
b = a.SeparateFields()
e = b.SelectEven().RemoveSpotsMC3()
o = b.SelectOdd().RemoveSpotsMC3()
Interleave(e,o).Weave()
x = last
y = a
return StackHorizontal(x,y)
The side by side comparison in the attached Studio_intermediate3.mp4 shows the same color as on both sides of the comparison frames, with the left side cleaned up more than with the otehr versions of RemoveSpots.

I've also attached the avs script for RemoveSpots4, which contains five functions that called be called separately:
RemoveSpots
RemoveSpotsMC
RemoveSpotsMC2
RemoveSpotsMC3
RemoveSpotsMC4

It took all morning to clean up that original avs file so that all functions worked properly. RemoveSpotsMC4.avs is far more complicated than the versions in RemoveSpotsMC.avsi. Caution: RemoveSpotsMC3 is very slow and RemoveSpotsMC4 is even slower.

Also, you can write the code above:
Code:
SeparateFields().SelectEvery(4,0,3).Weave()
a = last
b = a.SeparateFields()
e = b.SelectEven().RemoveSpotsMC3()
o = b.SelectOdd().RemoveSpotsMC3()
Interleave(e,o).Weave()
x = last
with this structure, which means the same thing:
Code:
SeparateFields().SelectEvery(4,0,3).Weave()
a = last
e = a.SeparateFields().SelectEven().RemoveSpotsMC3()
o = a.SeparateFields().SelectOdd().RemoveSpotsMC3()
Interleave(e,o).Weave()
x = last
But the lower version would be a little slower because it performs SeparateFields twice.


Attached Files
File Type: avi Studio_Intermediate.avi (21.75 MB, 1 downloads)
File Type: mp4 Studio_Intermediate2X.mp4 (1.05 MB, 2 downloads)
File Type: mp4 Studio_Intermediate3.mp4 (869.3 KB, 1 downloads)
File Type: avs RemoveSpotsMC4.avs (29.0 KB, 4 downloads)

Last edited by sanlyn; 10-19-2016 at 12:29 PM.
Reply With Quote
  #112  
10-19-2016, 12:42 PM
koberulz koberulz is offline
Premium Member
 
Join Date: Feb 2016
Location: Perth, Australia
Posts: 470
Thanked 3 Times in 2 Posts
What's the difference between running RemoveSpots() before reinterlacing and running it after reinterlacing and separating fields?

Do I need to do anything special with the two version of RemoveSpots(), or can they both sit in the plugins folder?
Reply With Quote
  #113  
10-19-2016, 04:29 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,311 Times in 984 Posts
Must be one of those days. Multitasking: not my thing. Quoting myself, from earlier:

Quote:
Originally Posted by sanlyn View Post
I used the script below which I copied from your own Script#2, but I used StackHorizontal to place the fames side by side for playback. Original on the right ("y"), RemoveSpotsMC version on the left6 ("X"). The comparison clip is attached as Studio_Intermediate2.mp4. Left and right look pretty similar to me. Although RemoveSpotsMC cleaned a little of it, that version of RemoveSpots isn't as strong as RemoveSpots2X and doesn't accomplish much here, but it doesn't do anything to the colors. The script:

Code:
AviSource(path.....+"Studio_Intermediate.avi")
a = last
e = a.SelectEven().RemoveSpotsMC()
o = a.SelectOdd().RemoveSpotsMC()
Interleave(e,o)
x = last
y = AviSource(path.....+"Studio_Intermediate.avi")
return StackHorizontal(x,y)
And then I forgot to attach Studio_Intermediate2.mp4 !!
Attached herewith.


Attached Files
File Type: mp4 Studio_Intermediate2.mp4 (1.04 MB, 1 downloads)
Reply With Quote
  #114  
10-20-2016, 05:49 AM
koberulz koberulz is offline
Premium Member
 
Join Date: Feb 2016
Location: Perth, Australia
Posts: 470
Thanked 3 Times in 2 Posts
Not sure if you missed this post while sorting that out:
Quote:
Originally Posted by koberulz View Post
What's the difference between running RemoveSpots() before reinterlacing and running it after reinterlacing and separating fields?

Do I need to do anything special with the two version of RemoveSpots(), or can they both sit in the plugins folder?
Reply With Quote
  #115  
10-20-2016, 09:17 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,311 Times in 984 Posts
Quote:
Originally Posted by koberulz View Post
What's the difference between running RemoveSpots() before reinterlacing and running it after reinterlacing and separating fields?
As noted earlier:
Quote:
Originally Posted by sanlyn View Post
The scripts I posted show that the function was applied to re-interlaced video and used SeparateFields(), which breaks the frames and motion into smaller and dissimilar pieces.
Meaning that if you look at the pattern of those dropouts streaks and rips in VirtualDub frame by frame, you'll see that some streaks stretch over multiple fields, some over multiple frames, some are thicker and some thinner. A temporal filter like RemoveSpots/RemoveDirt is based on time, that is, on the way images change over multiple fields or frames. How the filter decides what is noise and what isn't is known to the filter authors rather than to us mere mortals. But if noise remains the same and in the same place over multiple consecutive instants, the filter doesn't recognize it as noise. Breaking the motion into smaller and more disparate pieces makes the noise pattern look more intermittent and thus is more easily recognized as noise. Then again, a filter might be more effective with things like horizontal dropouts because a dropout that looks four pixels thick in a full frame may be only 2 pixels thick in one field but physically lower in one field and higher in another -- or in one field the dropout could thin out to 2 pixels in a slightly different position later. In this case it's an effort to break certain noise patterns into smaller, less distinct pieces. What I did was to observe a few frames using one method and observe the same frames using another method. You don't have to review an entire video to see what's happening with noise patterns.

Also many of these filters work faster on half-sized fields (SeparateFields) than on full-sized frames (full-frame deinterlaced). Some filters work best with real deinterlace (such as dfttest and chroma cleaners), others work just as well using SeparateFields. It take some experimentation while learning what certain filters do and don't do. MCTemporalDenoise, when used for chroma cleaning to reduce flicker from oversaturation, seems to me to be more effective with deinterlaced frames. I suppose people who can read the filter's source code could tell us why in greater detail.

Users tend to build up a small battery of frequently used filters and soon learn their quirks with different kinds of problems. You don't have to know about every filter in the world -- none of would live long enough for that, anyway.

Quote:
Originally Posted by koberulz View Post
Do I need to do anything special with the two version of RemoveSpots(), or can they both sit in the plugins folder?
You can keep both of the plugins as .avsi files in your plugins folder. I have 3 versions of RemoveSpots scripts in my plugins, all kept as .avs files and imported explicitly, but that's just my choice because the 3rd version, RemoveSpots5, has never worked properly (I just just get rid of it). Here is a table of the two plugins as .avsi files and the internal function you can casll from each:

Code:
RemoveSpotsmC.avsi    RemoveSpotsMC4.avsi
------------------    -------------------
RemoveSpots           RemoveSpots
RemoveSpotsMC         RemoveSpotsMC
RemoveSpotsMC2x       RemoveSpotsMC2
                      RemoveSpotsMC3
                      RemoveSpotsMC4
You can see that two internal functions have identical names in both .avsi's. It doesn't matter which of those identical functions Avisynth decides to call, because they both are coded alike. No problem. The functions that don't have identical names operate differently internally, which is why the plugin designers gave them different names. in RemoveSpotsMC4, the #2, #3, and #4 functions internally invoke additional coded routines and work more slowly. They do more work, so it depends on how slow you want to run, how much you want cleaned, and how much fine detail you're willing to sacrifice. I found that RemoveSpots2X was good enough for some of the clips, but clips like Studio.avi had drastic dropout problems that needed RemoveSpotsMC3 for better cleaning. RemoveSpotsMC4 was slower overkill with no appreciable improvement.

Note that any RemoveSpots function can sometimes obscure very fine lines or remove spots that aren't really spots (using them in a rainy or water sports scene can have strange results, with lots of water removed! I hate that). Sometimes you have to try another filter such as dfttest or RemoveDirt, or just live with some noise.
Reply With Quote
  #116  
10-20-2016, 11:39 AM
koberulz koberulz is offline
Premium Member
 
Join Date: Feb 2016
Location: Perth, Australia
Posts: 470
Thanked 3 Times in 2 Posts
Right, but what does SeparateFields() do that QTGMC() isn't doing? They seem like the same thing. Obviously I'm missing something.
Reply With Quote
  #117  
10-20-2016, 02:16 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,311 Times in 984 Posts
You should ask the question in reverse: what QTGMC does that SeparateFields doesn't do. By now you know the difference between deinterlacing (reforming two separated half-field scanlines into two full-sized frames) and SeparateFields (using alternating scanlines as half-height video images with no interpolation or resizing into full-sized frames). If you'd rather use the same slow RemoveSpots filter on 1152 horizontal scanlines in 2 full-sized reinterpolated frames instead of 576 horizontal scanlines in two separated but unaltered image fields, it's up to you. You can run any of the scripts shown so far, including your own, using QTGMC or using SeparateFields, and check the results. Cleanup will look similar, but not quite the same.

With SeparateFields, the even lines begin at scanline 0, odd lines begin at scanline 1 (one line lower). Each new half-sized "frame" of even lines begins scanline 0. But the odd fields, in order to populate 288 lines in the new separated "frame", have one black line of pixels added at the top, so that the odd-line image has data beginning at line 2. A speck of noise in even-lined fields will be 1 scanline higher than in the odd-lined fields -- thus, the noise in the even fields is in a different position than in the odd fields. Further, a line of noise in even fields may be 1/4 line shorter in the odd fields or might not even appear in some alternate fields.

Remember that an interlaced frame has two images. When you see a line of black or white dropout pixels in an interlaced frame, that line of dropout might only be in one of the fields, with the other field clean. Or the line of dropout might be 3 pixels high with only one line of dropout pixels in the even field and the other two dropout lines in the odd field. And again, a line of dropout in the odd field of one frame might be different in the even field of the next frame.

And yet again, when a time and motion based intepolator like QTGMC starts rearranging data to make separate half-height fields into full frames, some noise such as dropouts can be carried over into subsequent frames, so that dropout won't look the same in all frames. Some advanced users who get really picky will perform some "prep" noise reduction before using QTGMC to prevent this carryover of artifacts. It's not always safe to do so, but you can try it using SeparateFields, then reweave the fields into interlaced frames before using QTGMC for other problems such as smoothing line shimmer and aliasing.

As an experiment I looked at the original studio,avi and the same clip processed as Studio_intermediate.avi, which is what you get after running QTGMC on Studio.avi. I noted that the thick horizontal dropout in frames 23 and 24 (or 4 interlaced fields) of Studio.avi appeared in 5 fields of the intermediate avi after QTGMC, and when reinterlaced that dropout and a remnant appeared in frames 23, 24, and 25 of the reintelaced video. So it becomes obvious that motion compensated filters like QTGMC, MCTD, etc., etc., can indeed create their own problems (you decide what's more important in any particular video, some subtle interpolation errors and less than perfect cleanup, or no cleanup at all). These interpolations don't occur with SeparateFields.

So, with my experiment I first ran RemoveSpotsMC3 on Studio.avi using SeparateFields, then reweaved the clip and ran the rest of the script on it including the QTGMC line. It took 15 minutes at less than 0.3 fps on my machine, so be prepared to sit for a good spell waiting for it on yours. The results look like those of previous running methods but took far longer, mainly because RemoveSpotsMC3 had a lot more original noise to contend with, which took forever.
Reply With Quote
  #118  
10-20-2016, 03:46 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,311 Times in 984 Posts
Oops, here there I go again. Quoting myself:

Quote:
Originally Posted by sanlyn View Post
With SeparateFields, the even lines begin at scanline 0, odd lines begin at scanline 1 (one line lower). Each new half-sized "frame" of even lines begins scanline 0. But the odd fields, in order to populate 288 lines in the new separated "frame", have one black line of pixels added at the top, so that the odd-line image has data beginning at line 2.
Nope, the first odd line begins at line 1 in the SeparateFields view. I guess 2 cups of coffee weren't enough. I'd better upgrade to 3 cups.
Reply With Quote
  #119  
10-21-2016, 02:11 AM
koberulz koberulz is offline
Premium Member
 
Join Date: Feb 2016
Location: Perth, Australia
Posts: 470
Thanked 3 Times in 2 Posts
I'll go through that in more detail later, but quick question: can I split out the MergeChroma(MCTemporalDenoise(settings="very high") line? ie have a script that goes up to the line before that, create the AVI, then run the MCTemporalDenoise on that AVI to create a third AVI, then use MergeChroma("thirdavi.avi")? Would that have the same effect? That line seems to be the point at which my computer decides flailing its arms in the air and storming off is its only option; I'm thinking separating it out like that might help.
Reply With Quote
  #120  
10-21-2016, 04:59 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,311 Times in 984 Posts
Of course you can split your processing. That's been discussed since post #71 and earlier.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Panasonic VCR won't take tape? bluewater Video Hardware Repair 5 12-19-2014 11:56 PM
Code Colours in Dreamweaver naimeiiz Web Development, Design 1 07-24-2013 10:19 AM
How to copy DV tape to new DV tape with audio removed? via Email or PM Edit Video, Audio 1 09-13-2012 05:55 PM
Capture Dark/Bright Flickering godsfshrmn Capture, Record, Transfer 5 01-06-2010 11:32 AM
VHS tape malfunction, mechanism not rolling tape properly admin Capture, Record, Transfer 0 10-12-2009 10:57 PM

Thread Tools



 
All times are GMT -5. The time now is 09:30 PM