View Full Version : help to fix this video
greatmagician
15th April 2011, 14:08
hello .. i hop i will get help to fix this video
i tray alot of filters but nothing change
the problem in the color
and the noise even the noise have color ???
look to this pic
http://www.img4up.com/up2/37730188980747619907.png
http://www.img4up.com/up2/32581165238548785589.png
what i can do to get the best result ??
Ghitulescu
15th April 2011, 14:37
It looks like a SAT show recorded on a VHS, which tape was later on captured directly in MPEG-2 with a very low bitrate. Or the show itself originated from a VHS tape but still sent on-air with a low bitrate.
There are chroma-shift, cross-chroma, wrong levels and many more on the analog side, blockiness, wrong DAR, on the digital one.
Free feel to address each issue with its corresponding filter.
greatmagician
15th April 2011, 15:52
this is sample video
http://www.mediafire.com/?ot8h026bq6q6vo7
jmac698
15th April 2011, 19:20
You could try derainbow
http://avisynth.org/oldwiki/index.php?page=mfRainbow
This would fix the strokes of wrong colors (red, purple, green, blue).
johnmeyer
15th April 2011, 23:31
CNR handles chroma problems in VHS, but this clip has other issues too.
I have a script I use as a starting point for clips like this. You will have to adapt it to your use. I used it, without modification, and created this:
Better Clip (http://dl.dropbox.com/u/1561578/test%20%28final%29.avi)
Not exactly a work of art, but better than the original.
The following script can be made about 4x faster (on an 8-core CPU) using SetMTMode statements before/after the AVISource statement.
#Denoiser script for interlaced video using MDegrain2 (will work on progressive as well)
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:\frameserver.avi").killaudio()
#VHS chroma settings can sometimes cause smear. Skip CNR2 if not needed.
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
#Use 4 instead of 8 in line below for better quality in shadows
output=MDegrain2i2(chroma,8,0,0)
#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 -- works really well
fields=source.SeparateFields() # separate by fields
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)
MDegrain2(fields,super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400)
unsharpmask(60,3,0) #not sure whether to put this before or after the weave. Remove if sharpening degrades video
Weave()
}
papcom
24th November 2014, 19:19
I am trying with an older script provided by johnmeyer in this thread (on 16.04.2011). I intend to restore some VHS material (captured via a TBC and an BMD Intensity pro Capture Card). Basically I am searching for a good script method to restore my VHS and Video8 tapes.
Unfortunatly I can't the script get working. I am always getting an error: "Cnr2: YV12 colorspace only", although I have put "converttoyv12" in the script.
I think I have some mistakes in my script. Could anybody help me with that:
SetMemoryMax(1024)
#Modify this line to point to your video file
source= AVISource("C:\intensitytest8mm.avi").killaudio()
ConvertToYV12(source)
#VHS chroma settings can sometimes cause smear. Skip CNR2 if not needed.
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
#Use 4 instead of 8 in line below for better quality in shadows
output=MDegrain2i2(chroma,8,0,0)
#stackhorizontal(source,output)
return output
creaothceann
24th November 2014, 20:19
f = "C:\intensitytest8mm.avi"
SetMemoryMax(1024)
AVISource(f, audio=false, pixel_type="YV12")
chroma = CNR2("oxx", 8, 16, 191, 100, 255, 32, 255, false)
MDegrain2i2(chroma, 8, 0, 0)
papcom
24th November 2014, 22:03
thank You for Your code: I inserted it, and now I have the following coming up:
AVISource: the Video decompressor couldn't produce YV12 Output.
f = "C:\intensitytest8mm.avi"
SetMemoryMax(1024)
AVISource(f, audio=false, pixel_type="YV12")
chroma = CNR2("oxx", 8, 16, 191, 100, 255, 32, 255, false)
MDegrain2i2(chroma, 8, 0, 0)
#Use 4 instead of 8 in line below for better quality in shadows
#~ output=MDegrain2i2(chroma,8,0,0)
#stackhorizontal(source,output)
return output
creaothceann
24th November 2014, 22:06
Oh well, use
AVISource(f, audio=false).ConvertToYV12
then.
papcom
24th November 2014, 22:51
thanks @creaothceann, it' s working now.
I would like to insert the following autolevel code into the script /whole script of @johnmeyer see some Posts before).
==Where should this code snippet be at its best Position?
AutoAdjust(auto_balance=true, auto_gain=true, dark_limit=1.50, bright_limit=1.50, gamma_limit=1.25)
johnmeyer
24th November 2014, 23:47
BTW, I just posted a variation of this script in another forum, and as part of that, provide a "before/after" of some really lousy LP (6-hour mode) VHS tape that was captured without a TBC. Make sure to view this full screen, and after going to full screen, set the resolution to 1080p. I up-res'd the video to make sure that YouTube didn't fuzz it up too much, and you really can see more of the awful stuff in the before image if you set the resolution to HD. Here is the link:
https://www.youtube.com/watch?v=7a9KSQvDZlw
papcom
24th November 2014, 23:54
@johnmeyer - really impressive - Is this the same script You posted in this thread? ...or did You implement modifications? BTW -- where can I find Your Variation?
johnmeyer
25th November 2014, 00:05
@johnmeyer - really impressive - Is this the same script You posted in this thread? ...or did You implement modifications? BTW -- where can I find Your Variation?You don't have to look for my variation: it is virtually identical to what I already posted above. However, here it is again, with the exact settings used on the video I linked to above:#Denoiser script for interlaced video using MDegrain2
SetMemoryMax(768)
Loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools2.dll")
LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\CNR\Cnr2.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\Film Restoration\Script_and_Plugins\LimitedSharpenFaster.avs")
SetMTMode(5,6)
#Modify this line to point to your video file
source=AVISource("E:\fs.avi").killaudio().AssumeBFF()
SetMTMode(2)
#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=better, but slower
#For VHS, 4,0 seems to work better than 8,2. Most of difference is in shadows
output=MDegrain2i2(chroma,8,0,0)
#output=MDegrain2i2(chroma,8,4,0) #Retains a little more detail, but slower
#output=MDegrain2i2(chroma,4,2,0) #Better for retaining detail on flat surfaces, but slower still
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 optional line gets rid of chroma halo, a problem with 2nd gen tapes
#fields=MergeChroma(fields,crop(fields,Hshift,Vshift,0,0).addborders(0,0,Hshift,Vshift))
#This line will shift chroma down and to the right instead of up and to the left (an uncommon problem)
#fields=MergeChroma(fields,Crop(AddBorders(fields,Hshift,Vshift,0,0),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 for more degraining
MDegrain2(fields,super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400)
#Optional sharpening steps
#unsharpmask(50,3,0)
#sharpen(0.1)
Weave()
}
papcom
25th November 2014, 00:13
wow - thank You @johnmeyer, that's very kind- I will try this code with a bad VHS source. I couldn't find the limitedsharpenfaster.avs in my Folder of Your film scripts and plugins. Where could I get it from?
johnmeyer
25th November 2014, 00:28
wow - thank You @johnmeyer, that's very kind- I will try this code with a bad VHS source. I couldn't find the limitedsharpenfaster.avs in my Folder of Your film scripts and plugins. Where could I get it from?You don't need it. You'll see that it is not actually used in the script (I forgot to comment out the import line). I also commented out the other sharpening lines. Do everything without sharpening, and only after you like the result should you attempt to add any sharpening. Be especially careful to look for halos when you add sharpening. With low-res VHS material, it doesn't take much sharpening to end up creating some really bad haloing.
papcom
25th November 2014, 01:13
OK - I understand - What exactely do I do with the Cnr2? ...it requires YV12 explicitly, and gives an error as it is now. Where to put the "ConverttoYV12" in Your script?
johnmeyer
25th November 2014, 02:52
Just skip the CNR. It is only useful if you have a lot of chroma noise, and MDegrain2 actually gets rid of much of it.
papcom
25th November 2014, 09:45
thanks for Your tipp, in the meantime I found out where to insert "converttoyv12"
In order to correct Color and Levels I would like to insert Lato's "auto-adjust" line into your script.
Where would you suggest should I put the following code snippet?
Code:
AutoAdjust(auto_balance=true, auto_gain=true, dark_limit=1.50, bright_limit=1.50, gamma_limit=1.25)
creaothceann
25th November 2014, 16:55
You should read the documentation, it's really not hard to understand.
johnmeyer
25th November 2014, 17:18
Auto adjusting levels doesn't work very well, IMHO. Good color and gamma correction requires scopes and an NLE. I do mine in Vegas. If you really want to use an auto correct, then just stick it in pretty much anywhere. Try it at the end of the filter chain.
papcom
25th November 2014, 17:47
Auto adjusting levels doesn't work very well, IMHO. Good color and gamma correction requires scopes and an NLE. I do mine in Vegas. If you really want to use an auto correct, then just stick it in pretty much anywhere. Try it at the end of the filter chain.
I am very happy with the tools from Lato like "AutoAdjust 2.5", or "SmoothLevels" and "SmoothTweak". Of course I don't do colorgrading with it ;-)) ... but I use them to slightly correct Levels and Color, which helps me a lot.
papcom
25th November 2014, 21:29
I would like to enlarge the videoimage a little bit in order to get rid of the nasty blanking on the side and the head-switching lines at the bottom. I think it would be best to have this stage before the sharpening.
What resizer would You recommend?
johnmeyer
25th November 2014, 22:21
What resizer would You recommend?None. Crop it instead. You'll never see the black edges when watching, and you'll avoid any unpleasantness from re-sizing.
papcom
26th November 2014, 00:49
None. Crop it instead. You'll never see the black edges when watching, and you'll avoid any unpleasantness from re-sizing.
I need a final result for DVD (in PAL that's 720x576). When I crop, I have some pixels missing and it won't work properly in my Authoring Tool. Also there is the Problem, that when I play the DVD on a PC or Mac one will see the ugly borders.
So I need to crop the borders and then size it any way. That's why I asked for a method to do it in the avs- script... as it is done in Your film restoring script after the deshaker.
johnmeyer
26th November 2014, 00:59
I need a final result for DVD (in PAL that's 720x576). When I crop, I have some pixels missing and it won't work properly in my Authoring Tool. Also there is the Problem, that when I play the DVD on a PC or Mac one will see the ugly borders.
So I need to crop the borders and then size it any way. That's why I asked for a method to do it in the avs- script... as it is done in Your film restoring script after the deshaker.When I said "crop" I actually meant mask. Just replace the head switching border garbage with black, but keep the rest of the pixels unchanged, and keep the total pixels the same. I normally do all of this in my NLE because it is much easier to interactively see exactly what I need to mask, down to the pixel. It is, of course, just as easy to do it in AVISynth, if that's how you want to do it.
[edit]http://forum.doom9.org/showthread.php?t=171172&highlight=mask+borders
papcom
26th November 2014, 16:27
@johnmeyer - in Your code there is the following line. I do not understand the Parameters I have to setin order this codeline has an effect? What is my error?
#This optional line gets rid of chroma halo, a problem with 2nd gen tapes
fields=MergeChroma(fields,crop(fields,Hshift,Vshift,0,0).addborders(0,0,Hshift,Vshift))
StainlessS
26th November 2014, 17:29
Have not really been following this, but think you may have to adjust those in blue (otherwise they dont do anything)
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 optional line gets rid of chroma halo, a problem with 2nd gen tapes
#fields=MergeChroma(fields,crop(fields,Hshift,Vshift,0,0).addborders(0,0,Hshift,Vshift))
#This line will shift chroma down and to the right instead of up and to the left (an uncommon problem)
#fields=MergeChroma(fields,Crop(AddBorders(fields,Hshift,Vshift,0,0),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 for more degraining
MDegrain2(fields,super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400)
#Optional sharpening steps
#unsharpmask(50,3,0)
#sharpen(0.1)
Weave()
}
johnmeyer
26th November 2014, 18:05
@johnmeyer - in Your code there is the following line. I do not understand the Parameters I have to setin order this codeline has an effect? What is my error?It is commented out, which means you don't need it. If you read my comment in the script, it is designed to get rid of chroma halos that you often get with 2nd generation tapes (this is also in the comments).
If you have a colored halo problem (it will be obvious if you do), then comment out this line (not the second one, which is for a rather unusual variation which is the reverse of the normal problem). Then, note which side the halo appears. Usually you get a colored halo (just like the sharpening halos that "dehalo" attempts to remove, but colored instead of white -- usually red) on the right side of an object. If so, change the HShift parameter from 0 to 2 after you uncomment this one line. You can try other values to see if it gives you a better result. As with all scripts, you always have to change the values to fit your video and your own tastes. There is no "cookbook," nor is there such a thing as a "one size fits all" script.
Finally, remember that this feature is normally NOT USED. If you use it when it is not needed, you will make your video worse -- much worse.
papcom
26th November 2014, 20:41
that's precisely the theme I am looking for... the Color Timing problems of old and bad analog Video. Therefore I would like to experiment with. (I know that it's normally not used) I understand the comments in Your script but I still do not understand: which parameters in this scriptline do I have to set?
fields=MergeChroma(fields,crop(fields,Hshift,Vshift,0,0).addborders(0,0,Hshift,Vshift))
and which parameters do I have to set here, ....is this related to the above mentioned scriptline?)?
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
johnmeyer
26th November 2014, 22:59
I already answer your question in the previous post.
papcom
17th March 2015, 21:17
I tried several V8 and VHS tapes with the script of Johnmeyer. I am always impressed by the results. Thank You again @JMH.
Actually I am working with the audiotrack, which is not anymore there after the Rendering of the script. My videoresults have lost the Audio somehow.
What am I doing wrong? Here the passage in the script of loading the Video:
....
SetMTMode(5,6)
source=qtinput("C:\videodaten\myvideo.mov").ConvertToYV12.AssumeTFF()
SetMTMode(2)
chroma=source.Cnr2("oxx",8,16,191,100,255,32,255,false) #VHS
output=MDegrain2i2(chroma,8,4,0)
return output
....
johnmeyer
17th March 2015, 22:55
Actually I am working with the audiotrack, which is not anymore there after the Rendering of the script. My videoresults have lost the Audio somehow.
What am I doing wrong?I don't see anything in the script fragment you posted that would cause the audio to disappear. However, all the scripts that I posted in this thread included the "killaudio()" statement which I include to improve stability (even though several members of this forum have told me this isn't needed). This statement obviously kills the audio track.
Use the search function in your script editor to check your entire script again to make sure that this killaudio statement still isn't floating around somewhere.
You can also accidentally kill the audio track inside of VirtualDub, or MeGui or whatever else you may be using to read the script and render the results. Make sure to check the audio chain inside of whatever program you are using, and make certain that audio is enabled.
papcom
18th March 2015, 00:20
thank You @johnmeyer - indeed I have deleted the killaudio in Your script, and I thought this would enable the audiotrack in my output-video.
I use Virtual Dub to render the avs- script resp. output my video. Normally I have audio processing on "direct stream copy". I think I have to check Virtual Dub again.
Is there a way to check the audio of an avs-script in avsPmod, which I use for editing and testing the scripts?
creaothceann
18th March 2015, 01:38
Is there a way to check the audio of an avs-script in avsPmod, which I use for editing and testing the scripts?
Well there's Info and Waveform (http://avisynth.nl/index.php/External_filters#Audio_Filters)...
papcom
18th March 2015, 11:24
I've found the problem of the missing audio:
It had to do with QTInput… by default audio is disabled and has to be enabled, e.g. by adding "audio=1"..."audio=true"...
@creaothceann - btw, thank you for the waveform tipp, helped me to trace down the Problem.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.