View Full Version : VHS chroma edge ghosting
real.finder
29th March 2015, 04:13
I got a VHS cap with chroma edge ghosting
sample http://www.solidfiles.com/d/cabdf11b35/Toei_0_07-2_OP.mp4
click (Direct download link) for Direct download
ffmpegSource2("D:\Toei_0_07-2_OP.mp4")
TFm.TDecimate
ConvertToYV12
vToY
frame 122 http://a.pomf.se/zhrjvi.png (http://web.archive.org/web/20150611203615/http://a.pomf.se/zhrjvi.png)
with pointing http://a.pomf.se/lszbfa.png (http://web.archive.org/web/20150611024932/http://a.pomf.se/lszbfa.png)
How to remove this?! it cause chroma artifacts
Thanks in advance
note: the scan order is Bottom Field First
addition: and this avi muxed from original .dv with aviddmux http://www.solidfiles.com/d/8f9f7c9d27/Toei_0_07-2_OP.avi
with the avi sample you can get the original Chroma subsampling with LWLibavVideoSource
johnmeyer
29th March 2015, 05:23
When I click on the download link, and then try to begin the download by clicking on the "download" button, your site lists it as an EXE file, not an MP4 file. Should I be concerned?
real.finder
29th March 2015, 05:36
When I click on the download link, and then try to begin the download by clicking on the "download" button, your site lists it as an EXE file, not an MP4 file. Should I be concerned?
http://a.pomf.se/vbptsh.png
like I say above
johnmeyer
29th March 2015, 07:39
Ah, I see, click on the tiny text link, not the big download button. I wonder what sort of people create schemes like this?
I'll try to look at it tomorrow.
real.finder
30th March 2015, 00:26
Ah, I see, click on the tiny text link, not the big download button. I wonder what sort of people create schemes like this?
I'll try to look at it tomorrow.
Thank you, waiting for you :)
johnmeyer
30th March 2015, 02:57
I downloaded the MP4, but couldn't get anything to play it. I converted it to an uncompressed AVI using ffmpeg (something that almost always works), but nothing would play that either. I don't know if the problem is on my end or yours, but whatever the reason, I won't be able to help on this one.
johnmeyer
30th March 2015, 03:12
I finally got a conversion with ffmpeg. I didn't try to IVTC the source, but instead just dealt with it as is. The old chroma shift designed for 2nd generation video seems to help a little. Try this out:
Loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools2.dll")
source=AVISource("E:\Documents\Dnload\UNPACK\7z\ffmpeg-20150311-git-2e5605f-win32-static\ffmpeg-20150311-git-2e5605f-win32-static\bin\output.avi").killaudio().AssumeBFF()
output=MDegrain2i2(source,8,0,0)
stackhorizontal(source,output)
#return output
#-------------------------------
function MDegrain2i2(clip source, int "blksize", int "overlap", int "dct")
{
Vshift=2 # 2 lines per bobbed-field per tape generation (PAL); original=2; copy=4 etc
Hshift=2 # 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
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
#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)
MDegrain2(fields,super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400)
Weave()
}
Experiment with VShift and HShift.
johnmeyer
30th March 2015, 04:01
Actually, on second thought, I think my script makes it worse.
real.finder
30th March 2015, 04:27
I finally got a conversion with ffmpeg. I didn't try to IVTC the source, but instead just dealt with it as is. The old chroma shift designed for 2nd generation video seems to help a little. Try this out:
Loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools2.dll")
source=AVISource("E:\Documents\Dnload\UNPACK\7z\ffmpeg-20150311-git-2e5605f-win32-static\ffmpeg-20150311-git-2e5605f-win32-static\bin\output.avi").killaudio().AssumeBFF()
output=MDegrain2i2(source,8,0,0)
stackhorizontal(source,output)
#return output
#-------------------------------
function MDegrain2i2(clip source, int "blksize", int "overlap", int "dct")
{
Vshift=2 # 2 lines per bobbed-field per tape generation (PAL); original=2; copy=4 etc
Hshift=2 # 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
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
#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)
MDegrain2(fields,super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400)
Weave()
}
Experiment with VShift and HShift.
it is still there http://i.imgur.com/Lp7HFs2.png
johnmeyer
30th March 2015, 04:39
You missed my previous post: I said that, on second thought, it didn't work very well.
real.finder
30th March 2015, 10:09
You missed my previous post: I said that, on second thought, it didn't work very well.
that right
thank you anyway :)
my last best try is
LWLibavVideoSource("D:\Toei_0_07-2_OP.avi", cache=false, dr=true).Crop(0,0,-16,0).AssumeBFF()
SeparateFields
y=last.ConvertToYv12.LGhost(1,4,80,2,20,2,3,4,-80).ConvertToY8()
u=uToY.LGhost(4,5,40,1,5,-50).ConvertToY8()
v=vToY.Invert.LGhost(1,5,-50).ConvertToYUY2.FixVHSOversharp(10,10,8).ConvertToY8().Invert
YToUV(U, V, y)
Weave
ConvertToyuy2(interlaced=true)
TComb(1)
import(AviSynthPluginsDir + "AnimeIVTC 2 mod.avs")
AnimeIVTC(1)
FixChromaBleedingMod(-2, 2, thr=4.0, f=false, xysh=true, bic=true, strength=1.0, opacity=1.0)
ConvertToyv12()
aWarpSharp4xx(depth=4,chroma=6).aWarpSharp4xx(depth=20,chroma=6).aWarpSharp4xx(depth=-2,chroma=6)
#~ vtoy
Better than nothing, but the problem still exists :(
johnmeyer
30th March 2015, 15:48
There have been several other posts in the past three months about similar issues. You might search those threads.
real.finder
30th March 2015, 18:57
There have been several other posts in the past three months about similar issues. You might search those threads.
I already did, and did not find what I want, Could you put their link please?
real.finder
30th March 2015, 23:50
I note chroma horizontal shift between ffms2 and L-SMASH Source
LWLibavVideoSource("D:\Toei_0_07-2_OP.avi", cache=false, dr=true).Crop(0,0,-16,0).AssumeBFF() # or even LWLibavVideoSource("D:\Toei_0_07-2_OP.avi", cache=false).AssumeBFF()
ConvertToyuy2(interlaced=true)
and
ffVideoSource("D:\Toei_0_07-2_OP.avi").AssumeBFF()
Mention that ffVideoSource out yuy2 but the source is yv411
real.finder
31st March 2015, 04:03
I think the Solution Key is the ghosting relationship between chroma and luma
so my try above not remove the most problem effect
in my mind some Ideas to make a horizontal luma mask and then shift it, but that seems not possible; and another one is to use MT_makediff in luma with the source and the filtered luma from ghosting and then use the output of MT_makediff in chroma with MT_adddiff, I didn't try that yet, but I think that If I skipped the different dimensions issue between chroma and luma, the probability of success is not big
Reel.Deel
31st March 2015, 05:10
Not sure if this will help or not but have you tried any of the ghost removal filters from the WarpSharp package (http://avisynth.nl/index.php/WarpSharp)?
real.finder
31st March 2015, 08:49
Not sure if this will help or not but have you tried any of the ghost removal filters from the WarpSharp package (http://avisynth.nl/index.php/WarpSharp)?
yes, it work in luma only and for temporary ghost and need both SearchGhost and EraseGhost to work
it is for VHF and UHF Signal I think, my cases is something different, it not temporary ghost, it Spatial
here some info to something similar to my cases http://forum.doom9.org/showthread.php?p=1715450#post1715450
real.finder
2nd April 2015, 00:43
I find a solution with Camcorder color denoise http://acobw.narod.ru/
LWLibavVideoSource("D:\Toei_0_07-2_OP.avi", cache=false, dr=true).Crop(0,0,-16,0).AssumeBFF()
MergeLuma(last.ConvertToYv12.LGhost(1,4,80,2,20,2,3,4,-80).ConvertToYv411())
LoadVirtualDubPlugin("D:\ccd.vdf", "ccd", 0)
ConvertToRGB32(interlaced=true)
ccd(70,1)
ConvertToYV411(interlaced=true)
vToY
SeparateFields
or to avoid ConvertToRGB Issues
LWLibavVideoSource("D:\Toei_0_07-2_OP.avi", cache=false, dr=true).Crop(0,0,-16,0).AssumeBFF()
MergeLuma(last.ConvertToYv12.LGhost(1,4,80,2,20,2,3,4,-80).ConvertToYv411())
o=last
LoadVirtualDubPlugin("D:\ccd.vdf", "ccd", 0)
ConvertToRGB32(interlaced=true)
ccd(70,1)
ConvertToYV411(interlaced=true)
orgb=o.ConvertToRGB32(interlaced=true).ConvertToYV411(interlaced=true)
udif=mt_makediff(last.utoy8,orgb.utoy8)
vdif=mt_makediff(last.vtoy8,orgb.vtoy8)
u=mt_adddiff(udif,o.utoy8)
v=mt_adddiff(vdif,o.vtoy8)
YToUV(U, V, o.ConvertToY8)
vToY
SeparateFields
plus, I note something else in the source, chroma difference between the top field and bottom field, seems that this source has every illnesses :( anyway this fix it
SeparateFields()
Interleave(last.SelectEven.Tweak(4),last.SelectOdd)
Weave() after the source call
edit: ConvertToRGB32(interlaced=true) then ConvertToYV411(interlaced=true) it self reduce the problem, so in the 2nd script the problem still exist
so this is the 1st one with some changes
LWLibavVideoSource("D:\Toei_0_07-2_OP.avi", cache=false, dr=true).Crop(0,0,-16,0).AssumeBFF()
SeparateFields()
#Interleave(last.SelectEven.Tweak(4),last.SelectOdd)
Interleave(last.SelectEven,last.SelectOdd.Tweak(4))
Weave()
MergeLuma(last.ConvertToYv12.LGhost(1,4,80,2,20,2,3,4,-80).ConvertToYv411())
o=last
LoadVirtualDubPlugin("D:\ccd.vdf", "ccd", 0)
ConvertToRGB32(interlaced=true)
ccd(70,1)
ConvertToYV411(interlaced=true)
MergeLuma(o)
vToY
SeparateFields
real.finder
29th January 2017, 07:27
if anyone has this type of artifacts, I made something can deal with it, it's chromasidebleed() in the same script that has sanimebob()
magiblot
31st January 2017, 23:43
Thanks, but could you reupload the pictures? I don't know what the artifact looked like.
real.finder
1st February 2017, 02:13
Thanks, but could you reupload the pictures? I don't know what the artifact looked like.
done with archive link
and there are another one here https://forum.doom9.org/showpost.php?p=1715275&postcount=9
tuanden0
2nd February 2017, 06:30
I have this problem too but with the textsub :(
When I hardsub the anime to watch on my TV or my tablet, the artifacts appear around the subtitles and the intro text in OP and ED :(
Can someone give me advice?
Source: http://i.imgur.com/UrP2tXw.png
After encode: http://i.imgur.com/lNleGp7.png
Here's my script:
SetMemoryMax(2048)
SetFilterMTMode("LSMASHVideoSource,TextSub,FFT3Dfilter",3)
SetFilterMTMode("gradfun2db",2)
LSMASHVideoSource("E:\abcxyz.mp4")
AssumeFPS(24000, 1001)
FFT3Dfilter(sigma=3.2,sigma2=2.4,sigma3=1.6,sigma4=0.8,bw=16,bh=16,ow=8,oh=8,bt=1,ncpu=4,sharpen=0.3).gradfun2db(thr=1.2)
TextSub("abcxyz.ass", 1)
Prefetch(4)
Here's my x264 setting on meGUI:
--level 4.1 --preset veryslow --tune animation --crf 26.0 --deblock -1:-1 --bframes 5 --ref 6
blaze077
2nd February 2017, 07:00
Can someone give me advice?
Those seem to be compression artifacts caused due to your x264 settings. You might want to lower your CRF for better quality and those artifacts should be gone. 26 is a very high CRF value for anime so going lower would definitely benefit you.
tuanden0
2nd February 2017, 13:17
@blaze077 :thanks: for your reply
My problem's solved, just decreasse AQ strength and Psy-rd :o Maybe some artifacts still there but the output look better :D
Gordon at GTH
31st January 2025, 14:38
I know this is an oldish thread but if anyone still has problems with Chroma Blur or what I called Colour Bleed (Horizontal) or Colour Droop (Vertical) then look here: http://www.gthelectronics.com/cobleed.htm or http://www.gthelectronics.com/codroop.htm. I now use and recommend Ffmpeg for correcting this and have put some batch files here: http://www.gthelectronics.com/ffmpeg.htm. These allow you to check the correct shift required and then process with end result of MP4 or MPEG-2 for a DVD. I am happy to answer any questions by email or here.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.