#21  
09-23-2017, 04:52 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
Thanks for posting a chunk of the original.

Quote:
Originally Posted by ragu0012 View Post
Here is my first good crack at it.
Not a bad first crack. Many newcomers don't even get that far! I think you can see that some things take getting used to. With a little practice you tend to refine what you get.

Quote:
Originally Posted by ragu0012 View Post
-Color corrected best i could in colormill while looking at histograms in color tools.
That's the way to do it. Then tweak what your eyes tell you. In particular, look for color casts in objects that should be neutral, like whites and blacks. One thing is essential: levels and color alike dictate that you use a calibrated monitor. Work in subdued light and don't stare at images for too long -- your brain automatically makes "corrections". Turn away for a while and come back, Things will look different.

Quote:
Originally Posted by ragu0012 View Post
-I still see color noise in red wall mats
Understandable, as red is a low-frequency color and has low-frequency noise to match. The mat looks grainy, but I'll suggest a way around that later. But avoid the temptation to remove 100% of all noise. A lot of the "detail" in analog in really noise. Remove all of it and you'll have a rather "raw", denuded video. I don't think you could smooth out all of the shifting darker noise patterns in the red background. It appears to be 'moving" and was recorded that way, and it seems light is reflecting according to the camera angle and movement. Any more denoising and it'll just be a raw red blob with no detail.

Quote:
Originally Posted by ragu0012 View Post
I'm still unclear how to reinterlace before outputting my final file. I don't need to output twice do i?
You used SelectEven(), which discarded alternate fields, so there's nothing to reinterlace. In this case the original interlacing isn't very neat and looks badly aliased, especially on diagonals - that's a major fault with many consumer cameras, analog and digital alike, and it's infuriating. The noise calms after deinterlacing, then returns when re-interlaced. Anti-aliasing filters hardly make a difference. Here's a bit of tech: the camera doesn't interlace, it just records fields at 59.94 images per second. Play that video thru your camera into a TV and the aliasing and other noise isn't so obvious, especially since the camera was designed for CRT days. VCR playback is really interlaced, but the original edges don't match up correctly so you get aliasing and line twitter. A capture device that deinterlaces at double frame rate could smooth that, but the devices themselves give a buggy and poorly interpolated deinterlaced image.

Since you're going square-pixel anyway, you can't use that for DVD. In many cases (like this one) you'll see better results with a good deinterlacer (like QTGMC) and either discard alternate fields to get 29.97 fps or keep all frames and get 59.94 fps. Unfortunately many players don't handle double frame rate that well, especially if the original was interlaced to begin with. You lose a little temporal resolution in action videos by discarding the odd frames and keeping 29.97 fps, but that's better than gross aliasing and noisy motion. For DVD, you can still encode at 29.97 progressive (but it won't work for BluRay).

If you wanted interlaced video, you couldn't use SelectEven or SelectOdd. You have to keep all the fields. The last thing you would do after all your processing is reinterlace, as follows:

Code:
AssumeTFF()
QTGMC (whatever settings)
.... processing ...
.... processing ...
SeparateFields().SelectEvery(4,0,3).Weave()
Here's a look at parts of your posted scripts. Hopefully I can give you some some helpful pointers:

ConvertToYUY2 # script below this line requires YUY2. Colorspace changes require that you specify if the video is interlaced, lest you smear chroma channels. The statement should read "ConvertToYUY2(interlaced=true)". This has been mentioned by lordsmurf, especially here: http://www.digitalfaq.com/forum/vide...html#post50800. In this case your sample is already YUY2 to begin with, so the statement does nothing.

Cnr2("xoo",4,2,64) # remove chroma banding noise, wide UV setting. cnr2 won't remove banding noise and does little for chroma noise. It's very old tech, actually, and most would now use something else including CamcorderColorDenoise. Later in this post I'll show other suggestions.

ChromaShift(C=2, L=-8) # align chroma over luma. I'm confused by this one. "L=-8" shifts chroma pixels upward by 8 pixels. Are you sure you want this? I see no need for it in your sample. I see in your redo1hat lifting chrom causes red background to bleed upward into the wall. Otherwise chroma is also shifted 2 to 4 pixels left in the original, so shifting it to the right with "C=2" makes sense.

QTGMC(Preset="Slow") might be overkill for this video in terms of noise reduction, which appears to smear some facial contours and other details when combined with santiag(strh=2,strv=2). I think you'll find that these two together are overdone with this sample, especially since I don't see aliasing after the video is deintelaced, as explained earlier. In any case, if you had re-interlaced later the alaising would return. Any minor aliasing in the original fields is usuully pretty well cleaned up by QTGMC's slow setting.

AwarpSharp(depth=10). I can suggest a better general sharpener later, especially one that doesn't bend edges (which is where its name comes from) or make edge halos worse.

Sharpen(0.5). Again, there are cleaner sharpeners, especially since your original sample already has sharpening halos. Sharpen() has its uses, but it's a rather primitive filter.

The two images below will show what's happening with the wrong sharpeners and how they exacerbate edge halos and distortion in the original. The image below on the left-hand side shows edge halos in redo1.avi, and on the right-hand side how the halos were mostly removed in the attached "redo2" mp4. Halos are in the original capture from the player and are difficult to address entirely without destroying more detail.



