Go Back    Forum > Digital Video > Video Project Help > Edit Video, Audio

Reply
 
LinkBack Thread Tools
  #41  
12-20-2021, 12:58 PM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
I do not understand your script, and why you apply a lossless deinterlace if at the end you deinterlace for the final version, but maybe I am missing something.
In addition, a color matrix change should be done before upscaling.
I would experiment the following, reducing also the computation effort.

Code:
vidEdit = vidEdit.Crop(22,0, 0,0).AddBorders(10,0,12,0)y

AssumeBFF()

QTGMC( Preset="fast", EZKeepGrain=1.0, NoisePreset="Faster", NoiseProcess=0, FPSDivisor=2)
VInverse2() # if you see residual combing

# --> select here the segments where following filtering should be applied
FAN(lambda=5, plus=1, minus=50)
FAN(lambda=5, plus=50, minus=1)

ChromaShift(C=6, L=2)

SpotLess(RadT=3, ThSAD=1000, Blksz=16).SpotLess(RadT=5, ThSAD=300, Blksz=16).RemoveDirtSMC(20)

FixChromaBleedingMod(thr=7, strength=0.8)

MergeChroma(aWarpSharp2(thresh=200,depth=30, type=1,blur=4, chroma=3).aWarpSharp2(thresh=200,depth=30, type=1,blur=4,chroma=3))
TurnRight()
MergeChroma(aWarpSharp2(thresh=200,depth=30,type=1,blur=4).aWarpSharp2(thresh=200,depth=30,type=1,blur=4))
TurnLeft()

SmoothUV(radius=2, field=false)

# --> merge the filtered segments with the rest

ColorMatrix(mode="Rec.601->Rec.709")

nnedi3_rpow2(4, cshift="Spline36Resize", fwidth=1920, fheight=1440)

LSFmod(strength=100, preblur="ON")
AddGrainC(var=2)

# as alternative experiment if LSFMod before upscaling gives a better result
You can solve the "memory" problem by splitting the operations in 2 steps, generating an intermediate file (unfortunatly, the disk occupation will be twice while processing).

Quote:
Is there a way around this besides raising the black level before the filter?
The denoise and QTGMC processing probably changes your (whatever) input levels to output levels 0-255. You can use Levels() functions before changing the color matrix to adapt them at your own taste. Better to use a Levels() version which only acts on Luma and leaves Chroma unaffected.
Reply With Quote
The following users thank lollo2 for this useful post: Winsordawson (12-21-2021)
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #42  
12-21-2021, 08:46 PM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 30 Times in 26 Posts
Sorry--I left that de-interlacer there because if I did not divide by two with QTGMC in the beginning, all of my frames that I trimmed later on would be screwed up, so I want to fix that issue first.

It seems that there is a slight color banding on the bottom of each other frame if I don't choose FPSDivisor=2. I would obviously rather keep the 59.97, but I do not know what is the problem. Below I have attached two consecutive frames to show the difference, with another picture highlighting the extra banding. Is this common?

frame1.jpg

You must be logged in to view this content; either login or register for the forum. The attached screen shots, before/after images, photos and graphics are created/posted for the benefit of site members. And you are invited to join our digital media community.


frame2.jpg

Also, you were right about the resizer and QTGMC affecting the color. I didn't know this could happen. ColorMatrix brought the colors into 16-235 territory but the nnedi3 resizer brought them back out of the safe zone. I guess I will have to apply another ColorYUV() at the end. I am surprised that is not more documented.

Lastly, do you think my issue in VirtualDub was because my script was too intensive (despite having 16gb of RAM)? Was my resize correct? I have read that if the resize is not done correctly VirtualDub could throw an error, but 1920 by 1440 is 4:3 and mod-2, so I don't know what else could be the issue.

If it is simply a RAM issue then I won't have a problem resizing in a second script--I just want to make sure that I am not doing something else wrong. I am using only 32-bit Avisynth, so that can't help, either.

Thank you again for all your help--I'll make sure to not bother you until after the holiday!


Reply With Quote
  #43  
12-22-2021, 04:27 AM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
Quote:
Below I have attached two consecutive frames to show the difference, with another picture highlighting the extra banding. Is this common?
Not really. Try to play with QTGMC parameters and to crop before QTGMC. I always do that.
same frame-rate QTGMC is not a good idea, except if no motion is present. Some details here: http://www.digitalfaq.com/forum/vide...mc-script.html

