#1  
02-01-2023, 08:27 PM
numgis numgis is offline
Free Member
 
Join Date: Nov 2022
Posts: 7
Thanked 0 Times in 0 Posts
First of all I would like to thank you all for your contributions. I've recently embarked on a rather large project to digitize my VHS and 8mm tape collection and I've learned a ton from reading these forums, especially from posts by lordsmurf and lollo.

I've tried a bunch of capture cards from Amazon but had various issues with each.. some tracked well but output was very grainy video, others had good quality video but did not track causing dropped frames and/or AV sync issues. I finally tried my old Sony DV camcorder and it seems to do the best job of tracking while still producing a decent picture, and most of all, keeping video and audio in sync which became a huge issue with some other capture devices. I unfortunately do not have access to a TBS device and although I own a JVC HR-S7600U with TBS, it only worked for one tape and now suffers from the famous shutdown issue whenever I load a tape. I'm therefore stuck using my old Hitachi VCR as the source, which actually produces a decent picture albeit only over composite output.

Anyways, I'm now able to capture and output to MP4 with good results, however my last remaining issue is this.. how can I improve the color in my final video? When I run the AviSynth+ script through FFmpeg the colors are altered.. the resulting video is different than in the AvsPmod preview. I've pulled my hair out trying to figure out why. What am I doing wrong?

I've attached a short sample AVI video along with my AviSynth+ script (much of it based on samples provided by @lollo5468 on YouTube). How would you improve the colors in the final video by modifying my script? The reds are kind of intense yet the video seems washed out and somewhat dull overall. I'm reducing RGB values by about 10% in the Matrix function as otherwise the whites are completely blown off the scale. FFmpegSource2 seems to bring in full range values vs AVISource which brings limited range. When Frame Serving from VirtualDub I have to use AVISource, finally figured out I can fix this variance by setting Matrix values a=16, b=235 instead of a=0, b=255.

I want to upload the final to YouTube hence I'm up-scaling to 1080p and changing color profile to Rec.709.

This is the FFmpeg command I use to create the final MP4. I've tried to hard code bt709 color space as otherwise FFmpeg for some reason defaults to something else and the end result looks worse.

Code:
ffmpeg.exe -i street.avs -crf 22 -preset slower -tune film -profile high -color_range 1 -color_primaries 1 -color_trc 1 -colorspace 1 -x264opts colormatrix=bt709 -movflags +faststart+write_colr street.mp4
Full AviSynth+ script is attached but also below for reference:

Code:
video="street.avi"
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
FFmpegSource2(video, atrack=1)
ConvertToYV12(interlaced=true)
Matrix(from=601, to=709, rg=0.88, gg=0.90, bg=0.90, a=0, b=255, ao=0, bo=255, bitdepth=8)
AssumeBFF()
QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, tr1=2, tr2=1, NoiseTR=2, sharpness=0.1, EdiThreads=5)
TemporalDegrain2(degrainTR=3)
Crop(4,0,-8,-8)
nnedi3_rpow2(rfactor=2, nns=4, qual=2, cshift="Spline36Resize", fwidth=1440, fheight=1080)
LSFmod(defaults="slow")
#TurnRight().Histogram().TurnLeft()
Prefetch(18)
Thanks in advance for your input!


Attached Files
File Type: avi street.avi (35.58 MB, 4 downloads)
File Type: avs street.avs (591 Bytes, 1 downloads)
File Type: mp4 street_red88.mp4 (7.65 MB, 6 downloads)
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
02-02-2023, 09:11 AM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 637
Thanked 177 Times in 154 Posts
Thanks numgis!

For a serious color correction task, AviSynth has limited feature, you may want to try someting like DaVinci Resolve.

However, find thereafter a quick attempt from my side on your video. Always check the levels and the right colorspace when moving inside AviSynth and feeding VirtualDub. It's easy to introduce errors.

