Where to begin restoring VHS video? - Page 2 - digitalFAQ Forum
 Forum Where to begin restoring VHS video?
 Ask Question Join / Register FAQ Search Today's Posts Mark Forums Read

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

Quote:
 Originally Posted by ragu0012 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 -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 -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 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: Preserving color space, YV12 vs. RGB vs. 4:1:1 DV?. 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")

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 -----
Spline36resize(640,480)
LimitedSharpenFaster()

# ---- RGB for VirtualDub filters ------
ConvertToRGB32(interlaced=false,matrix="Rec601")
return last
- CamcorderColorDenoise
- temporalsmoother (setting=3)
- ColorMill
- Hue/Saturation/Intensity (Donald Graft)

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
Attached Files

Last edited by sanlyn; 09-23-2017 at 05:09 PM.
 The following users thank sanlyn for this useful post: lordsmurf (09-24-2017), ragu0012 (09-23-2017)
Someday, 12:01 PM
 Ads / Sponsors Join Date: ∞ Posts: 42 Thanks: ∞ Thanked 42 Times in 42 Posts
#22
09-24-2017, 04:39 AM
 themaster1 Free Member Join Date: Feb 2011 Posts: 224 Thanked 43 Times in 37 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

Last edited by themaster1; 09-24-2017 at 05:11 AM.
 The following users thank themaster1 for this useful post: ragu0012 (09-24-2017)
#23
09-24-2017, 07:30 AM
 ragu0012 Premium Member Join Date: May 2017 Posts: 77 Thanked 5 Times in 4 Posts
Quote:
 Originally Posted by themaster1 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 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 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?
#24
09-24-2017, 08:43 AM
 lordsmurf Site Staff | Video Join Date: Dec 2002 Posts: 9,954 Thanked 1,691 Times in 1,469 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!

- Find television shows, cartoons, DVDs and Blu-ray releases at the TVPast forums.
#25
09-24-2017, 09:29 AM
 ragu0012 Premium Member Join Date: May 2017 Posts: 77 Thanked 5 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 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!
#26
09-24-2017, 09:51 AM
 sanlyn Premium Member Join Date: Aug 2009 Location: N. Carolina and NY, USA Posts: 3,648 Thanked 1,196 Times in 958 Posts
Quote:
 Originally Posted by ragu0012 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 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 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.
#27
09-24-2017, 04:22 PM
 themaster1 Free Member Join Date: Feb 2011 Posts: 224 Thanked 43 Times in 37 Posts
Quote:
 Originally Posted by ragu0012 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\FixChromaBleeding.avs")
#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")
#############################
SetMemoryMax(4096)
SetMTMode(3,4)
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)
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
##### 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 ######

tweak(hue=-24.8,coring=false)

########## Vdub filters: colors & sharpen in RGB #################
ConverttoRGB32(matrix="rec601",interlaced=false)
SetMTMode(3,2)
#### CCD COLOR DENOISING :
CCD(11,0) #
# 5 sliders were used for hue, sat
rgbeq("20G2020G2020G2020G2020G2020G2014G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2j20G200tG2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G201DG2020G2020G2020G2020G2020G2020G2020G2020G2020G2000H4H00G4100G4100G4100G4100G4100G4100G4100H4H00G4100H4H00G0J000W0")
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)
#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
 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 Site Staff | Video Join Date: Dec 2002 Posts: 9,954 Thanked 1,691 Times in 1,469 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.

- Find television shows, cartoons, DVDs and Blu-ray releases at the TVPast forums.
 The following users thank lordsmurf for this useful post: ragu0012 (09-27-2017)
#29
09-27-2017, 09:53 AM
 ragu0012 Premium Member Join Date: May 2017 Posts: 77 Thanked 5 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 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.
#30
09-27-2017, 01:24 PM
 sanlyn Premium Member Join Date: Aug 2009 Location: N. Carolina and NY, USA Posts: 3,648 Thanked 1,196 Times in 958 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.
 The following users thank sanlyn for this useful post: ragu0012 (09-27-2017)
#31
09-27-2017, 01:29 PM
 lordsmurf Site Staff | Video Join Date: Dec 2002 Posts: 9,954 Thanked 1,691 Times in 1,469 Posts
For H.264, I've been using CRF for several years now.
Avidemux or Hybrid.

- Find television shows, cartoons, DVDs and Blu-ray releases at the TVPast forums.
#32
10-07-2017, 01:52 AM
 ragu0012 Premium Member Join Date: May 2017 Posts: 77 Thanked 5 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")

#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 -----
#Spline36resize(640,480)
LimitedSharpenFaster()

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

Attached Files
#33
10-09-2017, 01:48 PM
 sanlyn Premium Member Join Date: Aug 2009 Location: N. Carolina and NY, USA Posts: 3,648 Thanked 1,196 Times in 958 Posts
Quote:
 Originally Posted by ragu0012 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
Attached Files
#34
10-09-2017, 02:48 PM
 ragu0012 Premium Member Join Date: May 2017 Posts: 77 Thanked 5 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.)
#35
10-09-2017, 03:22 PM
 sanlyn Premium Member Join Date: Aug 2009 Location: N. Carolina and NY, USA Posts: 3,648 Thanked 1,196 Times in 958 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.
#36
10-09-2017, 03:44 PM
 lordsmurf Site Staff | Video Join Date: Dec 2002 Posts: 9,954 Thanked 1,691 Times in 1,469 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.

- Find television shows, cartoons, DVDs and Blu-ray releases at the TVPast forums.
#37
10-10-2017, 05:25 AM
 themaster1 Free Member Join Date: Feb 2011 Posts: 224 Thanked 43 Times in 37 Posts
Maybe you want it a bit more like this (script included)

Attached Images
Attached Files
 The following users thank themaster1 for this useful post: lordsmurf (10-10-2017)
#38
10-10-2017, 01:34 PM
 ragu0012 Premium Member Join Date: May 2017 Posts: 77 Thanked 5 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.

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

Last edited by ragu0012; 10-10-2017 at 02:11 PM. Reason: adding video clip
#39
10-10-2017, 02:17 PM
 themaster1 Free Member Join Date: Feb 2011 Posts: 224 Thanked 43 Times in 37 Posts
i have filled your resquest see below (no need of lsmash if you use avi)

Attached Files
 The following users thank themaster1 for this useful post: lordsmurf (10-10-2017)
#40
10-10-2017, 02:41 PM
 sanlyn Premium Member Join Date: Aug 2009 Location: N. Carolina and NY, USA Posts: 3,648 Thanked 1,196 Times in 958 Posts
Quote:
 Originally Posted by ragu0012 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.

 Similar Threads Thread Thread Starter Forum Replies Last Post Nightshiver Restore, Filter, Improve Quality 61 11-15-2012 09:50 PM robjv1 Video Hardware Repair 1 02-11-2011 04:19 PM robjv1 Video Hardware Repair 1 08-20-2010 01:19 PM Whuntmore Project Planning, Workflows 14 03-16-2010 07:01 PM couldbe Restore, Filter, Improve Quality 3 03-16-2004 03:42 PM