Quote:
I will have to apply another ColorYUV() at the end
Difficult to be accurate with ColorYUV. Better use a Levels() function acting only on Luma:
Code:
function LevelsLumaOnly(clip c,
\                       int input_low, float gamma, int input_high,
\                       int output_low, int output_high)
{
    return MergeChroma(c.Levels(input_low, gamma, input_high,
    \                           output_low, output_high),
    \                  c)
}
Quote:
Was my resize correct?
No. Analog video once captured in SD is 720x576 (or 720x480) at 4:3 DAR. Upscaling to HD the height is 1080, then the width must be 1040x4/3 = 1440.
You then leave the frame at 1440x1080 or you add 240 black borders on each side to build the standard fullHD frame size.

Quote:
I'll make sure to not bother you until after the holiday!
Don't worry, I am learning as well. Each video is unique and has its specific issues, so is rare that a standard processing is applied. Looking different samples is always instructive ;-)
Reply With Quote
The following users thank lollo2 for this useful post: Winsordawson (12-22-2021)
  #44  
12-22-2021, 05:39 AM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
Quote:
then the width must be 1040x4/3 = 1440.
then the width must be 1080x4/3 = 1440 (typo correction)

A channel on S-VHS / VHS capture and AviSynth restoration https://bit.ly/3mHWbkN
Reply With Quote
  #45  
12-22-2021, 11:06 AM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 30 Times in 26 Posts
Thank you again. Just to clarify something (before your break!), isn't 1440x1080 only 4:3 with 1:1 (square) pixels and this SD video (in NTSC land of 720x480) is based off non-square pixels?

From what I read, 720x480p is 4:3 DAR but 10:11 PAR and an aspect ratio of 3:2 (1.5). My 1920x1080 is wrong because that is 16:9, so I should upscale to another 3:2 format, like 2160 x 1440, no?

I would rather not crop the 720x480, and the only purpose of this deinterlaced version is for YT to get a better bitrate. Since 2160x 1440 is not an acceptable format, they will add pillarboxes to it, but I am okay with that.

Feel free to suggest any reading material if you know a good source. This area is a bit confusing.

P.S. I did crop before QTGMC but I will play with the settings like ChromaMotion

Last edited by Winsordawson; 12-22-2021 at 11:17 AM.
Reply With Quote
  #46  
12-23-2021, 04:20 AM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
I generally use this semplified approach for PAL:

720x576 SD, DAR (display aspect ratio)=4:3, SAR (storage aspect ratio)=720/576=5/4, PAR (pixel aspect ratio)=DAR/SAR=4/3*4/5=16/15
non square pixel, because PAR is not 1

in your NTSC land will be:

720x480 SD, DAR (display aspect ratio)=4:3, SAR (storage aspect ratio)=720/480=3/2, PAR (pixel aspect ratio)=DAR/SAR=4/3*2/3=8/9
non square pixel, because PAR is not 1

convert to HD:
1- height of HD = 1080
2- width of HD = height of HD * DAR SD = 1080 * 4/3 = 1440

1440x1080 HD, DAR (display aspect ratio)=4:3, SAR (storage aspect ratio)=1440/1080=4/3, PAR (pixel aspect ratio)=DAR/SAR=4/3*3/4=1
square pixel, because PAR= 1

To be more accurate, it should be considered the ITU-R BT.601-4 (formerly "CCIR-601" or "Rec.601") spefication for Analog SD is 702(704)x480 pixel inside the 720x480 frame, the rest should be black.
So you can crop to 702(704)x480 before upscaling.

Some references:

http://www.arachnotron.nl/videocap/d..._cap_v1_en.pdf

http://web.archive.org/web/200606211...eo/conversion/
Reply With Quote
The following users thank lollo2 for this useful post: Winsordawson (01-01-2022)
  #47  
12-23-2021, 05:31 AM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
If you prefere to build the fullHD frame:

convert to HD:
1- height of HD = 1080
2- width of HD = height of HD * DAR SD = 1080 * 4/3 = 1440
3- add 240 black pixels on the left and on the right --> 1920x1080

1920x1080 HD, DAR (display aspect ratio)=16:9, SAR (storage aspect ratio)=1920/1080=16/9, PAR (pixel aspect ratio)=DAR/SAR=16/9*9/16=1
square pixel, because PAR=1

A channel on S-VHS / VHS capture and AviSynth restoration https://bit.ly/3mHWbkN
Reply With Quote
  #48  