The script, based just on level correction, marginal color correction through saturation and contrast, deinterlace, denoise and upscale; splitted in 3 parts to speed-up processing time:

Code:
video_org=DirectShowSource("street.avi")

# separate fields tff
video_org_sep_tff=video_org.AssumeTFF().separateFields()

# separate fields bff
video_org_sep_bff=video_org.AssumeBFF().separateFields()

# separate fields tff even
video_org_sep_tff_even=video_org_sep_tff.SelectEven()

# separate fields tff odd
video_org_sep_tff_odd=video_org_sep_tff.SelectOdd()

	# to check if progressive or interlaced
#return(video_org_sep_tff)
#return(video_org_sep_bff)

	# to check if TFF or BFF for interlaced segments
#stackhorizontal(\
#subtitle(video_org_sep_tff,"video_org_sep_tff",size=28,align=2),\
#subtitle(video_org_sep_bff,"video_org_sep_bff",size=28,align=2)\
#)

# cropping 
	crop_left=4	# | rimozione esatta delle bande nere sinistra, sopra, destra e del disturbo sotto	
	crop_top=2	# | 720-(4+8)x480-(8+8)=708x470
	crop_right=8
	crop_bottom=8
video_org_crop=video_org.crop(crop_left,crop_top,-crop_right,-crop_bottom)

# convert to YV16 (required for Histogram)
video_org_crop_yv16=video_org_crop.ConvertToYV16()

# analysis
video_histogram=video_org_crop_yv16.Histogram("Levels")

#return(video_histogram)

# plugins directory
plugins_dir="C:\Users\giuse\Documents\VideoSoft\MPEG\AviSynth\extFilters\"

	# LevelsLumaOnly
Import(plugins_dir + "LevelsLumaOnly_modGMa.avsi")

### levels and colors correction
noise_baseclip=video_org_crop.\
			ColorYUV(cont_y=0,off_y=0,off_v=0,off_u=0).\
			Tweak(cont=0.9,sat=1.2,bright=0,dither=true,coring=false).\
			LevelsLumaOnly(16,1.05,255,16,235,dither=true,coring=false)

noise_baseclip_addborders=noise_baseclip.addborders(crop_left,crop_top,crop_right,crop_bottom)

#stackhorizontal(\
#interleave(\
#subtitle(video_org,"video_org",size=28,align=2),\
#subtitle(noise_baseclip_addborders,"noise_baseclip_addborders",size=28,align=2)\
#)
#return(noise_baseclip_addborders)

	# QTGMC
Import(plugins_dir + "QTGMC.avsi")
	# Zs_RF_Shared
Import(plugins_dir + "Zs_RF_Shared.avsi")

	# TemporalDegrain2
Import(plugins_dir + "TemporalDegrain-v2.2.1_modGMa.avsi")
	# RgTools
loadPlugin(plugins_dir + "RgTools-v1.0\x86\RgTools.dll")
	# MaskTools2
loadPlugin(plugins_dir + "masktools2-v2.2.23\x86\masktools2.dll")
	# MVTools
loadPlugin(plugins_dir + "mvtools-2.7.41-with-depans20200430\x86\mvtools2.dll")
	# FFT3DFilter
loadPlugin(plugins_dir + "FFT3dFilter-v2.6\x86\fft3dfilter.dll")
	# FFTW
loadPlugin(plugins_dir + "LoadDll\LoadDll.dll")
loadDll(plugins_dir + "fftw-3.3.5-dll32\libfftw3f-3.dll")

	# LSFmod
Import(plugins_dir + "LSFmod.v1.9.avsi")
	# RgTools
#loadPlugin(plugins_dir + "RgTools-v1.0\x86\RgTools.dll")
	# MaskTools2
#loadPlugin(plugins_dir + "masktools2-v2.2.23\x86\masktools2.dll")

	# ColorMatrix
LoadPlugin(plugins_dir + "ColorMatrix\ColorMatrix.dll")

	# Nnedi3
