Short MPEG2 - has black dropouts
I read that DePulse() or RemoveDirt() can remove comets but neither worked for me.
+ Reply to Thread
Results 1 to 30 of 43
-
-
I tried each of the following:
DePulse()
RemoveDirt()
deSpot()
deScratch()
And deVCR as follows:
Code:function DetectVCRLines(clip c,int threshold) { spacial_data = GeneralConvolution(ConvertToRGB(c),0,"0 -1 0 0 2 0 0 -1 0") bar_data = ConvertToRGB(BilinearResize(spacial_data,16,c.height)) st_data = Overlay(bar_data,Trim(bar_data,1,0),mode = "subtract") st_data2 = Greyscale(Levels(st_data,threshold,10.0,threshold+1,0,255,coring = false)) st_data3 = Greyscale(Levels(st_data2,127,10.0,128,0,255,coring = false)) st_data4 = Overlay(st_data3,st_data3,y = -1, mode = "add") return PointResize(st_data4,c.width,c.height) } function deVCR(clip c,int threshold) { mybars = DetectVCRLines(c,threshold) return Overlay(c,Trim(c,1,0), mask = mybars,greymask = true) }
-
I'm sure you can figure it out. The Depulse() docs:
Code:DePulse 2005/04/10, 2005/04/11 update Author Unknown Function: Dropout remover, removes white/black noise horizontal streaking in analogue captures. Spatio-Temporal. Usage instructions. Assumes TFF (top field first) field order interlacing. YUY2 only. Syntax is: DePulse(clip, h=180[0-255], l=60[0-255], d=30[0-255], debug=false[true/false]) Pixel brightness values greater than h (high) are targeted as white noise. If a pixel (t) is target'ed as white noise then surrounding pixels (above, below, before and after [temporal], Not left and right) are tested and if ALL of them are less than (t - d) the target pixel t is depulsed. Pixel brightness values less than l (low) are targeted as black noise. If a pixel (t) is target'ed as black noise then surrounding pixels (above, below, before and after [temporal], Not left and right) are tested and if ALL of them are greater than (t + d) the target pixel t is depulsed. In debug mode, pixels judged to be black or white noise are coloured pink or green.
-
I just used RemoveSpots() and DeVCR(), got rid of 95% of them. Just 2 small dots remaining is all I see.
Oops! Couple of frames around frame 314 are troublesome. Wonder why they're different ? ?Last edited by sanlyn; 21st Mar 2014 at 09:27.
-
It's probably obvious, all these scripts and plugins have lots of options and their default values are not the best for each source, so when you write you tested: DePulse(), RemoveDirt(), deSpot(), deScratch(), I sincerely hope it does not mean you only tested the default values,..
-
The bottom 24 pixels are damaged thru the whole video. I got best results running even and odd fields separately, then reweave. Some of those comets go all the way across the frame.
Last edited by sanlyn; 21st Mar 2014 at 09:27.
-
Yes I just used the default values. I was hoping for something that would just work without needing to configure it differently for each video as I have lots of videos which have different comets on them.
Anway I tried DePulse(l=200, d=30) which seems to remove most of them but if anybody has a better script that removes comets without destroying the picture then please let me know. Also I'm using QTGMC but I'm keeping the video interlaced. Should I use the script while in progressive or after it's interlaced (weaved)? -
I was hoping for something that would just work without needing to configure it...
-
I tried DePulse(l=100, d=10) followed by RemoveSpots(). That got rid of almost all of them without much damage to the rest of the picture.
-
Some of the junk around frame 314 or so goes on for 3, 4, 5 frames (that's about 8 fields) and they're on fast-moving objects. The rest of them came clean.
Last edited by sanlyn; 21st Mar 2014 at 09:27.
-
Could you please give me the script you used for that or did you just use the default values as I tried the defaults and it didn't do anything?
I tried RemoveSpots() converttoyuy2() DePulse(l=100, d=10) and that got rid of mose of them but I don't want to convert the colorspace a 2nd time if possible as I'm already converting the colorspace with ConvertToRGB32 and you lose quality when converting the colorspace. -
Two ideas behind this script: The first part attempts to remove streaks before QTGMC interpolates them across multiple frames. The second part with QTGMC reduces block noise and banding due to the low bitrate of the source mpg.
I don't think any of the anti-streak or anti-spot filter can work well when noise repeats itself over too many consecutive frames. It's impossible to clean it 100% without working frame-by-frame or dividing frames into out of sequence clips and then rejoining them. I mentioned one tough spot near frame 314 or so where the filters are only partially effective because the noise endures across too many frames, thus would not be recognized as "noise".
Code:AssumeTFF().SeparateFields() in1 = last e=in1.SelectEven().RemoveSpots().DeVCR(20) o=in1.SelectOdd().RemoveSpots().DeVCR(20) eo=Interleave(e,o).Weave() eo ColorYUV(gamma_y=-60,off_y=3) QTGMC(preset="fast") DeBlock() AddGrainc(1.0,1.0) AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave() return last
Last edited by sanlyn; 21st Mar 2014 at 09:28.
-
Thanks Sanlyn. I tried that however the video looks a little bit more blurry and there are now jaggies on the ropes. I found in the past that having RemoveSpots before QTGMC causes the video to look a little blurry. Are there no alternatives? At the least I would like to fix the jaggies.
-
If the periods were left out of your script, it won't work. The source is kind of ragged and blurry to begin with, and I didn't even try to clean up the chroma bleed except with with whatever QTGMC does with it. That's a very low bitrate source, only 4200 bits for fast action. Won't be able to "save" much with a bitrate that low.
Last edited by sanlyn; 21st Mar 2014 at 09:28.
-
So I ran a Script #2 that doesn't deinterlace, but uses SeparateFields() to help kill the streaks and MCTemporalDenoise (low) to finish off. I wouldn't throw any more filters at it, it's already low-bitrate soft. There's still some chroma bleed/shift, etc., but by now the image is running out of data to work with.
Frame 401 shows original (left), the script with QTGMC (middle), and Script #2 with MCTD (right). Note in the original: blur, fuzzy edges, jaggies on the ropes. The jaggies won't go away entirely without oversmoothing everything, as the original has no clean edges to begin with. (Click image to enlarge)
[Attachment 17145 - Click to enlarge]
Frame 159, same as above, original (left), QTGMC (middle), script #2 with MCTD (right). Original looks more blurry to me; the others look sharper, better black levels and saturation. It could use a little more edge work, as there's still some chroma bleed/shift and ringing (some ChromaShift added as an afterhtought at the last minute). But how many filters can you throw at a problem video before there's nothing left?
[Attachment 17146 - Click to enlarge]
You have to play with various methods on a few frames until you get the compromise you want. There's no single answer.
Script #2:
Code:santiag(1,1) AssumeTFF().SeparateFields() in1 = last e=in1.SelectEven().RemoveSpots().DeVCR(20).DeBlock() o=in1.SelectOdd().RemoveSpots().DeVCR(20).DeBlock() eo=Interleave(e,o).Weave() eo ColorYUV(gamma_y=-60,off_y=3) ChromaShift(c=2,L=-2) MCTemporalDenoise(settings="low",sigma=4,AA=true,AAthr=16,method=0,\ edgeclean=true,stabilize=true,enhance=true,interlaced=true) LSFMod() AddGrainc(1.0,1.0) return last
Last edited by sanlyn; 21st Mar 2014 at 09:29.
-
OK thanks but before I try that, I'd like to get this fixed first because you said you couldn't see jagged lines with your script:
I tried the following script (the bold parts you suggested) and I could see jagged lines from between 5 - 11 seconds. I can see this on my DVD player and small TV. The video does not have those problems if I don't add the bold text and if I add the red text. So is there no way to remove the comets without causing those jagged lines to appear?
Code:setmtmode(5,9) Mpeg2Source("Video.d2v", CPU=6) setmtmode(2) McTemporalDenoise(settings="medium", interlaced=true) AssumeTFF().SeparateFields() in1 = last e=in1.SelectEven().RemoveSpots().DeVCR(20) o=in1.SelectOdd().RemoveSpots().DeVCR(20) eo=Interleave(e,o).Weave() eo QTGMC(preset="Super Fast") Vinverse() RemoveSpots() AddGrainC(var=1.0,uvar=1.0) AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave() return last Tweak(Bright=-25, Cont=1.05, Hue=10, Coring=False) ConvertToRGB32(interlaced=true) RGBAdjust(1.0,1.0,1.05) converttoyv12(interlaced=true) Crop(6,0,-12,-24) AddBorders(8,12,10,12, $000000)
-
RemoveSpots you have in red is not going to be effective. Reason: the few remaining comets are in adjacent and multiple frames, meaning that they occur often enough that they don't "look like noise" at that point. And too much RemoveSpots (which is really another version of RemoveDirt) over-smooths the image and will likely bring on banding when you encode. Note that the remaining small comets occur on moving objects, which makes things even more difficult. Yes, there is a way to get those, too -- frame by frame, moving patches of pixels around with crops and overlays.
If you click on the image I posted that shows ropes in the ring, the image will be seen full-size and you'll see that the MCTD version (script #2) has almost all the jaggies removed. That script didn't use QTGMC. It used anti-aliasing and deblocking twice. QTGMC is not innately an anti-alias or deblock filter, and in ultra-fast mode it's running at its weakest and least effective denoise and cleanup settings.Last edited by sanlyn; 21st Mar 2014 at 09:29.
-
There are several versions, but most members here use the version posted by jagabo here: https://forum.videohelp.com/threads/323127-Improve-the-quality-of-video-animation?p=201...=1#post2011595
It's a script, not a plugin. Save it to a text file as ".avs", or add it to the bottom of a script:
Code:Function santiag (clip c, int "strh", int "strv") { strh = Default (strh, 1) strv = Default (strv, 1) c (strh >= 0) ? santiag_dir (strh) : last (strv >= 0) ? TurnLeft ().santiag_dir (strv).TurnRight () : last } Function santiag_dir (clip c, int strength) { c w = Width () h = Height () santiag_stronger (strength) Spline36Resize (w, h, 0, 0.5, w, h * 2) } Function santiag_stronger (clip c, int strength) { c (strength <= 0) \ ? NNEDI3 (dh=true, field=0) \ : santiag_stronger (strength - 1) \ . NNEDI3 (dh=false, field=(strength % 2)) }
-
My script doesn't fix the comets but if you look at frames 176, 187-194, 314 for example it doesn't have any major ugly jaggies on the ropes.
Code:setmtmode(5,9) Mpeg2Source("Video.d2v", CPU=6) setmtmode(2) McTemporalDenoise(settings="medium", interlaced=true) AssumeTFF() QTGMC(preset="Super Fast") Vinverse() RemoveSpots() AddGrainC(var=1.0,uvar=1.0) SeparateFields().SelectEvery(4,0,3).Weave() Tweak(Bright=-25, Cont=1.05, Hue=10, Coring=False) ConvertToRGB32(interlaced=true) RGBAdjust(1.0,1.0,1.05) converttoyv12(interlaced=true) Crop(6,0,-12,-24) AddBorders(8,12,10,12, $000000)
Is there no way to remove the comets without causing jaggies? -
I know what's happening, but back in a few moments. All this stuff can be fixed, but will have to do a little more detailed work on this bad puppy.
Last edited by sanlyn; 21st Mar 2014 at 09:34.
-
I dragged the script into Virtual Dub and got the following message:
[Attachment 17220 - Click to enlarge]
This is the script I used:
Code:setmtmode(5,9) Mpeg2Source("X:\Test Videos\Comet Removal\Black Comets (Raw Oct 17 1994).d2v", CPU=6) setmtmode(2) # ----- repair broken lines + edges ---- w = width h = height nnedi3_rpow2(opt=2,rfactor=2,cshift="spline64resize").TurnLeft().\ NNEDI3().TurnRight().NNEDI3().spline64resize(w,h) QTGMC(preset="Super Fast") in1=last e=in1.selecteven().RemoveSpots() o=in1.selectOdd().RemoveSpots() eo=Interleave(e,o) eo AssumeTFF().SeparateFields().SelectEvery(4,0,3).weave() santiag(2,2) ColorYUV(gamma_y=-60,off_y=3) MCTemporalDenoise(settings="medium",sigma=6, edgeclean=true, stabilize=true, enhance=true, interlaced=true) LSFMod() return last
-
The error refers to QTGMC, which is trying to use RemoveGrainSSE2.dll ... You've been using QTGMC earlier, so that DLL should be in your plugins by now. Whether it can be used with "MT" I don't know, I don't use it because of the bugs, but the script has the same call to QTGMC that you've used in several of your scripts.
If you have RemoveGrain.dll and RemoveGrainSSE2.dll in the same plugins folder, you often have trouble. But as I say, QTGMC is used here in the same way you've used earlier.
I've usually seen NNEDI2 used for jaggies. It's what is used by default when you turn on anti-aliasing in MCTemporalDenoise, but MCTD only uses a single pass with it AFIIK. You can try it on a few frames, but the two NNED's don't work in exactly the same way -- which is probably why you can also use QTGMC internal settings to choose between "2" and "3" in QTGMC.Last edited by sanlyn; 21st Mar 2014 at 09:35.
-
Last edited by sanlyn; 21st Mar 2014 at 09:35.
-
It still has some comets. I found a better way to remove them all. Just use 13 passes of RemoveSpots() before QTGMC. That also removes white comets I have on another video. It blurs the video a bit and it's quite slow. On my 8 core 4.5 Ghz multi-threaded CPU I'm getting 4.6 FPS encoding speed when used with McTemporalDenoise(settings="medium", interlaced=true) and QTGMC(Preset="Super Fast").
-
-
It looks OK to me and preferable than having the comets. Is there no way to configure RemoveSpots to be more powerful instead of having to use 13 passes?
-
Well, my inauguration day!
After reading this and other threads on the subject........
.....I found this (http://www.youtube.com/watch?v=PTAO5XjhrVo) on Youtube.
I wonder if, at this stage (it has already been digitalized), AviSynth
can do anything to rid it of these mega glitches/scratches/spots.
The file (an MP4) was downloaded via www.keepvid.com. I VirtualDubbed it to AVI.
Since I am no AviSynth expert, I tried some scripts (sorry if some repeat
or overlap, I got lost) I found on Google, but NONE was of much help:
#SCRIPT1:
AviSource ("Dropouts.avi")
LoadPlugin ("E:\Program Files\AviSynth 2.5\Plugins\DeScratch\descratch.dll")
ConvertToYV12()
DeScratch (mindif=2)
--------------------------------------------------------------------------------------------
#SCRIPT2:
AviSource ("Dropouts.avi")
LoadPlugin ("E:\Program Files\AviSynth 2.5\Plugins\DeScratch\descratch.dll")
ConvertToYV12 ()
#Or ConvertToYV12 (interlaced=true)
Crop (0,0,-0,288)
input=last
AssumeTFF()
SeparateFields()
TurnLeft()
DeScratch (mindif=4, maxgap=20, minlen=300, blurlen=50, keep=100, border=0, maxangle=0)
#Descratch(asym=1,mindif=4,maxgap=20,minlen=300,bl urlen=50,keep=100,border=0,maxangle=0.0, mark=true, modeU=1, modeV=1)
#Descratch(mindif=4,maxgap=20,minlen=110,blurlen=5 0,keep=100,border=0,maxangle=0.0,modeU=1,modeV=1,m indifUV=0,mark=false)
TurnRight()
Weave()
StackVertical (input,last)
--------------------------------------------------------------------------------------------
#SCRIPT3:
AviSource ("Dropouts.avi")
ConvertToYV12()
LoadPlugin ("E:\Program Files\AviSynth 2.5\plugins\DeScratch\descratch.dll")
turnleft()
DeScratch (mindif=4, maxgap=20, minlen=300, blurlen=50, keep=100, border=0, maxangle=0, mark=false)
turnright()
#DeScratch(mindif=5)
#DeScratch(maxgap=55)
#DeScratch(keep=0)
#DeScratch(mark=true)
---------------------------------------------------------------------------------------------
#SCRIPT4:
AviSource ("Dropouts.avi")
AssumeTFF()
SeparateFields()
in1 = last
e=in1.SelectEven().RemoveSpots().DeVCR(20) #THERE'S NO FUNCTION NAMED "SCSELECT" (RemoveSpots.avsi, line 9) (*)
o=in1.SelectOdd().RemoveSpots().DeVCR(20)
eo=Interleave(e,o).Weave()
eo
ColorYUV(gamma_y=-60,off_y=3)
QTGMC(preset="fast")
DeBlock()
AddGrainc(1.0,1.0)
AssumeTFF().SeparateFields().SelectEvery(4,0,3).We ave()
return last
#(*) RemoveSpots.avsi is in AviSynth/Plugins folder:
#Line 9: alt=Repair(SCSelect(input, sbegin, send, clensed, debug=true), input, mode=repmode, modeU = _grey ? -1 : repmode)
--------------------------------------------------------------------------------------------
#SCRIPT5:
AviSource ("Dropouts.avi")
santiag(1,1)
AssumeTFF()
SeparateFields()
in1 = last
e=in1.SelectEven().RemoveSpots().DeVCR(20).DeBlock () #THERE'S NO FUNCTION NAMED RemoveSpots
o=in1.SelectOdd().RemoveSpots().DeVCR(20).DeBlock( )
eo=Interleave(e,o).Weave()
eo
ColorYUV(gamma_y=-60,off_y=3)
ChromaShift(c=2,L=-2)
MCTemporalDenoise(settings="low",sigma=4,AA=true,A Athr=16,method=0,\
edgeclean=true,stabilize=true,enhance=true,interla ced=true)
LSFMod()
AddGrainc(1.0,1.0)
return last
--------------------------------------------------------------------------------------------
#SCRIPT6:
setmtmode(5,9)
AviSource("Dropouts.avi")
setmtmode(2)
McTemporalDenoise(settings="medium", interlaced=true) #THERE'S NO FUNCTION NAMED McTemporalDenoise
AssumeTFF().SeparateFields()
in1 = last
e=in1.SelectEven().RemoveSpots().DeVCR(20)
o=in1.SelectOdd().RemoveSpots().DeVCR(20)
eo=Interleave(e,o).Weave()
eo
QTGMC(preset="Super Fast")
Vinverse() RemoveSpots() AddGrainC(var=1.0,uvar=1.0)
AssumeTFF().SeparateFields().SelectEvery(4,0,3).We ave()
return last
Tweak(Bright=-25, Cont=1.05, Hue=10, Coring=False)
ConvertToRGB32(interlaced=true) RGBAdjust(1.0,1.0,1.05) converttoyv12(interlaced=true)
Crop(6,0,-12,-24)
AddBorders(8,12,10,12, $000000)
--------------------------------------------------------------------------------------------
#SCRIPT7:
LoadPlugin("E:\Program Files\AviSynth 2.5\plugins\Convolution3d.dll")
Loadplugin("E:\Program Files\AviSynth 2.5\plugins\avisynth_c.dll") #I put this file in the Plugins folder
LoadPlugin("E:\Program Files\AviSynth 2.5\plugins\DeSpot\despot.dll")
avisource("Dropouts.avi")
SeparateFields()
odd=SelectOdd.Convolution3D (0, 6, 10, 6, 8, 2.8, 0)
evn=SelectEven.Convolution3D (0, 6, 10, 6, 8, 2.8, 0)
Interleave(evn,odd)
Weave()
ConvertToYV12(interlaced=true)
despot(interlaced=true)
ConvertToYUY2(interlaced=true)
--------------------------------------------------------------------------------------------
#SCRIPT8:
AviSource ("Dropouts.avi")
LoadPlugin("E:\Program Files\AviSynth 2.5\plugins\DeSpot\despot.dll")
ConvertToYV12()
#Crop(0,0,720,288) #to show test
i = last
# Compare half-frames with and without noise reduction
DeSpot(p1=35, p2=14, pwidth=70, pheight=70, mthres=25, mwidth=20, mheight=15, interlaced=false,
\ merode=33, ranked=false, p1percent=0, dilate=0, fitluma=false, blur=0, motpn=false, seg=0)
StackHorizontal(i, last)
--------------------------------------------------------------------------------------------
#SCRIPT9:
AviSource ("Dropouts.avi")
LoadPlugin("E:\Program Files\AviSynth 2.5\plugins\DeSpot\despot.dll")
ConvertToYV12()
#Crop(0,0,720,288)
# Compare frames with blur, and with and without temporal noise reduction
i = last
# Compare half-frames with and without noise reduction
b = DeSpot(i, p1=35, p2=14, pwidth=70, pheight=70, mthres=25, mwidth=20, mheight=15, interlaced=false,
\ merode=33, ranked=false, p1percent=0, dilate=0, fitluma=false, blur=4, motpn=false, seg=0)
t = DeSpot(i, p1=35, p2=14, pwidth=70, pheight=70, mthres=25, mwidth=20, mheight=15, interlaced=false,
\ merode=33, ranked=false, p1percent=0, dilate=0, fitluma=false, blur=4, motpn=false, seg=0, tsmooth=3)
StackHorizontal(b, t)
Can the clip on the link be redeemed?
Similar Threads
-
How to remove tint with Avisynth?
By VideoFanatic in forum RestorationReplies: 55Last Post: 6th Oct 2013, 16:24 -
How to remove brown colour with Avisynth?
By VideoFanatic in forum RestorationReplies: 28Last Post: 13th Feb 2013, 00:17 -
Remove an opaque logo using Xlogo in Avisynth
By AlanHK in forum User guidesReplies: 34Last Post: 4th Oct 2012, 23:17 -
white streaks, black streaks, comets, dropouts
By jmac698 in forum Capturing and VCRReplies: 6Last Post: 8th Mar 2012, 08:07 -
sort of black comets' trails in hi8 video
By mammo1789 in forum RestorationReplies: 43Last Post: 1st Nov 2011, 21:19