01-01-2022, 01:54 PM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 30 Times in 26 Posts
Thank you for the explanation. I hope you are having a good start to the new year. I have tried to read up on this area but it still seems too complicated for me. But my understanding is that when we upscale, the PAR must be 1:1 square pixel because that is the only PAR for computers, right? A Doom9 poster wrote ""Converting to square pixels" is just another word for resize."

In that case, I could also do 1920 x 1440?
Height of 1440p HD = 1440
Width = 1440 x DAR SD = 1440 * 4/3 = 1920.

The SAR is 1920/1440 = 4/3. If we intend for it to be shown on a 4:3 screen, DAR =4/3, correct? So (4/3)/(4/3) = 1 PAR.

If I am right, you upload your videos on YT as 1440 x 1080 and not 1920 x 1440, and I do see a quality difference over SD. Would it be worth upscaling to 1440p 4:3 or 1080p 4:3 should be fine?

On another note, I am a bit confused about converting to square pixels that is on Lurkertech's guide. It says at the below link that the 480i signal NTSC signal starts at 720x486 and we can convert this to 640x486 square pixels. But if we upscale to 1440x1080 without first converting to 640x486, we are basing it off the 720x480 (minus the 6 lines lost in overscan). What would be the difference if we first converted to 640x480 and then to 1440x1080?

https://lurkertech.com/lg/pixelaspect/

And, if I wish to keep an interlaced version as well of the original 720x480 video, I would prefer to save it as AVI or MPEG-2. From what I have read, AVIs always display in 1:1 PAR, so if I save the 720x480 video will it be distorted since it uses a PAR of 8/9.

Using your formula above, is this correct:

I would rather add letterbox than crop the image and remove data. We know the PAR we want (1:1) and the DAR (4/3). This, SAR = DAR/PAR = (4/3)/(1/1) = 1.33333. If the width is 720 does that mean to keep it as 4:3 I must have a height of 540? 720/540 = 1.333

But I can't resize interlaced video, so I would first have to de-interlace it with something like needi3, resize, and then re-interlace?

If I have been doing it wrong previously, why have I never seen any distortions when playing 720x480i AVIs on my computer, if AVIs don't support a DAR?
https://forum.videohelp.com/threads/...nd-Resolutions
Reply With Quote
  #49  
01-01-2022, 03:08 PM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
1440 is not a HD or fullHD vertical resolution, which is 1080

You can set horizontal resolution to 1920 (fullHD) with DAR 16:9 or 1440 (HD) with DAR 4:3. Starting from SD frame, if you want the first, you preliminary generate the 1440x1080 frame and then add 240 black borders on each side.

Quote:
What would be the difference if we first converted to 640x480 and then to 1440x1080?
Why do you want to resize several times? Each processing can be lossy (we only do when we want to sharpen a bit between intermediate steps). And why do you want to convert between square and not square pixels? Any PC player or modern TV handle DAR info whatever the PAR is.