loadPlugin(plugins_dir + "NNEDI3_v0_9_4_55\x86\Release_W7\nnedi3.dll")

### de-interlacing
deinterlaced=noise_baseclip.AssumeBFF().QTGMC(preset="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, tr1=2, tr2=1, NoiseTR=2, sharpness=0.1)

return(deinterlaced)
Code:
video_org=AviSource("tmp.avi")

# cropping 
	crop_left=4	# | rimozione esatta delle bande nere sinistra, sopra, destra e del disturbo sotto	
	crop_top=2	# | 720-(4+8)x480-(8+8)=708x470
	crop_right=8
	crop_bottom=8

# plugins directory
plugins_dir="C:\Users\giuse\Documents\VideoSoft\MPEG\AviSynth\extFilters\"

	# LevelsLumaOnly
Import(plugins_dir + "LevelsLumaOnly_modGMa.avsi")

	# QTGMC
Import(plugins_dir + "QTGMC.avsi")
	# Zs_RF_Shared
Import(plugins_dir + "Zs_RF_Shared.avsi")

	# TemporalDegrain2
Import(plugins_dir + "TemporalDegrain-v2.2.1_modGMa.avsi")
	# RgTools
loadPlugin(plugins_dir + "RgTools-v1.0\x86\RgTools.dll")
	# MaskTools2
loadPlugin(plugins_dir + "masktools2-v2.2.23\x86\masktools2.dll")
	# MVTools
loadPlugin(plugins_dir + "mvtools-2.7.41-with-depans20200430\x86\mvtools2.dll")
	# FFT3DFilter
loadPlugin(plugins_dir + "FFT3dFilter-v2.6\x86\fft3dfilter.dll")
	# FFTW
loadPlugin(plugins_dir + "LoadDll\LoadDll.dll")
loadDll(plugins_dir + "fftw-3.3.5-dll32\libfftw3f-3.dll")

	# LSFmod
Import(plugins_dir + "LSFmod.v1.9.avsi")
	# RgTools
#loadPlugin(plugins_dir + "RgTools-v1.0\x86\RgTools.dll")
	# MaskTools2
#loadPlugin(plugins_dir + "masktools2-v2.2.23\x86\masktools2.dll")

	# ColorMatrix
LoadPlugin(plugins_dir + "ColorMatrix\ColorMatrix.dll")

	# Nnedi3
loadPlugin(plugins_dir + "NNEDI3_v0_9_4_55\x86\Release_W7\nnedi3.dll")

### convert to YV16
deinterlaced_yv16=video_org.convertToYV16()
### denoising
denoised_yv16=deinterlaced_yv16.TemporalDegrain2(degrainTR=3)
### convert to YUY2
denoised=denoised_yv16.convertToYUY2()
### change color matrix
denoised_cm=denoised.Colormatrix("Rec.601->Rec.709")
### add borders
denoised_cm_borders=denoised_cm.addborders((crop_left+crop_right)/2,(crop_top+crop_bottom)/2,(crop_left+crop_right)/2,(crop_top+crop_bottom)/2)

return(denoised_cm_borders)
Code:
video_org=AviSource("tmp2.avi")

# plugins directory
plugins_dir="C:\Users\giuse\Documents\VideoSoft\MPEG\AviSynth\extFilters\"

	# LevelsLumaOnly
Import(plugins_dir + "LevelsLumaOnly_modGMa.avsi")

	# QTGMC
Import(plugins_dir + "QTGMC.avsi")
	# Zs_RF_Shared
Import(plugins_dir + "Zs_RF_Shared.avsi")

	# TemporalDegrain2
Import(plugins_dir + "TemporalDegrain-v2.2.1_modGMa.avsi")
	# RgTools
loadPlugin(plugins_dir + "RgTools-v1.0\x86\RgTools.dll")
	# MaskTools2
loadPlugin(plugins_dir + "masktools2-v2.2.23\x86\masktools2.dll")
	# MVTools
loadPlugin(plugins_dir + "mvtools-2.7.41-with-depans20200430\x86\mvtools2.dll")
	# FFT3DFilter
loadPlugin(plugins_dir + "FFT3dFilter-v2.6\x86\fft3dfilter.dll")
	# FFTW
loadPlugin(plugins_dir + "LoadDll\LoadDll.dll")
loadDll(plugins_dir + "fftw-3.3.5-dll32\libfftw3f-3.dll")

	# LSFmod
Import(plugins_dir + "LSFmod.v1.9.avsi")
	# RgTools
#loadPlugin(plugins_dir + "RgTools-v1.0\x86\RgTools.dll")
	# MaskTools2
#loadPlugin(plugins_dir + "masktools2-v2.2.23\x86\masktools2.dll")

	# ColorMatrix
LoadPlugin(plugins_dir + "ColorMatrix\ColorMatrix.dll")

	# Nnedi3
loadPlugin(plugins_dir + "NNEDI3_v0_9_4_55\x86\Release_W7\nnedi3.dll")

### upscale
upscaled=video_org.nnedi3_rpow2(rfactor=2, nns=4, qual=2, cshift="Spline36Resize", fwidth=1440, fheight=1080)
### convert to YV12
upscaled_yv12=upscaled.convertToYV12()
### sharpening
sharpened_yv12=upscaled_yv12.LSFmod(defaults="slow")
### convert to YUY2 with chroma from YUY2 color space
sharpened=sharpened_yv12.convertToYUY2().MergeChroma(upscaled)

return(sharpened)
Here the final result: tmp3_cut.avi

Here some comparison between original and restored video: https://imgsli.com/MTUyMjYx

and between your red88 attempt and restored video (not big difference): https://imgsli.com/MTUyMjYy

You can upload to youtube the output of the processing in HuffYUV lossless form, no need to compress.

To compress for distribution, simply use:

Code:
ffmpeg.exe -i <input>.avs -c:v libx264 -crf 17 -preset slow -aspect 4:3 -c:a aac -b:a 128k <output>.mp4
Here custom functions used in the script:

Code:
function LevelsLumaOnly(clip c,
\                       int input_low, float gamma, int input_high,
\                       int output_low, int output_high, bool "coring", bool "dither")
{
    return MergeChroma(c.Levels(input_low, gamma, input_high,
    \                           output_low, output_high, coring=coring, dither=dither),
    \                  c)
}
and the comparison script:

Code:
video_dir_1=".\"
#video_1="street.avi"
video_1="street_red88.mp4"

video_dir_2=".\"
video_2="tmp3.avi"

# plugins directory
plugins_dir="C:\Users\giuse\Documents\VideoSoft\MPEG\AviSynth\extFilters\"

	# ColorMatrix
LoadPlugin(plugins_dir + "ColorMatrix\ColorMatrix.dll")

	# Nnedi3
loadPlugin(plugins_dir + "NNEDI3_v0_9_4_55\x86\Release_W7\nnedi3.dll")

	# FFmpegSource
loadPlugin(plugins_dir + "ffms2_87bae19\x86\ffms2.dll")

#v1=DirectShowSource(video_dir_1+video_1).crop(4,2,-8,-8).addborders(6,5,6,5).SelectEvery(1,0,0).Colormatrix("Rec.601->Rec.709").nnedi3_rpow2(rfactor=2, nns=4, qual=2, cshift="Spline36Resize", fwidth=1440, fheight=1080)
v1=FFmpegSource2(video_dir_1+video_1).convertToYUY2()
v2=AviSource(video_dir_2+video_2)

f_stackhorizontal(v1,v2,video_1,video_2)
f_interleave(v1,v2,video_1,video_2)
#f_Subtract_Compare(v1,v2,video_1,video_2)


function f_stackhorizontal(clip c1, clip c2, string t1, string t2)
{
stackhorizontal(\
subtitle(c1,t1,size=20,align=2),\
subtitle(c2,t2,size=20,align=2)\
)
}

function f_interleave(clip c1, clip c2, string t1, string t2)
{
interleave(\
subtitle(c1,t1,size=20,align=2),\
subtitle(c2,t2,size=20,align=2)\
)
}

function f_Subtract_Compare(clip c1, clip c2, string t1, string t2)
{
c3=Subtract(c1, c2).Levels(65, 1, 255-64, 0, 255, coring=false)
c4=Compare(c1, c2)

stackvertical(\
stackhorizontal(\
subtitle(c1,t1,size=20,align=2),\
subtitle(c2,t2,size=20,align=2)\
),\
stackhorizontal(\
subtitle(c3,"subtract"+" "+t1+" "+t2,size=20,align=2),\
subtitle(c4,"compare"+" "+t1+" "+t2,size=20,align=2)\
)\
)
}

# frame 25 (50)

# https://imgsli.com/MTUyMjYx
# https://imgsli.com/MTUyMjYy


Reply With Quote
  #3  
02-02-2023, 09:40 AM
numgis numgis is offline
Free Member
 
Join Date: Nov 2022
Posts: 7
Thanked 0 Times in 0 Posts
Wow thank you so much lollo2, this is amazing, thank you for sharing your special scripts! I'm going to have to spend some time analyzing what these scripts actually do, but really impressed with how you managed to bring out the colors in the final video.. the sky is blue, red is much more red.. wow!
Reply With Quote
  #4  
02-02-2023, 10:31 AM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 637
Thanked 177 Times in 154 Posts
I did almost nothing

Just
Code:
Tweak(cont=0.9,sat=1.2,bright=0,dither=true,coring=false)
Try to play with parameters in
Code:
ColorYUV(cont_y=0,off_y=0,off_v=0,off_u=0)
to adjust the final look to your taste.

There was probably some color space / color format / color matrix error and maybe some white clipping in your attempt.
Reply With Quote
  #5  
02-03-2023, 09:22 PM
numgis numgis is offline
Free Member
 
Join Date: Nov 2022
Posts: 7
Thanked 0 Times in 0 Posts
Thanks again lollo2.

I figured out my main issue.. audio and video not being in sync. It was all due to using FFmpegSource2() to open my source AVI vs using AviSource(). I originally could not use AviSource() due to it not reading HuffYUV but I figured out how to solve that by installing the 64-bit version of HuffYUV. Now AviSource() can open my captured AVI files directly and there are no more AV sync problems in the final MP4.

This means I can use my StarTech USB3HDCAP capture device and AmaRecTV again vs having to use the Sony DV camcorder pass-though for captures. Comparing the two, the StarTech produces far better colors than the DV camcorder, although it does skip/add a few frames here and there as I don't have a TBC. But I'm OK with a few hiccups in video as now the AV stays in sync. Using the DV camcorder in pass-through caused a lot of white clipping and washed our colors as per my original post, which can be fixed as you demonstrated, but not needed when using the USB3HDCAP.

I have been running FFmpeg all day today on my i9 processor and already produced many hours of very nice looking MP4 videos. Finally I can start going through and processing my VHS collection.
Reply With Quote
  #6  
02-03-2023, 09:55 PM
numgis numgis is offline
Free Member
 
Join Date: Nov 2022
Posts: 7
Thanked 0 Times in 0 Posts
I've attached the same scene as captured with the StarTech USB3HDCAP along with a few screenshots showing the raw AVI files and how different the colors are. The DV camcorder really blows out the whites and changes the sky.

lollo2 I see in one of your YouTube videos that you use the Hauppauge WinTV-Live 2 (USB-Live 2, model 1341) capture device? I purchased one from Amazon but found it was terrible compared to the StarTech. Perhaps the "new" models are not the same as what you have? Basically found the input looked skewed and frames were not steady, the captured video was basically jumping around. Again I don't have a TBC and perhaps this capture device really needs one, but still wasn't impressed, had to return the USB-Live 2. I did buy a Diamond VC500 to test, will report on how it works out.


Attached Images
File Type: jpg DV_vs_StarTech.jpg (50.2 KB, 4 downloads)
File Type: jpg DV_vs_StarTech2.jpg (47.3 KB, 2 downloads)
Attached Files
File Type: avi street_startech.avi (71.02 MB, 2 downloads)
Reply With Quote
  #7  
02-04-2023, 05:43 AM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 637
Thanked 177 Times in 154 Posts
Quote:
It was all due to using FFmpegSource2() to open my source AVI vs using AviSource()
For AVI files you should always use AviSource(), which requires the specific codec to be installed. Even DirectShowSource() is not as precise.

FFmpegSource() is designed for mpeg2/mpeg4 files. It is not frame accurate for other codecs.

When in doubt, use a filter doing a prior indexing of the video, such as LSMASHVideoSource or LWLibavVideoSource. It takes sometime, and creates an additional file, but it is then frame accurate.

Quote:
I can use my StarTech USB3HDCAP capture device and AmaRecTV
AmarecTV is excellent when using capture card with integrated audio/video inputs, while VirtualDub was (long time ago) designed to keep in synch streams coming from 2 different cards, and sometimes it suffers with modern hardware. I always use AmarecTV.

Quote:
the StarTech produces far better colors than the DV camcorder
A lossless YUV 4:2:2 capture is always better for an analog signal than a DV compressed capture, especially if you plan to perform a post-processing.

Quote:
which can be fixed as you demonstrated, but not needed when using the USB3HDCAP.
It is always better to start from the best possible capture, reducing the filtering to the minimum needed. There is always a trade-off when you denoise/sharpen/etc. and you may introduced new (different) artifacts. Sometimes is not detectable, sometimes is evident.

Quote:
Hauppauge USB-Live 2 ... Perhaps the "new" models are not the same as what you have?
There are no new models, this is a myth. The card is always the same, with the same internal hardware, well documented. The requiment of this card is a lineTBC correction (inside the player, or with a DVD-R recorder in pass-through mode) because it can't correct horizzontal jitter, and a Y/C input, because its internal comb filter is poor. When used under these condition, this card is excellent, otherwise is not. In my world there is no room for a capture without Y/C and lineTBC correction, so the problem does not arise.

Quote:
I did buy a Diamond VC500 to test, will report on how it works out.
The VC500 shares the same video chip (Conexant CX23102) as the Hauppauge USB-Live, then is prone to the same requirements. But the other ICs are different, so it may or may not behaves better in not optimal conditions. Again, the key points for a good capture are the condition of the tapes and the player. Start form the best possible VCR/player as priority #1.
Reply With Quote
  #8  
02-05-2023, 08:09 PM
numgis numgis is offline
Free Member
 
Join Date: Nov 2022
Posts: 7
Thanked 0 Times in 0 Posts
Thanks again lollo2 for all your input

I tried to hook up the Diamond VC500 I purchased but seems the Conexant Polaris CxCVBS.sys driver 7.0.127.7 causes a Windows Security Memory Integrity warning in Windows 11 and it wont run. Is there a newer driver available somewhere? The Diamond website only has this one available.

One more question if I may? All my captures and resulting videos seem to have this outline around them when there is contrast between objects. In this clip the white t-shirts have this dark outline along the left edges, and the yellow pole has yellow bleeding outside the edges. Is this an issue with my capture setup or just part of how interlaced video behaves? I've tried to reduce sharpening and contrast in the capture driver but that does not seem to help much. Is there a filter in AviSynth you would recommend, or what can I do?

In this post https://forum.videohelp.com/threads/...e4#post2427483 it was mentioned that "The USB3HDCAP's chroma is shifted down by 1 line; this is easily corrected after capture." Any idea if this could be the issue I'm having and if so, how do I shift the chroma up one line?


Attached Images
File Type: png test_01_original.png (577.1 KB, 4 downloads)
File Type: png test_02_converted.png (577.0 KB, 2 downloads)
File Type: png test_03_QTGMC_faster.png (541.0 KB, 1 downloads)
File Type: png test_04_QTGMC_faster_TR2.png (520.1 KB, 1 downloads)
File Type: png test_05_QTGMC_faster_TR2_LSFmod.png (546.0 KB, 1 downloads)
File Type: jpg test_full.jpg (46.1 KB, 2 downloads)
Attached Files
File Type: avi test.avi (23.11 MB, 3 downloads)
Reply With Quote
  #9  
02-06-2023, 02:16 PM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 637
Thanked 177 Times in 154 Posts
White halos can be softened with DeHalo_alpha filter or one of its variant. It is a quite destructive filter, so use with caution. In general is better to build a mask to reduce the damages. An example here (without mask); play with the parameters for optimal results:

white_halo.jpg

Code:
video_org=AviSource("test.avi")

# plugins directory
plugins_dir="C:\Users\giuse\Documents\VideoSoft\MPEG\AviSynth\extFilters\"

	# QTGMC
Import(plugins_dir + "QTGMC.avsi")
	# Zs_RF_Shared
Import(plugins_dir + "Zs_RF_Shared.avsi")
	# RgTools
loadPlugin(plugins_dir + "RgTools-v1.0\x86\RgTools.dll")
	# MaskTools2
loadPlugin(plugins_dir + "masktools2-v2.2.23\x86\masktools2.dll")
	# MVTools
loadPlugin(plugins_dir + "mvtools-2.7.41-with-depans20200430\x86\mvtools2.dll")
	# Nnedi3
loadPlugin(plugins_dir + "NNEDI3_v0_9_4_55\x86\Release_W7\nnedi3.dll")

	# Dehalo_alpha
Import(plugins_dir + "Dehalo_alpha\Dehalo_alpha_MT2.avsi")
	# Dither
Import(plugins_dir + "dither-1.28.0\mt_xxpand_multi.avsi")
loadPlugin(plugins_dir + "dither-1.28.0\win32\dither.dll")

### convert to YV16
video_org_yv16=video_org.convertToYV16()

### deinterlacing
deinterlaced_yv16=video_org_yv16.assumeTFF().QTGMC()

### dehaloing
dehaloed_yv16=deinterlaced_yv16.Dehalo_alpha(rx=4,ry=4,darkstr=0.0,brightstr=1.2,lowsens=150,highsens=500)

stackhorizontal(\
subtitle(deinterlaced_yv16,"deinterlaced_yv16",size=20,align=2),\
subtitle(dehaloed_yv16,"dehaloed_yv16",size=20,align=2)\
)
Removing the black halos is much more complex. I did not succed within a short attempt. You can try using finedehalo2 or YAHR as alternative or together with Dehalo_alpha. Check also videohelp forums for some example.

If you see a shift in the chroma you can simply use ChromaShift: http://avisynth.nl/index.php/ChromaShift


Reply With Quote
Reply




Tags
avisynth, avs, color, ffmpeg, restoration

Similar Threads
Thread Thread Starter Forum Replies Last Post
AvsPmod first script? DG1965 Restore, Filter, Improve Quality 21 08-16-2022 02:55 AM
VHS restoration with Avisynth+ script, room to improve? MediaHoarder Restore, Filter, Improve Quality 1 02-01-2022 04:34 AM
VirtualDub error using script? priya69 Restore, Filter, Improve Quality 1 12-05-2021 03:17 AM
Perfect my Avisynth script? geordie10 Restore, Filter, Improve Quality 7 10-23-2020 10:31 AM
Line TBC with Avisynth script? jjdd Restore, Filter, Improve Quality 3 11-14-2019 01:43 AM

Thread Tools



 
All times are GMT -5. The time now is 09:11 PM