12-20-2021, 12:58 PM
|
|
Free Member
|
|
Join Date: Mar 2013
Location: Italy
Posts: 635
Thanked 177 Times in 154 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.
|
The following users thank lollo2 for this useful post:
Winsordawson (12-21-2021)
|
Someday, 12:01 PM
|
|
Ads / Sponsors
|
|
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
|
|
|
12-21-2021, 08:46 PM
|
|
Premium Member
|
|
Join Date: Sep 2010
Location: Behind you
Posts: 438
Thanked 28 Times in 24 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!
|
12-22-2021, 04:27 AM
|
|
Free Member
|
|
Join Date: Mar 2013
Location: Italy
Posts: 635
Thanked 177 Times in 154 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:
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 ;-)
|
The following users thank lollo2 for this useful post:
Winsordawson (12-22-2021)
|
12-22-2021, 05:39 AM
|
|
Free Member
|
|
Join Date: Mar 2013
Location: Italy
Posts: 635
Thanked 177 Times in 154 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
|
12-22-2021, 11:06 AM
|
|
Premium Member
|
|
Join Date: Sep 2010
Location: Behind you
Posts: 438
Thanked 28 Times in 24 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.
|
12-23-2021, 04:20 AM
|
|
Free Member
|
|
Join Date: Mar 2013
Location: Italy
Posts: 635
Thanked 177 Times in 154 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/
|
The following users thank lollo2 for this useful post:
Winsordawson (01-01-2022)
|
12-23-2021, 05:31 AM
|
|
Free Member
|
|
Join Date: Mar 2013
Location: Italy
Posts: 635
Thanked 177 Times in 154 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
|
01-01-2022, 01:54 PM
|
|
Premium Member
|
|
Join Date: Sep 2010
Location: Behind you
Posts: 438
Thanked 28 Times in 24 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
|
01-01-2022, 03:08 PM
|
|
Free Member
|
|
Join Date: Mar 2013
Location: Italy
Posts: 635
Thanked 177 Times in 154 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
|
The following users thank lollo2 for this useful post:
Winsordawson (01-01-2022)
|
01-01-2022, 04:54 PM
|
|
Free Member
|
|
Join Date: Mar 2013
Location: Italy
Posts: 635
Thanked 177 Times in 154 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
|
The following users thank lollo2 for this useful post:
Winsordawson (01-01-2022)
|
All times are GMT -5. The time now is 01:09 AM
|