ColorYUV(off_y=6, gain_y=-12) # lighten gamma. This doesn't lighten gamma. It raises darks too much and shrinks gamma and brights toward the dark end.

ColorYUV(cont_u=-60, cont_v=-160) # increase saturation. No, negative contrast reduces saturation. This is one reason why your redo1 has pale colors and skin tones.

Levels(0,1.000,250,2,255,true). This prouduces brights that exceed y=235. Not what you want.

### Typical VHS overscan crop
Crop(20,2,-16,-6) # use both lines
AddBorders(18, 4, 18, 4) # use both lines

Sometimes it's better to crop before resizing. See the script and images below. The upper image is frame 120 from the redo1 avi. The core image inside the borders is 604x472 without the thick borders. That image is an aspect ratio of 1.28:1, which is more narrow than 1.3333:1. It's likely your camera wasn't recording exactly 4:3 anyway, but the image here seems just a little squeezed horizontally.



The image below used different cropping, before resizing. The borders were cropped as before, but borders were added to make the frame size 704x480, with thinner side borders, then resized. The core image below is 622x472 without borders (aspect ratio 1.32:1).



The wider core image comes from the fact that NTSC and PAL SMPTE standards use only 704x480 of the 720x480 frame with 4:3 source material. Cameras and Players differ from this standard somewhat, more or less, so you never can tell what the final dimensions will look like until you see the video played or captured by different devices.

ConvertToYUY2 # assumes VirtualDub or MPEG encoder is next in video workflow chain
The "ConvertTo" colorspace functions assume progressive video, so your statement is oK here. However, if you're going to use VirtualDub RGB filters after this script, why go back to YUY2? Why not convert to RBG at this point? If you were going straight to the MPEG or h.264 encoder, note that MPEG and h.264 are YV12, and your video is already YV12.

The attached basketball_redo2.mp4 is the result of the script I used, below.

Code:
Import("drive:\path\to\Avisynth 2,.5\plugins\FixChromaBleeding.avs")
Import("drive:\path\to\Avisynth 2,.5\plugins\LimitedSharpenFaster.avs")

Avisource("Drive:\path\to\test basketball.avi")

Tweak(cont=1.15,dither=true,coring=false)
Levels(16,1.0,255,16,235,dither=true,coring=false)
AssumeTFF()
SeparateFields()
FixVHSOversharp(20,16,12)  #<- reduce dark and bright right-edge halos
FixVHSOversharpL(20,12,8)  #<- reduce and bright left-edge halos
Weave()

ConvertToYV12(interlaced=true)
QTGMC(preset="fast",border=true,EZDEnoise=2,denoiser="dfttest",ChromaNoise=true)
SelectEven()
ChromaSHift(c=2,L=-2)
FixChromaBleeding()
MergeChroma(aWarpSharp2(depth=20))
DeHalo_Alpha(rx=2)         #<- another step at dark and bright edge halos

# ---- crop uneven borders and bottom noise, add new borders for 704x480 -----
Crop(20,0,-16,-8).AddBorders(10,4,10,4)
Spline36resize(640,480)
LimitedSharpenFaster()

# ---- RGB for VirtualDub filters ------
ConvertToRGB32(interlaced=false,matrix="Rec601")
return last
The VirtuaDub filters that were loaded while running the above script:
- CamcorderColorDenoise
- temporalsmoother (setting=3)
- ColorMill
- Hue/Saturation/Intensity (Donald Graft)
- gradation curves

Everyone has their own idea of color balance. I this case I used ColorMill's Hue settings to undo the green color cast and greenish skin tones from florescent lighting in the original. The rest was tweaked with gradation curves and Donald Graft's Hue-Saturation-Intensity filter (a copy of this .vdf filter is attached as HueSatInt_vdf.zip). CamcorderColorDenoise and a mild built-in temporal smoother were added.

