View Full Version : Need help with proper script setting
Nikishek
15th October 2015, 22:05
Hi, I'm trying to "repair" family video collection grabbed from my old VHSs but I'm still ain't satisfied. Could you give me some advices?
Here is my code
qtgmc="C:\Program Files (x86)\AviSynth\plugins\QTGMC.avsi"
source="d:\source.avi"
Import(qtgmc)
SetMTMode(5, 2)
SetMemoryMax(700)
AviSource(source)
SetMTMode(2)
ConvertToYV12(interlaced=true)
Crop(left,top,right,bottom)
# Deinterlace
QTGMC( Preset="Slower", EdiThreads=1)
SelectEven()
LanczosResize(target_width, target_height)
Tweak(hue=0.0, sat=1, bright=5, cont=1, coring=true, sse=false)
AutoAdjust(auto_gain=true, auto_balance=true)
ConvertToYUY2()
FixVHSOversharpL(30,12,8)
FixVHSOversharp(30,14,10)
FixVHSOversharp(30,12,8)
ConvertToYV12()
As you see I used QTGMC for deinterlacing and other minor fixes, filter for repair the light and dark halos that follow high contrast edges, and some color tuning. But main thing still remains. I'm freaking out to this strange violet chroma that are the most noticeable on the sidewalk on the right side (pic1) or on the second pic (pic2) - water and sky.
Original source:
pic1
http://oi57.tinypic.com/34sfkp4.jpg
pic2
http://oi59.tinypic.com/2zeytdd.jpg
I tried to fix it with some code like this... (and many others) But without any luck.
Overlay(last, last, y=-6, mode="chroma")
Another thing is this ugly vertical lines in all picture which are better seen in repaired non-interlaced image.
Non-interlaced "repaired" picture
http://oi60.tinypic.com/msgfag.jpg
Interlaced original source
http://oi58.tinypic.com/339pnc7.jpg
Guys please help me with this. I can't figure it out how to fix it (
hope it is somehow possible). Thanks in advance for your advices!
And incidentally... I'm a beginner.
johnmeyer
15th October 2015, 23:53
First of all, why are you deinterlacing? You probably don't need to do that.
The typical VHS chroma rainbows, seen most prominently in the sky behind the girl on the beach, can be reduced by using an old VirtualDub filter (CNR) inside of AVISynth.
Here is the starting point for my VHS capture cleanup. I've posted variations of this many times before. If you upload a short 10-15 second clip of what you are trying to fix, I can take a look and see what other problems it may have. BTW, the wavy vertical lines indicate that you could get better results if you use hardware that includes a time base corrector (TBC).
This code has lots of optional lines that you can include by removing the comment. Some types of chroma halos can be removed with the code buried in the MDegrain function. However, this is only for halos caused by tapes which are copies, rather than originals.
#Denoiser script for interlaced VHS video using MDegrain2
#Designed for BFF captures
SetMemoryMax(768)
Loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools2.dll")
LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\CNR\Cnr2.dll")
#Modify this line to point to your video file
source=AVISource("E:\fs.avi").killaudio().AssumeBFF()
#Only use chroma restoration for analog source material
chroma=source.Cnr2("oxx",8,16,191,100,255,32,255,false) #VHS
#chroma=source.Cnr2("oxx",8,14,191,75,255,20,255,false) #Laserdisc
#Set overlap in line below to 0, 2, 4, 8. Higher number is sometimes a little better, but not always. It is always slower.
#For VHS, 4,0 seems to work better than 8,2. Most of difference is in shadows
#However, 8,0 is good enough and MUCH faster. 8,2 doesn't seem to make much difference on VHS.
output=MDegrain2i2(chroma,8,0,0) #(8,4,0 or 8,2,0 might produce better results
#stackhorizontal(source,output)
return output
#-------------------------------
function MDegrain2i2(clip source, int "blksize", int "overlap", int "dct")
{
Vshift=0 # 2 lines per bobbed-field per tape generation (PAL); original=2; copy=4 etc
Hshift=0 # determine experimentally
overlap=default(overlap,0) # overlap value (0 to 4 for blksize=8)
dct=default(dct,0) # use dct=1 for clip with light flicker
fields=source.SeparateFields() # separate by fields
#This line gets rid of vertical chroma halo, if you remove the commend and
#if you set HShift and/or VShift to 1, 2, or 3
#fields=MergeChroma(fields,crop(fields,Hshift,Vshift,0,0).addborders(0,0,Hshift,Vshift))
super = fields.MSuper(pel=2, sharp=1)
backward_vec2 = super.MAnalyse(isb = true, delta = 2, blksize=blksize, overlap=overlap, dct=dct)
forward_vec2 = super.MAnalyse(isb = false, delta = 2, blksize=blksize, overlap=overlap, dct=dct)
backward_vec4 = super.MAnalyse(isb = true, delta = 4, blksize=blksize, overlap=overlap, dct=dct)
forward_vec4 = super.MAnalyse(isb = false, delta = 4, blksize=blksize, overlap=overlap, dct=dct)
#Increase thSAD to increase denoising
MDegrain2(fields,super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400)
Weave()
}
Nikishek
21st October 2015, 20:05
Thanks a lot for your help. I studied and tried your code and the picture looks better. Chroma rainbows are almost gone but the vertical lines are still present.
So I uploaded some samples, hope that MEGA will be appropriate storage server. If this is not enough I can upload a longer or a different record.
holiday video, chroma ghosts (https://mega.nz/#!iEY2hCZB!WutwD15jHs5n_L1EGN_9yGadGwRUrLGCoYlOCj6ntFE)
flowers, vertical lines (https://mega.nz/#!udQSgaQb!eLZEHcljbjJvt53WEqHHTOFBSdnco8CouNEUIgLffaI)
And you're right, deinterlacing is unnecessary in this case. I thought the result will look better deinterlaced by QTGMC than interlaced in player which will do it automatically. Maybe it is not recognizable to the human eye, maybe it is... It's probably a subjective opinion.
My source is classic VHS coppied from MiniDV cassette which comes from the old analog camcorder. I tried to find some HW which include as you mentioned time base corrector but this is too expensive device for me. In fact I need only digitalize old familly recordings so it's not a big deal but emocional value is big. Do you think that replacing vhs player helps a little bit (for example if I borrow it from a friend)?
I uncomment in your code "fields" variable (approx #37) but unfortunately I can not see any changes in the picture.
One more thing... Isn't Cnr2 only for progressive input as wiki says?
johnmeyer
22nd October 2015, 00:13
I can't remember now if CNR is only for progressive. However, you can avoid having to worry about this by first removing all references to CNR in the main part of the script, and then changing this line in the MDegrain2i2 function:
fields=source.SeparateFields()
to this:
fields=source.SeparateFields().Cnr2("oxx",8,16,191,100,255,32,255,false)
I cannot tell you whether getting a different VHS player would give you better results because you didn't tell us what VHS player you have been using.
As for the TBC, you might be able to get a partly functioning Digital8 camcorder on eBay for very little money. Most of these include analog passthrough and a TBC. However, if you are in Europe, your stupid (IMHO) European Union passed laws back in the 1990s that blocked the passthrough technology in order to protect some group who lobbied against it. Therefore, you may not be able to get a PAL Digital8 camcorder with passthrough. Too bad, because this is a cheap way to get at least some TBC functionaility.
Finally, do NOT uncomment the code (the "fields" variable) unless you are transferring VHS tapes which are copies of other VHS tapes. When doing an analog VHS tape to VHS tape transfer, chroma errors accumulate, and you get colored halos next to the edges of brightly-colored objects. This is not a problem for first-generation tapes, i.e., NOT copies. If you use this code in situations where it is not needed, it will actually create the very halos that it is designed to eliminate.
johnmeyer
22nd October 2015, 00:27
I just looked at your "vertical lines" video. Other people are going to have to help you with that. I bobbed the video and zoomed in on some of the resulting fields. As you will see from this bobbed field, the lines are not vertical and they do not cover the entire frame. They show up in some fields, but not others. I have not see this sort of thing before. It is possible that it is on the tape, but it could also be something in the VHS player.
Here's the snapshot, from about 1/5 of one field:
http://i177.photobucket.com/albums/w208/johnmeyer/Moire%20Patterns_zpsac8zjkb8.jpg
Here is the snapshot from the very next field, using the exact same magnification. Note the complete lack of cross-hatched patterns and the absence of the yellow colored rectangle:
http://i177.photobucket.com/albums/w208/johnmeyer/No%20moire_zps70jzrw2w.jpg
Hopefully someone smarter than me will have an idea what is causing this.
Music Fan
22nd October 2015, 11:38
As for the TBC, you might be able to get a partly functioning Digital8 camcorder on eBay for very little money. Most of these include analog passthrough and a TBC. However, if you are in Europe, your stupid (IMHO) European Union passed laws back in the 1990s that blocked the passthrough technology in order to protect some group who lobbied against it. Therefore, you may not be able to get a PAL Digital8 camcorder with passthrough. Too bad, because this is a cheap way to get at least some TBC functionaility.
One can find TBC's also in Hi8 camcorders, I bought one a few weeks ago on eBay.
I could have bought a Digital8 but I wanted to be sure no digital process would be used thus I chose a Hi8 (with LP, stereo, S-video ... some models lack these skills).
johnmeyer
22nd October 2015, 15:11
If "no digital process would be used," how do you get the video out of the analog Hi8 camcorder and into the computer? Something has to digitize it.
Music Fan
22nd October 2015, 15:36
Of course, my computer do it, but I didn't want the camera to add a process I don't need (admitting it digitizes video even when an analog output is used, thus making 2 successive conversions : A/D and D/A).
johnmeyer
22nd October 2015, 17:18
I must be dumb. AFIK, Hi8 doesn't have any A/D because it is strictly an analog medium, just like 8mm, VHS, Beta, and S-VHS. The camcorders and decks only have RF, composite and, with certain models, S-Video outputs. There is no USB, Firewire, or any other digital output. Therefore, I assume that you must have some capture card in your computer. Is that how you are doing it? And if so, what capture card is in your computer?
Music Fan
22nd October 2015, 19:58
AFIK, Hi8 doesn't have any A/D because it is strictly an analog medium, just like 8mm, VHS, Beta, and S-VHS.
Of course, re-read what I said ; I wanted to avoid Digital 8 because a possible internal digitizing (to add DNR or something like that), even when analog output is used. I don't know if Digital 8 does it but I didn't want to take risks, thus I bought a Hi8 camcorder. This way, I'm sure my Hi8 tapes are not digitized before my capture card.
Therefore, I assume that you must have some capture card in your computer. Is that how you are doing it?
Yes.
And if so, what capture card is in your computer?
An Hauppauge PVR.
johnmeyer
22nd October 2015, 20:03
Thanks, that explains it. If you can get it working (which you obviously have), that is probably a very good setup.
Music Fan
22nd October 2015, 20:14
Yes, I'm astonished by the quality of these old tapes and the Hi8 camcorder's TBC seems efficient. And my capture card unofficially supports lossless capture mode in 4:2:2 (I capture in Lagarith Yuy2), which also helps to avoid video deterioration. I could hardly expect better, especially for the price I got them.
StainlessS
22nd October 2015, 23:07
Hauppauge PVR.
I believe that is pronounced as in "hop-hog"
EDIT: Looks German, think though US Red Indian.
See inserts with Hauppauge cards, gives history etc.
Nikishek
31st October 2015, 17:54
I cannot tell you whether getting a different VHS player would give you better results because you didn't tell us what VHS player you have been using.
...However, if you are in Europe, your stupid (IMHO) European Union passed laws back in the 1990s that blocked the passthrough technology in order to protect some group who lobbied against it...
I'm using Panasonic NV-HV51EP as VHS player and Avermedia EZMaker 7 (http://www.avermedia.com/professional/product/c039p/overview) as grabber.
Software: VirtualDub 1.10.4 + Avisynth 2.6 MT + MeGUI 2525
Unfortunately yes, I'm from Europe. I'll have to make do with these tools.
the lines are not vertical and they do not cover the entire frame. They show up in some fields, but not others. I have not see this sort of thing before. It is possible that it is on the tape, but it could also be something in the VHS player.
Yes, you're right. I'll try to borrow another vhs player from a friend and see if anything changes. I would also believe that there is a some avisynth cure for repair of these "crosshatched patterns".
Anyway thanks for help.
Yet another sort of question: I tried to clean audio with Audacity from background noise using Noise removal but the sound is very degraded. Is it worth to do this or is it better to leave it alone? What's your opinion?
johnmeyer
31st October 2015, 20:59
I don't know of any way to fix those cross hatch patterns. Even if they were constant (the same from frame to frame) it would be difficult, but the fact that they are changing from field to field makes it extremely difficult. As I said before, someone else will have to come up with a solution to that problem, and I will be very, very surprised if there is a solution.
As for your audio noise, it is totally impossible to answer your question without a sample of the problem. Every audio noise problem is different, and some are easy to fix, while others are impossible. I own iZotope RX Advanced, which many consider the "ultimate" audio restoration tool. I obviously have not tried every possible restoration tool, so I certainly will not make that claim, but it is indeed amazingly good. If you supply a sample, I will see what I can do with it.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.