Quote:
From what I have read, AVIs always display in 1:1 PAR
An avi container for analog captures does not contain the DAR info or flag. You must set your player (i.e. in VLC -> Video -> Aspect Ratio -> 4:3, or add the flag manually with ffmpeg or add the apsct ratio while encoding. We were just discussing it: http://www.digitalfaq.com/forum/vide...s-capture.html

A channel on S-VHS / VHS capture and AviSynth restoration https://bit.ly/3mHWbkN
Reply With Quote
The following users thank lollo2 for this useful post: Winsordawson (01-01-2022)
  #50  
01-01-2022, 04:54 PM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
Quote:
I hope you are having a good start to the new year.
I wish the same, all the best to you and to the other users for 2022!!!

A channel on S-VHS / VHS capture and AviSynth restoration https://bit.ly/3mHWbkN
Reply With Quote
The following users thank lollo2 for this useful post: Winsordawson (01-01-2022)
  #51  
03-24-2023, 05:06 PM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 30 Times in 26 Posts
Sorry to resurrect this thread, but I finally had time to get back to this query (after going crazy for a few days). It seems that there are some issues with VirtualDub when I run this script. I am unable to run the x264vfw codec on this file in VirtualDub1 or VirtualDub2 (both 32-bit, because of all the different plugins) without getting the error "Video compression error: An unknown error occurred (may be corrupt data). (error code -100)"

When I try to encode it with FFV1 8-bit 4:2:0 I get the error "Video compression error: Not enough memory. (error code -3)". I realize that this might be due to using 32-bit due to the 4gb limitation, but is there a way to still process the video more slowly without going over the limit?

For some reason, the encoding works fine in FFMPEG x265 and x265 lossless.



Here is the code I have been using

Code:
video1 = FFmpegSource2(source="video.avi",atrack=-1).AssumeBFF
#video1 = AVISource("video.avi").AssumeBFF
audio1 = video1
last = video1

#replaces dropouts
ReplaceFramesMC2(192, 1)
ReplaceFramesMC2(194, 5)
ReplaceFramesMC2(268, 2)
ReplaceFramesMC2(315, 8)
ReplaceFramesMC2(359, 3)
ReplaceFramesMC2(500, 4)
ReplaceFramesMC2(520, 5)
ReplaceFramesMC2(5619, 1)

video2 = AudioDub(last, audio1)


#removes title segments because they should not have filters applied to them
seg1 = video2.Trim(3955,4093)
seg2 = video2.Trim(6264,6412)
seg3 = video2.Trim(10052,10200)
seg4 = video2.Trim(13981,14129)
seg5 = video2.Trim(17598,17746)
seg6 = video2.Trim(21230,21359)

#creates video without title sequences to now start filtering
vidEdit = video2.Trim(0, 3944) + video2.Trim(4094, 6263) + video2.Trim(6413, 10051) + video2.Trim(10201, 13980) + video2.Trim(14130,17597) + video2.Trim(17747,21230)

vidEdit = vidEdit.Crop(22,0, 0,0).AddBorders(10,0,12,0)

/*Double-checking correct width*/
# return Subtitle(last, String(vidEdit.Width), size = 32)   
last = vidEdit

#deinterlaces better than separatefields
AssumeBFF().nnedi3(field=-2)

#removes vertical banding noise, shifts chroma, and then removes dropouts
FAN(lambda=5, plus=1, minus=50)
FAN(lambda=5, plus=50, minus=1)
ChromaShift(C=4, L=2)
SpotLess(RadT=3, ThSAD=1000, Blksz=16).SpotLess(RadT=5, ThSAD=300, Blksz=16).RemoveDirtSMC(20)
#THIS DOES NOT WORK AS WELL-->TemporalDegrain2(degrainTR=3)

FixChromaBleedingMod(thr=7, strength=0.8)

MergeChroma(aWarpSharp2(thresh=200,depth=30, type=1,blur=4, chroma=3).aWarpSharp2(thresh=200,depth=30, type=1,blur=4,chroma=3))
TurnRight()
MergeChroma(aWarpSharp2(thresh=200,depth=30,type=1,blur=4).aWarpSharp2(thresh=200,depth=30,type=1,blur=4))
TurnLeft()

SmoothUV(radius=2, field=false)

#puts interlace image back together
AssumeBFF().SeparateFields().SelectEvery(4,0,3).Weave()

vidEditFinal = last

vidFinal = vidEditFinal.Trim(0, 3944) + seg1 + vidEditFinal.Trim(3945, 6113) +seg2 + vidEditFinal.Trim(6114, 9756) +seg3 + \
vidEditFinal.Trim(9757, 13529) + seg4 + vidEditFinal.Trim(13530, 17001) + seg5 + vidEditFinal.Trim(17002, 0) + seg6

#test sample
last = vidFinal.Trim(1800, 2300)


QTGMC( Preset="fast", EZKeepGrain=1.0, NoisePreset="Faster", NoiseProcess=0)
VInverse2()

nnedi3_rpow2(4, cshift="Spline36Resize", fwidth=1440, fheight=1080)

LSFmod(strength=150, preblur="ON")
AddGrainC(var=10)

#For upscaling to high definition for YT
ColorMatrix(mode="Rec.601->Rec.709", interlaced=false)

return last
Thanks for any suggestions.
Reply With Quote
  #52  
03-24-2023, 05:28 PM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
I ignore why VirtualDub and VirtualDub2 have problems, but for a basic x264 compression they are useless and you do not need at all.
Just run a simply ffmpeg command line instead, as you apparently do for x265:

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

A channel on S-VHS / VHS capture and AviSynth restoration https://bit.ly/3mHWbkN
Reply With Quote
The following users thank lollo2 for this useful post: Winsordawson (03-24-2023)
  #53  
03-24-2023, 06:23 PM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 30 Times in 26 Posts
Quote:
Originally Posted by lollo2 View Post
I ignore why VirtualDub and VirtualDub2 have problems, but for a basic x264 compression they are useless and you do not need at all.
Just run a simply ffmpeg command line instead, as you apparently do for x265:

Code:
ffmpeg.exe -i <input>.avs -c:v libx264 -crf 17 -preset slow -aspect 4:3 -c:a aac -b:a 128k <output>.mp4
Thanks for the quick reply--it is always appreciated. While I would have no issue exporting FFV1 or x264 or x265 in FFMPEG (since I am not using VD filters), when I try to run a command like the one you wrote, it says Unknown error occurred. It seems there is some issue with opening .avs files (opening non-avs files works).

I spent about 10 hours straight trying to figure out the FFMPEG problem before posting. From what I read, I had to install Avisynth headers from the source code, build just the headers, then make and install avisynth.h under an include folder where FFMPEG is installed (which I added). I finally was able to do that after asking ChatGPT for instructions . While it was a success, the error didn't go away. When I try to pipe it through avs2yuv it actually works but the quality does not look that good.

Any ideas?
Reply With Quote
  #54  
03-25-2023, 04:21 AM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
Quote:
From what I read, I had to install Avisynth headers from the source code, build just the headers, then make and install avisynth.h under an include folder where FFMPEG is installed (which I added).
No idea of what you are talking about, sorry.

Just install AviSynth as usual (I suppose VirtualDub was able to read and display your AviSynth script, so this should be ok), and place downloaded FFMpeg binary somewhere, no need to install anything here.

Upload a portion of your source (we already have the AviSynth script), so we can try to reproduce your problem.

A channel on S-VHS / VHS capture and AviSynth restoration https://bit.ly/3mHWbkN
Reply With Quote
  #55  
03-26-2023, 10:10 AM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 30 Times in 26 Posts
Thank you, but this problem occurs even though Avisynth+ and FFMPEG are already installed (I used it to make this segment from the complete .avi, so it would seem that the issue is not with FFMPEG. It just cannot open avs files. Should I reinstall Avisynth+? I have attached a segment.


Attached Files
File Type: avi video.avi (92.05 MB, 3 downloads)
Reply With Quote
  #56  
03-26-2023, 10:26 AM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
I tried your script on your old video (not the right source, but just to try all the filters you use; all trims removed) and it works fine here when feeding a ffmpeg command line as above.

If you experience "Unknown error occurred" it may be related to ffmpeg not finding some of the plugins. Try to specify an absolute path instead of a relative path in your avs script.

My (working) script attached as reference (change the path with yours):

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

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

	# ReplaceFramesMC2
import(plugins_dir + "ReplaceFramesMC2.avsi")

	# 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")

	# FanFilter
loadPlugin("C:\Users\giuse\Desktop\tmp\FanFilter\FanFilter.dll")

	# ChromaShift
loadPlugin(plugins_dir + "chromashift27\ChromaShift.dll")

	# SpotLess
import(plugins_dir + "SpotLess.avsi")

	# MedianBlur2
loadPlugin(plugins_dir + "MedianBlur2_v1.1\x86\MedianBlur2.dll")

	# SpotLess
import(plugins_dir + "SpotLess.avsi")

	# RemoveDirt2_modGMa
import(plugins_dir + "RemoveDirt2_modGMa.avsi")

	# RgTools
loadPlugin(plugins_dir + "RgTools-v1.0\x86\RgTools.dll")

	# RemoveDirt
loadPlugin("C:\Users\giuse\Desktop\tmp\RemoveDirt-0.9.3\x86\RemoveDirt.dll")

	# SeeSaw
import(plugins_dir + "SeeSaw.avs")

	# MaskTools2
loadPlugin(plugins_dir + "masktools2-v2.2.23\x86\masktools2.dll")

	# FixChromaBleedingMod.avsi
import("C:\Users\giuse\Desktop\tmp\FixChromaBleedingMod.avsi")

	# Zs_RF_Shared
Import("C:\Users\giuse\Desktop\tmp\Zs_RF_Shared.avsi")

	# ChromaShiftSP
import("C:\Users\giuse\Desktop\tmp\ChromaShiftSP.avsi")

	# aWarpSharp
loadPlugin(plugins_dir + "aWarpSharpMT_v2_1_3\x86\Release_W7\aWarpsharpMT.dll")

	# SmoothUV
loadPlugin(plugins_dir + "smoothuv_5F25_dll_20030902\SmoothUV.dll")

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

	# vinverse
loadPlugin(plugins_dir + "vinverse-x86\vinverse.dll")

	# LSFmod
Import(plugins_dir + "LSFmod.v1.9.avsi")

	# AddGrainC
loadPlugin(plugins_dir + "AddGrainC-v1.8.2\clang\x86\AddGrainC.dll")

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

video1 = FFmpegSource2(source="intrepretative dance before.avi",atrack=-1).AssumeBFF
#video1 = AVISource("video.avi").AssumeBFF
audio1 = video1
last = video1

#replaces dropouts
ReplaceFramesMC2(192, 1)
ReplaceFramesMC2(194, 5)
ReplaceFramesMC2(268, 2)
ReplaceFramesMC2(315, 8)
ReplaceFramesMC2(359, 3)
ReplaceFramesMC2(500, 4)
ReplaceFramesMC2(520, 5)
ReplaceFramesMC2(5619, 1)

video2 = AudioDub(last, audio1)


#removes title segments because they should not have filters applied to them
seg1 = video2.Trim(3955,4093)
seg2 = video2.Trim(6264,6412)
seg3 = video2.Trim(10052,10200)
seg4 = video2.Trim(13981,14129)
seg5 = video2.Trim(17598,17746)
seg6 = video2.Trim(21230,21359)

#creates video without title sequences to now start filtering
vidEdit = video2 #.Trim(0, 3944) + video2.Trim(4094, 6263) + video2.Trim(6413, 10051) + video2.Trim(10201, 13980) + video2.Trim(14130,17597) + video2.Trim(17747,21230)

vidEdit = vidEdit.Crop(22,0, 0,0).AddBorders(10,0,12,0)

/*Double-checking correct width*/
# return Subtitle(last, String(vidEdit.Width), size = 32)   
last = vidEdit

#deinterlaces better than separatefields
AssumeBFF().nnedi3(field=-2)

#removes vertical banding noise, shifts chroma, and then removes dropouts
FAN(lambda=5, plus=1, minus=50)
FAN(lambda=5, plus=50, minus=1)
ChromaShift(C=4, L=2)
SpotLess(RadT=3, ThSAD=1000, Blksz=16).SpotLess(RadT=5, ThSAD=300, Blksz=16).RemoveDirtSMC(20)
#THIS DOES NOT WORK AS WELL-->TemporalDegrain2(degrainTR=3)

FixChromaBleedingMod(thr=7, strength=0.8)

MergeChroma(aWarpSharp2(thresh=200,depth=30, type=1,blur=4, chroma=3).aWarpSharp2(thresh=200,depth=30, type=1,blur=4,chroma=3))
TurnRight()
MergeChroma(aWarpSharp2(thresh=200,depth=30,type=1,blur=4).aWarpSharp2(thresh=200,depth=30,type=1,blur=4))
TurnLeft()

SmoothUV(radius=2, field=false)

#puts interlace image back together
AssumeBFF().SeparateFields().SelectEvery(4,0,3).Weave()

vidEditFinal = last

vidFinal = vidEditFinal #.Trim(0, 3944) + seg1 + vidEditFinal.Trim(3945, 6113) +seg2 + vidEditFinal.Trim(6114, 9756) +seg3 + \
vidEditFinal.Trim(9757, 13529) + seg4 + vidEditFinal.Trim(13530, 17001) + seg5 + vidEditFinal.Trim(17002, 0) + seg6

#test sample
last = vidFinal #.Trim(1800, 2300)


QTGMC( Preset="fast", EZKeepGrain=1.0, NoisePreset="Faster", NoiseProcess=0)
VInverse2()

nnedi3_rpow2(4, cshift="Spline36Resize", fwidth=1440, fheight=1080)

LSFmod(strength=150, preblur="ON")
AddGrainC(var=10)

#For upscaling to high definition for YT
ColorMatrix(mode="Rec.601->Rec.709", interlaced=false)

return last.trim(0,200)
Reply With Quote
  #57  
03-26-2023, 01:04 PM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 30 Times in 26 Posts
Thanks for the tip. Sadly, I still get the same Unknown error occurred. This is my script:

Code:
#plugins directory
plugins_dir = "C:\Program Files (x86)\AviSynth+\plugins+\"

#FFmpegSource
LoadPlugin(plugins_dir + "ffms2.dll")

#ReplaceFramesMC2
Import(plugins_dir + "ReplaceFramesMC2.avsi")

#MVTools
loadPlugin(plugins_dir + "mvtools2.dll")

# Nnedi3
loadPlugin(plugins_dir + "nnedi3.dll")

# FanFilter
loadPlugin(plugins_dir + "FanFilter.dll")

# ChromaShift
loadPlugin(plugins_dir + "ChromaShift.dll")

# SpotLess
import(plugins_dir + "SpotLess.avsi")

# MedianBlur2
loadPlugin(plugins_dir + "MedianBlur2.dll")

# RemoveDirt
loadPlugin(plugins_dir + "RemoveDirt.dll")

# RemoveDirt2SMC
import(plugins_dir + "RemoveDirtSMC.avsi")

# RgTools
loadPlugin(plugins_dir + "RgTools.dll")

# MaskTools2
loadPlugin(plugins_dir + "masktools2.dll")

# FixChromaBleedingMod.avsi
Import(plugins_dir + "FixChromaBleedingMod.avsi")

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

# ChromaShiftSP
Import(plugins_dir + "ChromaShiftSP.avsi")

# aWarpSharp
loadPlugin(plugins_dir + "aWarpsharpMT.dll")

# SmoothUV
loadPlugin(plugins_dir + "SmoothUV.dll")

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

# vinverse
loadPlugin(plugins_dir + "vinverse.dll")

# LSFmod
Import(plugins_dir + "LSFmod.v1.9.avsi")

# AddGrainC
loadPlugin(plugins_dir + "AddGrainC.dll")

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

video1 = FFmpegSource2(source="C:\Users\admin\Documents\video.avi",atrack=-1).AssumeBFF
audio1 = video1
last = video1

#replaces dropouts
ReplaceFramesMC2(192, 1)
ReplaceFramesMC2(194, 5)
ReplaceFramesMC2(268, 2)
ReplaceFramesMC2(315, 8)
ReplaceFramesMC2(359, 3)
ReplaceFramesMC2(500, 4)
ReplaceFramesMC2(520, 5)
ReplaceFramesMC2(5619, 1)

video2 = AudioDub(last, audio1)

#removes title segments because they should not have filters appiled to them
seg1 = video2.Trim(3955,4093)
seg2 = video2.Trim(6264,6412)
seg3 = video2.Trim(10052,10200)
seg4 = video2.Trim(13981,14129)
seg5 = video2.Trim(17598,17746)
seg6 = video2.Trim(21230,21359)

#creates video without title sequences to now start filtering
vidEdit = video2.Trim(0, 3944) + video2.Trim(4094, 6263) + video2.Trim(6413, 10051) + video2.Trim(10201, 13980) + video2.Trim(14130,17597) + video2.Trim(17747,21230)

vidEdit = vidEdit.Crop(22,0, 0,0).AddBorders(10,0,12,0)

/*Double-checking correct width*/
# return Subtitle(last, String(vidEdit.Width), size = 32)   
last = vidEdit

#deinterlaces better than separatefields
AssumeBFF().nnedi3(field=-2)

#removes vertical banding noise, shifts chroma, and then removes dropouts
FAN(lambda=5, plus=1, minus=50)
FAN(lambda=5, plus=50, minus=1)
ChromaShift(C=4, L=2)
SpotLess(RadT=3, ThSAD=1000, Blksz=16).SpotLess(RadT=5, ThSAD=300, Blksz=16).RemoveDirtSMC(20)
#THIS DOES NOT WORK AS WELL-->TemporalDegrain2(degrainTR=3)


FixChromaBleedingMod(thr=7, strength=0.8)

MergeChroma(aWarpSharp2(thresh=200,depth=30, type=1,blur=4, chroma=3).aWarpSharp2(thresh=200,depth=30, type=1,blur=4,chroma=3))
TurnRight()
MergeChroma(aWarpSharp2(thresh=200,depth=30,type=1,blur=4).aWarpSharp2(thresh=200,depth=30,type=1,blur=4))
TurnLeft()

SmoothUV(radius=2, field=false)

#puts interlace image back together
AssumeBFF().SeparateFields().SelectEvery(4,0,3).Weave()

vidEditFinal = last

vidFinal = vidEditFinal.Trim(0, 3944) + seg1 + vidEditFinal.Trim(3945, 6113) +seg2 + vidEditFinal.Trim(6114, 9756) +seg3 + \
vidEditFinal.Trim(9757, 13529) + seg4 + vidEditFinal.Trim(13530, 17001) + seg5 + vidEditFinal.Trim(17002, 0) + seg6

last = vidFinal.Trim(1800, 2300)

QTGMC( Preset="fast", EZKeepGrain=1.0, NoisePreset="Faster", NoiseProcess=0)
VInverse2()

nnedi3_rpow2(4, cshift="Spline36Resize", fwidth=1440, fheight=1080)

LSFmod(strength=150, preblur="ON")
#add only luma noise, not color as that is more noticable
AddGrainC(var=10)

#For upscaling to high definition for YT
ColorMatrix(mode="Rec.601->Rec.709", interlaced=false)

#colorYUV(analyze=true)
#Histogram("levels")

return last
Maybe it has something to do with the errors I get when opening Avisynth+? Every time I open a script I get something like this, which I read may have to do with Registry order of reading the plugins:

Code:
Error parsing WriteFileEnd plugin parameters: + without preceeding argument
Error parsing WriteFile plugin parameters: unknown character 'n'
Error parsing WriteFile plugin parameters: + without preceeding argument
Error parsing WriteFileIf plugin parameters: unknown character 'n'
Error parsing WriteFileIf plugin parameters: + without preceeding argument
Error parsing WriteFileStart plugin parameters: unknown character 'n'
Error parsing WriteFileStart plugin parameters: + without preceeding argument
Error parsing WriteFileEnd plugin parameters: unknown character 'n'
Error parsing WriteFileEnd plugin parameters: + without preceeding argument
Error parsing propSetInt plugin parameters: unknown character 'n'
Error parsing propSetFloat plugin parameters: unknown character 'n'
Error parsing propSetString plugin parameters: unknown character 'n'
Error parsing propSetArray plugin parameters: unknown character 'n'
Error parsing propSetClip plugin parameters: unknown character 'n'
Error parsing OnCPU plugin parameters: unknown character 'n'
Error parsing OnCUDA plugin parameters: unknown character 'n'
Error parsing OnCPU plugin parameters: unknown character 'n'
Error parsing OnCUDA plugin parameters: unknown character 'n'
I am using x32 version.
Reply With Quote
  #58  
03-26-2023, 01:35 PM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
I do not know, sorry, I do not use AviSynth+.

Maybe you can try first with AviSynth, and then if everything works switch to AviSynth+ debugging step by step (one filter at the time)

A channel on S-VHS / VHS capture and AviSynth restoration https://bit.ly/3mHWbkN
Reply With Quote
  #59  
03-26-2023, 03:24 PM
Winsordawson Winsordawson is offline
Free Member
 
Join Date: Sep 2010
Location: Behind you
Posts: 473
Thanked 30 Times in 26 Posts
Do you think it matters if it does not open any .avs file, regardless of the filters? I tried it on the authors.avs file that comes with Avisynth and the same error occurs.

I also see that my FFMPEG is 64 bit while I have installed only 32bit Avisynth+. Could that be an issue?

Last edited by Winsordawson; 03-26-2023 at 03:44 PM.
Reply With Quote
  #60  
03-26-2023, 04:11 PM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
Quote:
Do you think it matters if it does not open any .avs file, regardless of the filters? I tried it on the authors.avs file that comes with Avisynth and the same error occurs.
It does matter. It's not normal.

Quote:
I also see that my FFMPEG is 64 bit while I have installed only 32bit Avisynth+. Could that be an issue?
Probably yes. Be consistent with 32bit / 64 bit versions

A channel on S-VHS / VHS capture and AviSynth restoration https://bit.ly/3mHWbkN
Reply With Quote
The following users thank lollo2 for this useful post: Winsordawson (04-01-2023)
Reply




Tags
avsinfotools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adobe Premiere CS3 for compressing video? JoRodd Edit Video, Audio 16 05-11-2017 09:49 PM
Is there an alternative to Adobe Premiere? rappy Edit Video, Audio 1 12-27-2011 12:31 PM
Help with Adobe Premiere and Huffyuv Files jrodefeld Edit Video, Audio 2 12-04-2011 01:50 PM
Wow, Adobe Premiere Pro CS4 support RMVB anllyy Encode, Convert for streaming 2 01-17-2010 11:05 AM




 
All times are GMT -5. The time now is 01:58 PM