The VirtualDub filters and settings I used can be loaded using the attached Basketball_vcf.vcf file. A .vcf is a text file that you can edit (if you know what you're doing!). Start Virtualdub and clikc "File" -> "load processing settings...", locate the .vcf file and click OK. The .,vcf will load the filters I mentioned in the same order and with the settings I used. You must have all the named filters in your VDub plugins folder. Note that loading a .vcf file will overwrite any filters already loaded.

The general sharpener used was avisynth's LimitedSharpenFaster plugin. I activated chroma noise filtering with QTGMC's ChromaNoise and EZDenoise paramters and added CamcorderColorDenoise while running the script in VirtualDub.

I've also attached Avisynth plugins.zip containing the following:
- Avisynth's FixVHSOversharp, with docs.
- Avisynth's LimitedSharpenFaster, with docs.
- Avisynth's older MaskTools v1.5.1, used by LimitedSharpenFaster. The filter uses both the old v.1 and newer v.2 versions of MaskTools. You can have the old and new MaskTools .dll's in your AVisynth plugins folder at the same time. They have different file names, and internally they have different function names, so there won't be a conflict.

Everyone has a different approach to processing, depending on the source. The more projecfts you see, the more tops you'll pick up. Hope this post has been helpful.


Attached Images
File Type: jpg oversharp edge halos.jpg (70.6 KB, 244 downloads)
File Type: jpg frame 120 redo1.jpg (93.1 KB, 247 downloads)
File Type: jpg Frame 120 redo2.jpg (74.6 KB, 243 downloads)
Attached Files
File Type: mp4 basketball_redo2.mp4 (4.20 MB, 12 downloads)
File Type: zip HueSatInt_vdf.zip (7.4 KB, 12 downloads)
File Type: vcf basketball_vcf.vcf (3.9 KB, 7 downloads)
File Type: zip Avisynth plugins.zip (136.6 KB, 17 downloads)

Last edited by sanlyn; 09-23-2017 at 05:09 PM.
Reply With Quote
The following users thank sanlyn for this useful post: lordsmurf (09-24-2017), ragu0012 (09-23-2017)
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #22  
09-24-2017, 04:39 AM
themaster1 themaster1 is offline
Free Member
 
Join Date: Feb 2011
Location: France
Posts: 497
Thanked 99 Times in 83 Posts
the picture is too dull too me (unrealistic), lacks colors

i was never a fan of fixcolorbleeding, and once again, i found i was right after i tried it
and it seems chromashift should be applied before qtgmc

anyway, this the result i get:



Attached Images
File Type: jpg basketball-themaster1.jpg (35.6 KB, 8 downloads)
File Type: jpg basketball2-themaster1.jpg (34.3 KB, 241 downloads)

Last edited by themaster1; 09-24-2017 at 05:11 AM.
Reply With Quote
The following users thank themaster1 for this useful post: ragu0012 (09-24-2017)
  #23  
09-24-2017, 07:30 AM
ragu0012 ragu0012 is offline
Free Member
 
Join Date: May 2017
Posts: 94
Thanked 6 Times in 4 Posts
Quote:
Originally Posted by themaster1 View Post
the picture is too dull too me (unrealistic), lacks colors

i was never a fan of fixcolorbleeding, and once again, i found i was right after i tried it
and it seems chromashift should be applied before qtgmc
Could you post the script you used? I would like to play around and see how the different approaches led to different results

-- merged --

sanlyn, Thank you sooooo much for this detailed explanation. This is epic! I was going through all of these lines in your script and trying to figure out all the nuances of the plugins in your approach.

Quote:
Originally Posted by sanlyn View Post
In this case the original interlacing isn't very neat and looks badly aliased, especially on diagonals - that's a major fault with many consumer cameras, analog and digital alike, and it's infuriating. The noise calms after deinterlacing, then returns when re-interlaced.

Since you're going square-pixel anyway, you can't use that for DVD. In many cases (like this one) you'll see better results with a good deinterlacer (like QTGMC) and either discard alternate fields to get 29.97 fps or keep all frames and get 59.94 fps.
For some videos I am looking for two outputs -- a file I can play on my TV by pulling onto my TiVo with PyTivo, and an upload to Vimeo. So I was planning on leaving the first option interlaced, then the second file deinterlaced for Vimeo upload. But are you saying the quality for this particular video would be better to deinterlace for both options?

Quote:
Originally Posted by sanlyn View Post
ChromaShift(C=2, L=-8) # align chroma over luma. I'm confused by this one. "L=-8" shifts chroma pixels upward by 8 pixels. Are you sure you want this? I see no need for it in your sample. I see in your redo1hat lifting chrom causes red background to bleed upward into the wall. Otherwise chroma is also shifted 2 to 4 pixels left in the original, so shifting it to the right with "C=2" makes sense.
Yes! thank you I was confused by the settings and couldn't figure out when the color from the baseball cap was floating above his head.

For the LimitedSharpenFaster, I removed the i in avsi so it would load, which is what I assume you did right? Could you briefly explain why you use the Import command instead of using autoload?

Do I need to use the AssumeTFF() multiple times in a script (such as additionally during reinterlace) or does it remember throughout the script if I use it toward the top like you did?
Reply With Quote
  #24  
09-24-2017, 08:43 AM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,503
Thanked 2,449 Times in 2,081 Posts
sanlyn, those are my (# text) remarks from the MultiScript, and do what the say ... for the tapes where tested. Remember, I'm not done with it, still an alpha, and what's currently in the forum isn't my latest one. Usage like this, used with other scripts, shows where it needs to be refined or explained more in depth.

The primary problem is that the values were not changed from the defaults. That's understandable, ragu is learning.

Otherwise, great explanations.

If you can think of any refining for comments, additions to make to the MultiScript, I'll be glad to look at it, probably incorporate it. That's the whole goal of the project.

For me to learn from other Avisynth-savvy users was also an intended side effect. We all have tricks. I wanted to gather them into a single place, not have them strewn all over the place on different sites and forums. If for no other reason that my own sanity as a user!

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
  #25  
09-24-2017, 09:29 AM
ragu0012 ragu0012 is offline
Free Member
 
Join Date: May 2017
Posts: 94
Thanked 6 Times in 4 Posts
And I will say the multiscript is very helpful to me in my learning phase, figuring out what certain filters do and how to put together a script. Part of what I need to develop is my "eye" for seeing what exactly is wrong first... so I know the best way to fix it. For example, i knew the chroma was shifted incorrectly but I didn't think to change the default value because i wasn't thinking "that looks about 8 pixels too high."

You guys can "see the matrix" if you get the reference.

Quote:
Originally Posted by lordsmurf View Post
sanlyn, those are my (# text) remarks from the MultiScript, and do what the say ... for the tapes where tested. Remember, I'm not done with it, still an alpha, and what's currently in the forum isn't my latest one. Usage like this, used with other scripts, shows where it needs to be refined or explained more in depth.

The primary problem is that the values were not changed from the defaults. That's understandable, ragu is learning.

Otherwise, great explanations.

If you can think of any refining for comments, additions to make to the MultiScript, I'll be glad to look at it, probably incorporate it. That's the whole goal of the project.

For me to learn from other Avisynth-savvy users was also an intended side effect. We all have tricks. I wanted to gather them into a single place, not have them strewn all over the place on different sites and forums. If for no other reason that my own sanity as a user!
Reply With Quote
  #26  
09-24-2017, 09:51 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
Quote:
Originally Posted by ragu0012 View Post
For some videos I am looking for two outputs -- a file I can play on my TV by pulling onto my TiVo with PyTivo, and an upload to Vimeo. So I was planning on leaving the first option interlaced, then the second file deinterlaced for Vimeo upload. But are you saying the quality for this particular video would be better to deinterlace for both options?
Normally people keep interlaced vieo interlaced, except for the intermediate cleanup when required. Interlaced motion is smoother and more fluid. But there are circumstances where bad interlace just won't look so good. Vimeo can play interlaced and telecined as well as anamorphic formats. The trouble starts when you trust playback to smart TV's from USB sticks. A lot of so-called smart tv's are pretty stupid when it comes to interlace, telecine, and anamorphic frames. If USB playback thru a smart TV is your goal, be aware that many formats work well, while some won't work at all. As for vimeo and media servers, I've not seen any complaints.

This particular camera had an intelace problem. I ran a second script that was like the one I posted but with interlace restored before encoding. Thanks to QTGMC's cleanup the interlaced version looked cleaner than the original but there was still occasional aliasing on motion. Filters like santiag solved part of the problem, but not entirely -- it's just the nature of bad interlacing. It would look cleaner on a TV, not so clean on a PC.

Most of the time you can make an interlaced version for distribution on disc, and then deinterlace that version for a progressive, square-pixel version if you need one or for web mounting. That second deinterlace comes from the same lossless and filtered working file you used for your interlaced version. To prevent overfiltering you can use QTGMC at the "super fast" preset which does very little unwanted processing.

If you go the progressive/discarded fields route for DVD it will work, even if motion isn't quite as smooth. But you can't use square-pixel for DVD. If you want a standard def BluRay, it has to be interlaced.

Quote:
Originally Posted by ragu0012 View Post
For the LimitedSharpenFaster, I removed the i in avsi so it would load, which is what I assume you did right? Could you briefly explain why you use the Import command instead of using autoload?
LimitedSharpenFaster is an old standby and still very popular, but it has a new version called LSFmod.avsi used as standalone and as support files for other complex plugins such as MCTemporalDenoise. The two versions of the sharpener are so similar as to cause conflicts if you keep both as .avsi files, so I keep LimitedSharpenFaster as .avs and import it manually.

Quote:
Originally Posted by ragu0012 View Post
Do I need to use the AssumeTFF() multiple times in a script (such as additionally during reinterlace) or does it remember throughout the script if I use it toward the top like you did?
You need TFF only once. BFF is Avisynth's default so isn't always needed.

Use AssumeTFF() as a separate statement. People found that if you state it as part of a compound statement, such as in this way:

Code:
AssumeTFF().QTGMC()
or as:
[code]AssumeTFF().SeparateFields()

Avisynth gets silly and assumes TFF applies only to that one statement but doesn't become universally understood for other operations that require field priority. Frankly, a lot of people just type AssumeTFF() or AssumeBFF() as many times as they want. But I have seen samples where the field order was accidentally reversed (and, yes, it sure plays like a nightmare, especially if telecined) or encoded incorrectly, so changing the field order requires explicit statements both ways. Fortunately you likely won't encounter that problem.
Reply With Quote
  #27  
09-24-2017, 04:22 PM
themaster1 themaster1 is offline
Free Member
 
Join Date: Feb 2011
Location: France
Posts: 497
Thanked 99 Times in 83 Posts
Quote:
Originally Posted by ragu0012 View Post
Could you post the script you used? I would like to play around and see how the different approaches led to different results
I have uploaded it for you, feel free to fine tune it (especially colors imo) see below

Code:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.6\plugins\FixVHSOversharp2_5\FixVHSOversharp2_5.dll")
import("C:\Program Files (x86)\AviSynth 2.6\plugins\RGBAdapt_auto_white_balance2.avs")
#LoadPlugin("C:\Program Files (x86)\AviSynth 2.6\plugins\autolevels\autolevels_0.6_20110109.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.6\plugins\AutoAdjust-v2.60\x86\AutoAdjust.dll")
#LoadPlugin("C:\Program Files (x86)\AviSynth 2.6\plugins\chromashift27\ChromaShift.dll")
#import("C:\Program Files (x86)\AviSynth 2.6\plugins\FixChromaBleeding.avs")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.6\plugins\awarpsharp_2\awarpsharp2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.6\plugins\unsharpHQ_v04.dll")
#import("C:\Program Files (x86)\AviSynth 2.6\plugins\DeHalo_alpha.avsi")
import("C:\Program Files (x86)\AviSynth 2.6\plugins\FastLineDarken_1.3.avs")
#LoadPlugin("C:\Program Files (x86)\AviSynth 2.6\plugins\variableblur\variableblur.dll")
#############################
SetMemoryMax(4096)
SetMTMode(3,4)
AVISource("M:\05-montage\test basketball.avi")
assumetff()
########## Fix chroma misplacement  (relative to luma), not temporally accurate  like autochromafix (but it's very slow)
SetMTMode(2,4)
separatefields()
A=Last
B=A.Greyscale()
Overlay(B,A,X=2,Y=-2,Mode="Chroma") # changer juste valeurs Y ou X
weave()
converttoyv12(interlaced=true)
#### Fix chroma bleeding ######
clip1=last
o=last
separatefields()
warp1=o.mergechroma(o.blur(1.0).unsharpHQ().aWarpSharp(depth=8.0, thresh=0.75, blurlevel=3, cm=1))
warp2=o.mergechroma(warp1.blur(1.0).unsharpHQ().aWarpSharp(depth=8.0, thresh=0.75, blurlevel=2, cm=1))
weave()
# interleave(o,warp1,warp2)  #  visualization
warp2
clip2=last
YtoUV( clip1.UtoY(), clip2.VtoY(), clip2 )# On prend U sur le clip1 , V et Y sur le clip2

#converttoyv12(interlaced=true)
####################
#SetMTMode(2,4)
#converttoyv12(interlaced=false)
#MergeChroma(aWarpSharp2(depth=20))

#### deinterlacing + denoising(dfttest)
QTGMC(preset="fast",border=true,EZDEnoise=2,denoiser="dfttest",ChromaNoise=true,edithreads=4)
SelectEven()

######  Fix some oversharp  
main=last
main
FastLineDarken(luma_cap=28,thinning=90)
# Mergeluma + awarpsharp : pas forcément nécéssaire , c'est juste un plus, ne pas en abuser
mergeluma(aWarpSharp(depth=2, thresh=0.6, blurlevel=1, cm=1))

filtered=last
main
mt_edge().mt_expand
mymask=last
mt_merge(main, filtered, mymask)
##### fix chroma temporal noise  (frame to frame with removespotmc unlike CCD does...)
U = UtoY().RemoveSpotsMC()  #.dfttest (sigma=4, sigma2=4, tbsize=5).RemoveDirtMC
V = VtoY().RemoveSpotsMC() #.dfttest (sigma=4, sigma2=4, tbsize=5).RemoveDirtMC
YtoUV(U, V, last)

########  colors & levels ######
AutoAdjust(auto_gain=true,gain_mode=0,chroma_process=100,avg_safety=1.00,scd_threshold=0,input_tv=false,output_tv=false,dark_limit=9.50,bright_limit=1.50,gamma_limit =2.0,dark_exclude=0.0,temporal_radius=20,high_quality=true,high_bitdepth=false)

RGBAdapt_auto_awb(show_info=false,comparison=false,linear_gamma_mix=1.0,gamma= 2.2)
tweak(hue=-24.8,coring=false)

########## Vdub filters: colors & sharpen in RGB #################
ConverttoRGB32(matrix="rec601",interlaced=false)
SetMTMode(3,2)
#### CCD COLOR DENOISING :
LoadVirtualDubPlugin("C:\Program Files (x86)\virtualdubmod1.5\plugins\Camcorder_Color_Denoise_sse2.vdf", "CCD", 0)
CCD(11,0) #
LoadVirtualDubPlugin("C:\Program Files (x86)\VirtualDub\plugins\gradation1.46b.vdf", "gcurves", 0)
gcurves(1,"101112121314151516171818191a1b1b1c1d1e1e1f202121222324242526272728292a2a2b2c2d2d2e2f30303132333334353636373839393a3b3c3c3d3e3f3f404143444647494a4b4d4e505152545557585a5b5c5e5f616264656668696b6c6d6f707273757677797a7c7d7f808183848687888a8b8d8e90919292939494959696979898999a9a9b9c9c9d9e9e9fa0a0a1a2a2a3a4a4a5a6a6a7a8a8a9a9aaababacadadaeafafb0b1b1b2b3b3b4b5b5b6b7b7b8b9b9babbbbbcbdbdbebfbfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff","15122220502020202001040407991c0c0ffff0000ffff0000ffff0000ffff0000ffff")
LoadVirtualDubPlugin("C:\Program Files (x86)\VirtualDub\plugins\rgbeq.vdf", "rgbeq", 0)
# 5 sliders were used for hue, sat
rgbeq("20G2020G2020G2020G2020G2020G2014G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2j20G200tG2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G201DG2020G2020G2020G2020G2020G2020G2020G2020G2020G2000H4H00G4100G4100G4100G4100G4100G4100G4100H4H00G4100H4H00G0J000W0")
LoadVirtualDubPlugin("C:\Program Files (x86)\VirtualDub\plugins\msu_sharpen.vdf", "msu_sharpen", 0)
msu_sharpen(0) # 0 (small overall) to 5 (mad)  optional
converttoyv12(matrix="Rec601",interlaced=false)


############ ANALYSE #######################
#ColorYUV(analyze=true)
#UtoY() # analyse U
#VtoY() # analyse V
#Histogram("levels") # Avec Slider  pour HISTOGRAMME
#Histogram(mode="luma") # mode lumière (npe)
#HistogramRGBParade()
#HistogramRGBLevels
#HistogramCMYLevels(range=true)
#ConverttoYUY2(interlaced=true) # pour VIDEOSCOPE
#VideoScope("both", true, "Y") # pour niveaux lumière
#VideoScope("side", true, "UV") # pour niveaux couleurs
#VideoScope("both",true, "U", "V", "UV")
# Analyse YUV:
#Y = GreyScale()
#U = UtoY()
#V = VtoY()
#StackHorizontal(Y, StackVertical(U,V))


Attached Files
File Type: avs test basketball-qtgmc-filtres_vdub.avs (7.4 KB, 11 downloads)
Reply With Quote
The following users thank themaster1 for this useful post: lordsmurf (09-25-2017), ragu0012 (09-27-2017)
  #28  
09-25-2017, 03:00 AM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,503
Thanked 2,449 Times in 2,081 Posts
@ragu: Note the above script imports VirtualDub plugins, so the path is needed.

Some MT memory settings are used, and can be very system-dependent. If using AvsPmod, try the script first with those disabled, try to re-enable when ready to use. Sometimes AvsPmod will crash, sometimes everything will crash. You're basically forcing a memory setting on Avisynth, and it may no like it.

Modern Avisynth 2.6.x should not require LoadPlugin.

Nothing too unusual. It's given me an idea for something.

His script needs to be edited to work for you. It's very computer specific, just as much as it's tape/source specific. You can't just copy/paste and expect it to work for you 100% as is. That's the first lesson of Avisynth that I should teach/warn.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
The following users thank lordsmurf for this useful post: ragu0012 (09-27-2017)
  #29  
09-27-2017, 09:53 AM
ragu0012 ragu0012 is offline
Free Member
 
Join Date: May 2017
Posts: 94
Thanked 6 Times in 4 Posts
Question on resizing.

Do I still want to use the "Spline36resize(640,480)" command?

My final destination for this (and any other video that I spend time on) is two files, one MPEG to keep for playing on TV via digital video player like WD or through my Tivo with pytivo. The second file mp4 to upload to vimeo.

All my VHS videos were shot with the same camcorder, so I predict the cropping issues will be pretty consistent.

Second question, has anyone posted to this forum preferred h.264 mp4 settings for avidemux? The mpeg-2 settings are very clear through Lordsmurf's guide. And is the 2.7 version preferred at this point?

THANKS
Quote:
Originally Posted by sanlyn View Post
Thanks for posting a chunk of the original.
### Typical VHS overscan crop
Crop(20,2,-16,-6) # use both lines
AddBorders(18, 4, 18, 4) # use both lines

Sometimes it's better to crop before resizing. See the script and images below. The upper image is frame 120 from the redo1 avi. The core image inside the borders is 604x472 without the thick borders. That image is an aspect ratio of 1.28:1, which is more narrow than 1.3333:1. It's likely your camera wasn't recording exactly 4:3 anyway, but the image here seems just a little squeezed horizontally.



The image below used different cropping, before resizing. The borders were cropped as before, but borders were added to make the frame size 704x480, with thinner side borders, then resized. The core image below is 622x472 without borders (aspect ratio 1.32:1).



The wider core image comes from the fact that NTSC and PAL SMPTE standards use only 704x480 of the 720x480 frame with 4:3 source material. Cameras and Players differ from this standard somewhat, more or less, so you never can tell what the final dimensions will look like until you see the video played or captured by different devices.
Reply With Quote
  #30  
09-27-2017, 01:24 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
I addressed the output options earlier in post #6. You can't make DVD or standard definition BluRay from square pixel video. Those two formats are anamorphic and interlaced. Make and save a 720x480 master for encoding. You can make it interlaced or you can use SelectEven() to make it 29.97 progressive (but either way, you tell your encoder to encode as interlaced. Many devices will play the disc as interlaced anyway).

Take that 720x480 version and make a 4:3 progressive version for square pixel mp4. If it's interlaced, deinterlace and remove 8 pixels from each side border, as shown here:

Code:
AviSource(whatever 720x480 video)
AssumeTFF()
QTGMC(preset="super fast",border=true).SelectEven()
Crop(8,0,-8,0)                                               #<- frame will be 704x480)
Spline36Resize(640,480)
\
If it's not interlaced, omit the TFF and QTGMC lines:

Code:
AviSource(whatever 720x480 video)
Crop(8,0,-8,0)                                               #<- frame will be 704x480)
Spline36Resize(640,480)
I can't answer for Avidemux details. I never use it, as it's too buggy and limited for my purposes. For any h.264 encoder I'd suggest a bitrate of 5000 or higher for action video and small GOP's of 30 frames each.
Reply With Quote
The following users thank sanlyn for this useful post: ragu0012 (09-27-2017)
  #31  
09-27-2017, 01:29 PM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,503
Thanked 2,449 Times in 2,081 Posts
For H.264, I've been using CRF for several years now.
Avidemux or Hybrid.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
  #32  
10-07-2017, 01:52 AM
ragu0012 ragu0012 is offline
Free Member
 
Join Date: May 2017
Posts: 94
Thanked 6 Times in 4 Posts
I took a crack at this one using some of Sanlyn's tips, reading documentation for the filters I used and trying to adjust them as needed. Concentrated on halos. Tried to fix color balance issues. Please let me know where I failed and where I came close.

before:
frame 11.png
after:
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.


I attached the virtualdub settings. ANd here is the avisynth script.

Code:
Import("C:\Program Files\AviSynth\plugins\FixChromaBleeding.avs")
Import("C:\Program Files\AviSynth\plugins\LimitedSharpenFaster.avs")

Avisource("C:\Users\Administrator\Downloads\test indoor wrestling.avi")


#Tweak(cont=1.15,dither=true,coring=false)
Levels(16,1.0,255,16,235,dither=true,coring=false)
AssumeTFF()
SeparateFields()
FixVHSOversharp(8,12,8)  #<- reduce dark and bright right-edge halos
FixVHSOversharpL(2,12,8)  #<- reduce and bright left-edge halos
Weave()

ConvertToYV12(interlaced=true)
ColorYUV(off_u=+25, off_v=-10, gain_y=-2,cont_u=-4)
QTGMC(preset="fast",border=true,EZDEnoise=2,denoiser="dfttest",ChromaNoise=true)
SelectEven()
ChromaSHift(c=2,L=-2)
FixChromaBleeding()
MergeChroma(aWarpSharp2(depth=20))
DeHalo_Alpha(rx=2)         #<- another step at dark and bright edge halos

# ---- crop uneven borders and bottom noise, add new borders for 704x480 -----
Crop(18,0,-14,-6).AddBorders(16,2,16,4)
#Spline36resize(640,480)
LimitedSharpenFaster()

# ---- RGB for VirtualDub filters ------
ConvertToRGB32(interlaced=false,matrix="Rec601")
return last


Attached Files
File Type: avi test wrestling edited.avi (34.66 MB, 7 downloads)
File Type: avi test indoor wrestling.avi (60.11 MB, 8 downloads)
File Type: avs sanlyn wrestling.avs (1.1 KB, 7 downloads)
Reply With Quote
  #33  
10-09-2017, 01:48 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
Quote:
Originally Posted by ragu0012 View Post
I took a crack at this one using some of Sanlyn's tips, reading documentation for the filters I used and trying to adjust them as needed. Concentrated on halos. Tried to fix color balance issues. Please let me know where I failed and where I came close.
A good effort, although you're still struggling with the hardware defects I mentioned earlier. They affect indoor shots more than outdoor, but they're always present and troublesome.

The crippled and distorted blue channel is still there, and looks worse here. Notice how Blue has a solarized effect ("solar flare" on contrasting edges) and posterization:



a 5fps video of the flicker, noise, and distortion in the blue channel is attached: original_bad_channel.mp4.

Histograms show how badly blue is crippled. It's worse in dark and available lighting but it's present in brighter scenes, too. Below, YUV histogram is on the left, RGB on the right:


You can raise blue into the brighter areas, but you're stretching available values and ending up with blotchy and patchy effects. Look at the uneven stains, poor flesh tones, and ugly yellow ochre shadows in the walls below from the "edited" avi. Note also that the original red-orange color cast has been replaced by an obvious green one, and there are odd effects in many object colors: for instance, what color is the wooden clock (it looks blackish green here, and the clock's face is cyan). What color is the flower pot, the uipholstery in the corner, or the t-shirts (are those t-shirts purple, dark blue, or light blue)?. The corrupt color channel corrupts most of the other hues as well:


It's difficult not to notice the annoying edge noise, distortion and ragged edges in these videos. It's especially noticeable in available light shots but is seen everywhere and is the reason why you're having to throw away half your video when deinterlacing to avoid edge noise. It's caused by the absence of a line-level tbc. I know you say you have one, but it doesn't appear to be doing anything. You still have tell-tale vertical wiggles, distortion, and notched edges/ I prepared two 2x enlargements of areas in your sample and 5fps slow-motion videos so t hat you can see why the edges look so noisy (and why they can't be fixed): wrestling edited_plant_clock_bad_TBC.mp4 and wrestling edited_wall_bad_TBC .mp4.

Until you can get better hardware or improve what you have, you'll spend a lot of time and effort working against yourself.


Attached Images
File Type: jpg f96 original Channels.jpg (154.3 KB, 237 downloads)
File Type: png indoor wrestling original YUV-RGB.png (33.3 KB, 212 downloads)
File Type: jpg f113 edited - uneven wall stains R.jpg (50.9 KB, 212 downloads)
Attached Files
File Type: mp4 original_bad_channel.mp4 (7.96 MB, 9 downloads)
File Type: mp4 wrestling edited_plant_clock_bad_TBC.mp4 (4.16 MB, 11 downloads)
File Type: mp4 wrestling edited_wall_bad_TBC .mp4 (4.86 MB, 7 downloads)
Reply With Quote
  #34  
10-09-2017, 02:48 PM
ragu0012 ragu0012 is offline
Free Member
 
Join Date: May 2017
Posts: 94
Thanked 6 Times in 4 Posts
Sanlyn do you believe the blue channel issues are a result of the VCR playing the tape for capture, or the original Camcorder that recorded the video?

(and just to answer a couple questions -- the clock should be dark brown with a white face. The flower pot should be black. The T-shirts should be purple. The wall should be white or slightly off-white. The couch should be various shades of tan with brown wood trim on it.)
Reply With Quote
  #35  
10-09-2017, 03:22 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
blue channel: I don't know if it;s the player or the original camera. Try a different tape not made with that camera, or try a different VCR even if it's not a high-end job. What's more difficult to deal with is that either the tbc isn't working or it doesn't exist. Color can often be fixed or tolerated, but scanline timing errors can't be fixed after capture.
Reply With Quote
  #36  
10-09-2017, 03:44 PM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,503
Thanked 2,449 Times in 2,081 Posts
It's the camera.

I doubt that wall is white, but probably more into the light tan.

Given the samples so far, the "before" is better than "after". I think you're trying to push the color work too hard. Remember, this isn't a pure RGB, but YCrCb. You can't adjust one color without affecting others (and usually not for the better).

Take baby steps in correction. Try to make it better, not make it perfect.

Try it again, but with less aggressive filtering.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
  #37  
10-10-2017, 05:25 AM
themaster1 themaster1 is offline
Free Member
 
Join Date: Feb 2011
Location: France
Posts: 497
Thanked 99 Times in 83 Posts
Maybe you want it a bit more like this (script included)


Attached Images
File Type: jpg wrestling.jpg (268.6 KB, 212 downloads)
Attached Files
File Type: avs wrestling-original_bad_channel-rgbadapt.avs (4.9 KB, 15 downloads)
Reply With Quote
The following users thank themaster1 for this useful post: lordsmurf (10-10-2017)
  #38  
10-10-2017, 01:34 PM
ragu0012 ragu0012 is offline
Free Member
 
Join Date: May 2017
Posts: 94
Thanked 6 Times in 4 Posts
themaster1 -- that looks really good. I'd love to try out this script on my own but I'm missing quite a bit.

1. Lsmashsource -- not needed if I'm running the script on my avi file, correct? Or maybe I'm not understanding why this one is needed.
2. Could you help me find your script for RGBAdapt_auto_white_balance2.avs?
3. Can you provide MT 0.7? All download links i can find are dead.

I think I have everything else you reference here.

And Sanlyn, what do you use for Red Blue Green Compare?
--Also Sanlyn and Lordsmurf, I have attached the same scene ripped from DVD from my original effort of digitizing my VHS tapes. I used a Panasonic DMR-EH59 to capture tapes played on a Panasonic VCR. But this should be able to show you if my color issues were the same back then and if my new capture looks better.


Attached Files
File Type: avi wrestling from DVD.avi (82.63 MB, 8 downloads)

Last edited by ragu0012; 10-10-2017 at 02:11 PM. Reason: adding video clip
Reply With Quote
  #39  
10-10-2017, 02:17 PM
themaster1 themaster1 is offline
Free Member
 
Join Date: Feb 2011
Location: France
Posts: 497
Thanked 99 Times in 83 Posts
i have filled your resquest see below (no need of lsmash if you use avi)


Attached Files
File Type: avs RGBAdapt_auto_white_balance2.avs (12.0 KB, 17 downloads)
File Type: rar MT_07.rar (374.8 KB, 8 downloads)
Reply With Quote
The following users thank themaster1 for this useful post: lordsmurf (10-10-2017)
  #40  
10-10-2017, 02:41 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,307 Times in 982 Posts
Quote:
Originally Posted by ragu0012 View Post
themaster1 -- that looks really good. I'd love to try out this script on my own but I'm missing quite a bit..
You sure are. Brights and chroma are blown out, even for computer RGB, and it's flagrantly over sharpened. But that's the kind of poor visual work that people seem to think is cool these days.

I pass.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Blocky, bleeding VHS video needs restoring Nightshiver Restore, Filter, Improve Quality 61 11-15-2012 09:50 PM
Manuals for JVC video gear, used for restoring video [DOWNLOADS] robjv1 Video Hardware Repair 1 02-11-2011 04:19 PM
Manuals for Sign Video/Studio 1 video gear, used for restoring video [DOWNLOADS] robjv1 Video Hardware Repair 1 08-20-2010 01:19 PM
Mac video editing, capturing, restoring, VHS to DVD - help? Whuntmore Project Planning, Workflows 14 03-16-2010 07:01 PM
What hardware for restoring/cleaning video ? couldbe Restore, Filter, Improve Quality 3 03-16-2004 03:42 PM

Thread Tools



 
All times are GMT -5. The time now is 06:26 PM