I've been following a tutorial on how to use QTGMC to deinterlace video, which I've gotten to work, but I'm stuck on what to do in terms of cropping and resizing.
The tutorial is telling me to resize from 720x480 to 720x540 using Spline64Resize(720,540) after deinterlacing, but the sample video in the tutorial doesn't require any cropping/masking because it doesn't have any black borders or head noise at the bottom.
What should I do to properly resize my video while getting rid of the black borders and head noise at the bottom using avisynth?
Also, what would be a second option to add black borders after the video is properly trimmed for DVD conversion in the future?
I've tried to figure this out on my own but after reading more and more I'm just getting more confused.
Attached is a still shot of a capture of mine in question. All my video seems to have the same issue.
Thanks!
+ Reply to Thread
Results 1 to 10 of 10
-
-
The 704x480 portion has 4:3 proportions. It is up to you how you want to crop the image and present it. If you want to have the whole thing as 4:3, then yes, crop it to 704x480. If you want to crop the head-switching noise, then for every two horizontal lines you need to crop three vertical ones to keep the same aspect ratio.
-
I can remove the border and noise by using Crop(12, 0, -18, -8) which leaves me with 690x472. The tutorial I was using stretches to 720x480 to 720x520, which is stretching the image vertically by 1.125.
If I use that to stretch my trimmed video the return would be 690,531 (472*1.125=531). 531 isn't valid for h.264 encoding so I have to increase my trim to -16 to get an even Y-axis dimension.
So my trimming and resizing commands would be:
Crop(12, 0, -18, -16)
Spline64Resize(690,522)
I haven't seen those dimensions used before, but I believe the result would give the same "stretching" of the deinterlaced video. Does that sound correct?Last edited by chsgrits; 19th Oct 2023 at 12:15.
-
Assuming your source is a 4:3 NTSC tape capture (please confirm) its PAR (Pixel Aspect Ratio) is in very good approximation 10:11.
So you can crop as you initially suggested crop(12,0,-18-8) but resize to 720x540 which gives pretty exact square pixels and a DAR (Display Aspect Ratio) of 4:3.
Your second proposal would give a ~2% aspect ratio error which one would usually hardly notice.Last edited by Sharc; 19th Oct 2023 at 13:59.
-
If you are resizing to a low resolution (anything 720 or less) it is better to add black border to make up for the cropped pixels, the resizing only will destroy the video, too many rounding errors. If you intend to resize to anything 1440x1080 or higher then you don't have to mask, rounding errors are small at higher resolutions, But the cropping/resizing has to be done in lossless before encoding and after de-interlacing.
-
Yes. For DVD compliance don't resize to square pixels but leave it anamorphic. Leave it interlaced to preserve the motion fluidity of the video, crop interlace compliant, pad to 720x480, encode interlaced mpeg2 DAR 4:3, and "author" it as NTSC DVD.
If your DVD player supports 59.94fps progressive (not DVD spec compliant) you can bob-deinterlace to keep the motion fluidity of the video, otherwise you would have to re-interlace it to DVD compliant 720x480i29.97 (or apply single-rate deinterlacing from the beginning and loose motion fluidity).Last edited by Sharc; 19th Oct 2023 at 15:44.
-
The video is NTSC. Does this look right? The only thing that's throwing me off is that I'm removing the noise at the bottom, which changes the "stretching" a little bit for me since my video is slightly shorter after the crop. Also, is there really any point to upscaling here? If not, what should I change? My last step is encoding the video to H.264 when saving.
SetFilterMTMode("QTGMC", 2)
AVISource("basketball.avi", audio=true)
#AssumeBFF()
AssumeTFF()
QTGMC(preset="Slower", EdiThreads=12)
Crop(12, 0, -18, -8)
Spline64Resize(1440,1080) # Spline64 included sharpening
Prefetch(10) -
The script looks basically ok to me. For subsequent x264 4:2:0 encoding I would add ConvertToYV12() before the Prefetch() line.
Is there any point in upscaling?
Neither is prepared for DVD compliance though, as you have been asking for as a future option.
The other option would be masking, like
Code:AVISource("basketball.avi", audio=true) AssumeTFF() QTGMC(preset="Slower", EdiThreads=12) Crop(12, 0, -18, -8) Addborders(6,4,8,4) #padding to 704x480 ConvertToYV12() Prefetch(10)
Edit:
When you upscale an SD source to HD keep an eye on 601 vs 709 color matrix issues. If it is not flagged or converted correctly, a player (decoder) which will see HD resolution will usually assume 709 by default for decoding, while the original SD is normally 601. So a tint shift may happen, most evident for "green".Last edited by Sharc; 19th Oct 2023 at 17:12.
-
Thanks for the advice! I'm encoding using Virtualdub2 and I was planning on YUV 4:2:2 since I captured with Lagarith YUY2. Going this route I don't need ConvertToYV12() correct?
Similar Threads
-
File size 3x bigger when using Avisynth trim function through VDub2
By VideoYak in forum Newbie / General discussionsReplies: 6Last Post: 9th Sep 2023, 06:58 -
avisynth: how to trim alwais the last 3 seconds of the source?
By marcorocchini in forum Newbie / General discussionsReplies: 4Last Post: 16th Jun 2020, 17:44 -
AviSynth audio trim
By aradmey in forum EditingReplies: 29Last Post: 25th Jun 2019, 20:36 -
Resize 1904x1072 to 1920x1080 using avisynth
By Gwar in forum Video ConversionReplies: 6Last Post: 25th Oct 2018, 14:31