Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th March 2015, 04:13   #1  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
VHS chroma edge ghosting

I got a VHS cap with chroma edge ghosting

sample http://www.solidfiles.com/d/cabdf11b..._0_07-2_OP.mp4

click (Direct download link) for Direct download

Code:
ffmpegSource2("D:\Toei_0_07-2_OP.mp4")
TFm.TDecimate
ConvertToYV12
vToY
frame 122 http://a.pomf.se/zhrjvi.png

with pointing 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/8f9f7c9d..._0_07-2_OP.avi

with the avi sample you can get the original Chroma subsampling with LWLibavVideoSource
__________________
See My Avisynth Stuff

Last edited by real.finder; 1st February 2017 at 02:16.
real.finder is offline   Reply With Quote
Old 29th March 2015, 05:23   #2  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
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?
johnmeyer is offline   Reply With Quote
Old 29th March 2015, 05:36   #3  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by johnmeyer View Post
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?


like I say above
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 29th March 2015, 07:39   #4  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
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.
johnmeyer is offline   Reply With Quote
Old 30th March 2015, 00:26   #5  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by johnmeyer View Post
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
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 30th March 2015, 02:57   #6  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
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 is offline   Reply With Quote
Old 30th March 2015, 03:12   #7  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
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:

Code:
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 is offline   Reply With Quote
Old 30th March 2015, 04:27   #8  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by johnmeyer View Post
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:

Code:
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
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 30th March 2015, 04:01   #9  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
Actually, on second thought, I think my script makes it worse.
johnmeyer is offline   Reply With Quote
Old 30th March 2015, 04:39   #10  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
You missed my previous post: I said that, on second thought, it didn't work very well.
johnmeyer is offline   Reply With Quote
Old 30th March 2015, 10:09   #11  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by johnmeyer View Post
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

Code:
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
__________________
See My Avisynth Stuff

Last edited by real.finder; 31st March 2015 at 01:22.
real.finder is offline   Reply With Quote
Old 30th March 2015, 15:48   #12  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
There have been several other posts in the past three months about similar issues. You might search those threads.
johnmeyer is offline   Reply With Quote
Old 30th March 2015, 18:57   #13  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by johnmeyer View Post
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?
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 30th March 2015, 23:50   #14  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
I note chroma horizontal shift between ffms2 and L-SMASH Source

Code:
 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

Code:
ffVideoSource("D:\Toei_0_07-2_OP.avi").AssumeBFF()
Mention that ffVideoSource out yuy2 but the source is yv411
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 31st March 2015, 04:03   #15  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
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
__________________
See My Avisynth Stuff

Last edited by real.finder; 31st March 2015 at 04:09.
real.finder is offline   Reply With Quote
Old 31st March 2015, 05:10   #16  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Not sure if this will help or not but have you tried any of the ghost removal filters from the WarpSharp package?
Reel.Deel is offline   Reply With Quote
Old 31st March 2015, 08:49   #17  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by Reel.Deel View Post
Not sure if this will help or not but have you tried any of the ghost removal filters from the WarpSharp package?
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.ph...50#post1715450
__________________
See My Avisynth Stuff

Last edited by real.finder; 31st March 2015 at 08:53.
real.finder is offline   Reply With Quote
Old 2nd April 2015, 00:43   #18  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
I find a solution with Camcorder color denoise http://acobw.narod.ru/

Code:
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

Code:
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
Code:
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
Code:
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
__________________
See My Avisynth Stuff

Last edited by real.finder; 4th April 2015 at 12:48.
real.finder is offline   Reply With Quote
Old 29th January 2017, 07:27   #19  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
if anyone has this type of artifacts, I made something can deal with it, it's chromasidebleed() in the same script that has sanimebob()
__________________
See My Avisynth Stuff

Last edited by real.finder; 5th February 2017 at 08:47.
real.finder is offline   Reply With Quote
Old 31st January 2017, 23:43   #20  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 108
Thanks, but could you reupload the pictures? I don't know what the artifact looked like.
magiblot is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:14.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.