Quantcast DVD/VHS source, problem with aspect ratio, jumping frames? - digitalFAQ Forum
Go Back    Forum > Digital Video > Video Project Help > Encode, Convert for streaming

Reply
 
LinkBack Thread Tools
  #1  
01-14-2019, 09:57 PM
CMroz CMroz is offline
Free Member
 
Join Date: Dec 2018
Posts: 5
Thanked 0 Times in 0 Posts
Hello,

TLDR Version: VHS video from a DVD source comes in at 352x480. The video only seems to progress every other frame. Can sort of solve the first problem, no clue on the second.

Details: I have been converting my family VHS tapes to digital files to share online. I will ultimately upload the files to Google Photos to share with my family. Converting the VHS sources has been going great (thanks to what I've learned at Digital FAQ) but now I am running into a strange problem with DVD source material.

About 10 years ago my mom sent about a dozen of her VHS tapes to a company to transfer to DVD. I am now trying to convert these DVDs to shareable files. The quality of the transfer isn't the best, but some of the original tapes are long gone so this is what I have. Here is my process so far. I am using MKVToolNix to convert to MKV. I've installed the MPEG plugins so I can open these in VirtualDub. Next I plan to deinterlace, filter with Camcorder color denoise, cover up the overscan, and then trim the videos into smaller clips.

See the attached uncompressed clip. My first issue is with the aspect ratio - the video comes in at 352x480. I've attempted to get around this by using the resize filter set to 480x640. It works, and looks okay, but I'm not sure this is the best/proper way to do it. The next, stranger issue, is that the video only seems to progress every other frame. I usually deinterlace using Yadif and double the frame rate - this definitely does not work, and creates a video that steps backwards every 3rd frame.

I'm sure my workflow is a mess, but I can't even seem to figure out the right things to search to find answers to this problem (I've researched Half D1 but I'm not sure this is what I'm looking at). Let me know what you would do different, or if any of the steps I'm taking are unnecessary.


Attached Files
File Type: avi Test Clip 01.avi (94.39 MB, 4 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  
01-15-2019, 04:11 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,232
Thanked 975 Times in 829 Posts
Welcome to the forum.

You won't get optimum results with the methods you're using. Besides, in order to analyze the problem with your DVD source we need to see something of the source, not a remnant of it. Please post a similar, unfiltered scene from the original DVD. Here is how it's done: How to upload a sample from DVD, MPEG-2 with DGindex [GUIDE]
Reply With Quote
  #3  
01-15-2019, 09:28 AM
CMroz CMroz is offline
Free Member
 
Join Date: Dec 2018
Posts: 5
Thanked 0 Times in 0 Posts
Thanks Sanlyn. I figured that was the case. I wasn't sure about the best way to post a clip from a DVD source, but I will follow your directions the instructions this evening and attach a sample.

Please see the attached clip. This does not exhibit the strange frame skipping issues, so that must be an incorrect setting in MKVToolNix (first time attempting to use that software).


Attached Files
File Type: m2v VTS_01_31.demuxed.m2v (4.14 MB, 1 downloads)
Reply With Quote
  #4  
01-15-2019, 09:34 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,232
Thanked 975 Times in 829 Posts
Thank you for the new sample. Will be much better to work with. Will look it over tonight.
Reply With Quote
  #5  
01-16-2019, 07:11 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,232
Thanked 975 Times in 829 Posts
Thank you again for the sample.

First, I wonder why you chose MKV as an output container if your objective is sharing and website posting. I would have gone for MP4, which is more specifically designed for streaming. MP4 is more widely recognized than mkv. In any case, the attached VTS01_480p_59.94fps_avs.mp4 is the result of damage repaired with Avisynth. I also made a VirtualDub version, discussed later. The DVD has many defects. You're unlikely to be able to make much improvement with VirtualDub alone, and MKVToolNix is not a restoration app. For deinterlace there is no better method than QTGMC. As for 352x480, some external player systems can't handle anamorphic video and most websites won't mount it, so the attached mp4 video has been resized in Avisynth to a more standard square-pixel 4:3 aspect ratio (640x480).

I can show you how to repair and convert the DVD with Avisynth but I'm not a user of MKVToolNix, which is far too limited for this purpose. My first step was to create a .d2v project file from the m2v using DGIndex. A .d2v is simply an index to an MPEG-encoded video. The d2v project was opened and decoded with AVisynth, then was filtered and repaired and saved as a lossless .avi with Lagarith lossless compression. From the .avi, the mp4 was encoded using TMPGenc Mastering Works, but I also made trial encodes with AviDemux.

If you have any more tapes that require transfer, I strongly suggest that you find another vendor. While there isn't much that can be done about past mistakes, you should be aware that the DVD looks very much like amateur work. Recording VHS to lossy low-bitrate codecs with no cleanup before encoding is one of the worst methods for transferring VHS. Analog noise and other shortcomings get imbedded as persistent digital artifacts; the noise wastes bitrate; detail gets smeared and lost; and cleaning lossy compression artifacts is a very destructive process. The DVD's bitrate is a low 2500 average and 3500 max, which is barely enough to meet DVD standards and makes compression noise look worse than it should. The transfer discarded 50% of the original color data and encoded at only one-half the usual horizontal resolution. There are also illegal luminance values that result in permanent loss of detail, especially in the brights, as well as mosquito noise and signs of mistracking along the top border.

Much of this damage can't be repaired. I chose filter settings that made visible improvements without losing much more detail. Of course, Avisynth isn't everyone's cup of tea, but you won't find another application that can repair and restore a damaged video the way one can with Avisynth. Other apps can deinterlace and resize, but you'll see a remarkable difference between the way Avisynth performs those same processes and the way that even a so-called "pro" editor does it.

Here is the Avisynth script I used to open, decode, deinterlace, repair and resize the video, with notations. The .avs script was typed with Windows Notepad. The script was executed and its output saved using Virtualdub.

Code:
Import("D:\Avisynth 2.5\plugins\RemoveDirtMC.avs")

MPEG2Source("D:\forum\faq\CMroz\VTS_01_31.demuxed.d2v")
Levels(12,1.1,255,16,235,dither=true,coring=false)
AssumeTFF()
QTGMC(preset="slow",EZDenoise=4,denoiser="dfttest",TR2=2,border=true)
RemoveDirtMC(30,false)
FluxSmoothT()
TemporalSoften(4,4,8,15,2)
Spline36Resize(640,height)
MergeChroma(aWarpSharp2(depth=20))
LimitedSharpenFaster()
AddGrainC(1.75,1.75)
Crop(-0,2,0,-8).AddBorders(0,4,0,6)
Some details about the script:

Import("D:\Avisynth 2.5\plugins\RemoveDirtMC.avs") imports the entire text of an Avisynth plugin named RemoveDirtMC.avs, which is a plain text file. There are several reasons why many Avisynth filters are published as .avs scripts, but in this case it's because there are many different versions of Removedirt that use similar code blocks. You would want to execute only one version at a time. You can also avoid using the Import() function by copying the entire text of the .avs filter into your own script, but that gets messy because many .avs filters have hundreds of lines of code.
Import(): http://avisynth.nl/index.php/Internal_functions#Import

Avisynth plugins come in three file types: compiled .dll's, scripted .avsi, and scripted .avs files. The dll and avsi filters are loaded into memory automatically when a script calls for them. But .avs filters have to be explicitly imported or copied into your script.

The function MPEG2Source("D:\forum\faq\CMroz\VTS_01_31.demuxed. d2v") is part of the dgmpgdec utility. It opens and decodes a .d2v project file created by DGindex, which you used earlier. DGindex is still the most frame accurate and trouble-free method of decoding MPEG encodes.
MPEG2Source() is a function of the DGDecode.dll plugin, which comes with dgmpgdec: http://avisynth.nl/index.php/DGDecode

Levels(12,1.1,255,16,235,dither=true,coring=false) reconfigures illegal luminance levels so that they conform to the digital YUV standard luminance range of 16-to-235 (or y=16-235). This prevents clipping or destruction of out-of-range luminance data -- although some dark and bright clipping has already occurred during DVD recording and can't be recovered. You can see how detail is lost in the bright rooftops of your sample video as well as in the "blooming" effect of colors in the passing boat. The numbers in the "Levels" statement indicate the following values, in this sequence: dark input target (12), desired gamma setting (1.1), bright input target (255), dark output target (16), bright output target (235). The dark input target of 12 asks the Levels function to brighten darks below y=16, and the bight input target of 255 asked that brights as high as 255 be gradually lowered to 235 on output. the "dither" and "coring" parameters are explained in documentation, but normally you'd set dither = true ad coring = false.
Levels(): http://avisynth.nl/index.php/Levels

AssumeTFF() informs Avisynth that the field priority of the incoming video is Top Field First (TFF). This overrides Avisynth's default assumption of Bottomn Field First (BFF).
AssumeTFF (Field Parity functions): http://avisynth.nl/index.php/Parity

QTGMC(preset="slow",EZDenoise=4,denoiser="dfttest" ,TR2=2,border=true) deinterlaces the video using complex motion compensated (MC) techniques. One side effect of QTGMC's processing is some desirable noise reduction (which can be disabled, if you want). Denoising is tweaked by setting values for EZDenoise and by raising the default value of TR2 from 1 to 2 in order to help smooth some of the line twitter and horizontal line wiggling across the top of the frame. TR2 could be set higher but it would overly smooth or blur the entire frame. By default, deinterlacing doubles the number of frames and doubles the frame rate to 59.94 fps.

QTGMC is supplied as a package with support filters. There are several versions, but the easiest to use and implememnt is the "original" v3.32. It comes as a .zip complete package with the QTGMC.avsi plugin, Windows fftw3 library files, full documention, links to 3 required VisualC++ runtimes, and brief instructions about where to copy its support plugins, which are popular standalone filters in their own right. It also includes the Avisynth version of the yadif deinterlacer. http://www.digitalfaq.com/forum/atta...kagenov2017zip

RemoveDirtMC(30,false) is a general purpose denoiser that works on excess grain, some spots and dropouts, mosquito noise, and the VHS tape noise known as floating grunge. It's used here at a strength of 30, although it can vary from 10 to 100. Careful: values over 40 might remove more video than desired, such as small moving objects.
RemoveDirtMC.avs: http://www.digitalfaq.com/forum/atta...emovedirtmcavs.
If you're using Win7 or later, Microsoft might have forgot to give you two MSVC .dlls' that your system needs for this and other popular software. Check the thread at Fix for problems running Avisynth's RemoveDirtMC.
All versions of RemoveDirt require the RemoveDirt v0.9 package (http://www.digitalfaq.com/forum/atta...ovedirt_v09zip) and either RemoveGrain v1.0 (http://www.digitalfaq.com/forum/atta..._v1_0_fileszip) or RgTools.dll. RgTools.dll comes with the QTGMC package.

FluxSmoothT() is a temporal motion smoother that helps to address compression artifacts and distortion. It's one of three spatio-temporal smoothers applied to compression problems in your DVD (http://avisynth.nl/index.php/FluxSmooth). TemporalSoften(4,4,8,15,2) is another smoother that handles similar noise, but it's better to apply multiple mild smoothers rather than one strong one, to avoid ghosting and other artifacts. TemporalSoften is a built-in Avisynth filter (http://avisynth.nl/index.php/Soften).

After deinterlacing and denosiing, it's time to resize the video to square-pixel dimensions and a 4:3 frame. A popular precision resizer for that task is Spline36Resize, one of several Avisynth resizers. http://avisynth.nl/index.php/Resize

The statement MergeChroma(aWarpSharp2(depth=20)) works on color-only, not on luminance. It uses aWarpSharp2 to tighten colors more snuggly to edges, which means that it works to clean color smearing around edges, a common problem with VHS and with low-bitrate encodes. The 2015 version of the WarpSharp .dll plugin is at http://www.digitalfaq.com/forum/atta...sharp2_2015zip. It requires the 2013 VisualC++ runtime, which comes with the QTGMC package.
MergeChroma() is a built-in Avisynth function: http://avisynth.nl/index.php/Merge.

LimitedSharpenfaster is a sharpener. It has many adjustable parameters, but its "limiting" feature is that it tries to sharpen without creating edge artifacts. Of course, it cannot recover lost details or create new ones -- no sharpener can do that. Sharpeners are applied after denoising, never before, since no one wants to sharpen noise. LimitedSharpenFaster is easy to use; the defaults work OK most of the time. But it's not the typical simple-simon sharpener you get with editors. It's used only on non-interlaced video. It requires LimitedSharpenFaster.avsi v2.0b (http://avisynth.nl/index.php/LimitedSharpen). It also requires MaskTools2 and RgTools, both of which are supplied with the QTGMC package. And it requires WarpSharp, discussed and linked in the preceding paragraph.

AddGrainC(1.75,1.75) applies a very moderate amount of fine, film-like dithered grain to help prevent an over-filtered, plastic look. AddGrainC.dll is an old standby favorite that comes with the QTGMC package and is used as a support file by several other high-octane plugins.

The last step is cropping off bottom border head-switching noise, then applying black border pixels to restore the 640x480 full frame. Crop(-0,2,0,-8) is used to remove unwanted pixels in the following order: zero pixels from the left border, 2 pixels from the top border (to cut off some mistracking noise), zero pixels from the right border, and 8 pixels from the bottom. Then AddBorders(0,4,0,6) places clean new black pixels in a similar order: zero pixels on the left, 4 pixels scross the top, zero pixels on the right, and 6 pixels along the bottom to center the image vertically. Note that pixels are stated in even numbers, not as odd-numbered groups. There are specific rules for cropping based on colorspace and interlace structure.
Crop(): http://avisynth.nl/index.php/Crop
AddBorders(): http://avisynth.nl/index.php/AddBorders

In the next post I'll describe a Virtualdub mp4 version from the same m2v sample.


Attached Files
File Type: mp4 VTS01_480p_59.94fps_avs.mp4 (8.38 MB, 4 downloads)
Reply With Quote
  #6  
01-16-2019, 08:14 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,232
Thanked 975 Times in 829 Posts
The previous post describes how Avisynth was used to repair the DVD sample. Besides the mp4 made with Avisynth filters, I made another using Virtualdub alone. The mp4 is attached as VTS01_480p_59.94fps_VDub.mp4. Needless to say, the Avisynth version looks much cleaner and sharper. Below, A 2X blowup of one corner of frame 69 from the .m2v sample. Compare the VirtualDub mp4 frame (top image) to the Avisynth mp4 frame (bottom image):

2X blowup two version compare:


I opened the m2v sample directly in VirtualDub and loaded VirtualDub filters in the order shown below. You can automstically load the same filters and settings inn t he same order, using the attached VDub_version_settings.vcf file.



A .vcf is a text file that saves Virtualdub process settings. To load the filters and settings, open the .vcf file in VirtualDub by clicking "File..." -> "load processing settings...", then locate and select the downloaded .vcf. The filters will load as shown in the image. The filters must be in your VirtualDub plugins folder, or the .vcf won't work. The filters used are:
- VDub version of the yadif deinterlacer (this is a built-in VDub filter).
- VDub resize (this is a built-in VDub filter).
- 2-D cleaner optimized v0.9 (2dcleanopt_k7.vdf, attached as 2dcleanop09.zip).
- SmartSmoother HiQuality (SmoothHiQ.vdf, at http://www.digitalfaq.com/forum/atta...smootherhiqzip).
- bottom VDub resize (this is a built-in VDub filter).

Note that there are two resize filters, one near the top of the list and another at the bottom. Each performs a different task. When the .vcf file is loaded it will automatically configure the two resize filters as described below:

The first resize filter performs a crop of the bottom border head-switching noise and centers the image vertically with new top and bottom border pixels. In order to do this, the resize filter was loaded and set up as shown in the image below:



After setting up the first resize filter, I performed a crop operation as shown in the image below. To open the Cropping dialog, click the "Cropping" command button (ORANGE ARROW). Then crop off the y-axis bottom border for 8 pixels (GREEN ARROW). Then close the dialog.



The .vcf file will automatically set up the two denoising filters and will then configure the bottom resize filter as shown below:



If you want to perform similar overscan or border cropping in VirtualDub, it's described in the thread at How to Properly Crop the Overscan in VirtualDub [GUIDE].

As you can see from the attached VTS01_480p_59.94fps_VDub.mp4, VirtuslDub can't compete with Avisynth for cleaning damaged videos and low-bitrate encodes.


Attached Images
File Type: jpg 2X blowup two version compare.jpg (65.9 KB, 14 downloads)
File Type: png filter chain.png (58.0 KB, 14 downloads)
File Type: png first resize filter.png (74.8 KB, 15 downloads)
File Type: png cropping.png (328.2 KB, 15 downloads)
File Type: png bottom resize filter.png (76.0 KB, 15 downloads)
Attached Files
File Type: vcf VDub_version_settings.vcf (1.3 KB, 0 downloads)
File Type: zip 2dcleanop09.zip (18.4 KB, 0 downloads)
File Type: mp4 VTS01_480p_59.94fps_VDub.mp4 (8.33 MB, 0 downloads)
Reply With Quote
  #7  
01-16-2019, 09:31 PM
CMroz CMroz is offline
Free Member
 
Join Date: Dec 2018
Posts: 5
Thanked 0 Times in 0 Posts
Wow! Let me start by saying thank you so much for taking the time to work on this with me and (patiently) walk me through the steps. This is incredible.

I realize these transfers were a bit garbage to start with, but this is the only remaining images of some of my family members so I wanted to do what I could. My mother had these transferred about 15 years ago and I'm sure she only did it because there was a special deal or something... so yes, probably a very low quality operation. I'll see if I can dig through her things and find any remaining VHS tapes to start over with.

I was mainly using MKV as a way of getting the file in a format that I could (sort of) work with in VirtualDub. I'm new to this, and from the posts I read it seemed like people were using either MakeMKV or MKVToliNix to decode the DVD and save out an editable file. Also, I have been using HandBrake to covert the edited clips to MP4 before uploading. I just didn't know how to work with the VOB files and those tools worked somewhat.

Ah Avisynth. I've read so much about it, and even though I see the clear benefits, I've been avoiding it. I need to get over my fear of the manual scripting and just start using it. No time like the present. I've already used your post to create a script and am now carefully going through each line to understand how it works and what the effects are.

So I have the video opened and decoded by Avisynth, and open in VirtualDub. Do I add back in the audio track at this point using "audio from other file" or is this something I should have Avisynth do?

The only other item I'm trying to fully understand is exactly how Crop & AddBorders works. The descriptions on the wiki seem straightforward, but I can't quite get my head around how the math works to center the image (-0,2,0,-8) (0,4,0,6) or what the -0 does? I'm familiar with how the process works in VirtualDub but I will have to research this a bit further.

----------------------------------
Just saw your VirtualDub post. I do definitely agree that Avisynth does a superior job. It also makes me feel less like a total idiot because my setup was very similar to yours with the same deinterlace settings and the stacked resize filters. I was mainly using Camcorder color denoise to clean up the video a bit, but I am going to further research the filters you're using. In any case I'm going to explore the Avisynth solution for this, and future, projects.


Thanks again very much!
Reply With Quote
  #8  
01-17-2019, 01:26 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,232
Thanked 975 Times in 829 Posts
Quote:
Originally Posted by CMroz View Post
Ah Avisynth. I've read so much about it, and even though I see the clear benefits, I've been avoiding it. I need to get over my fear of the manual scripting and just start using it. No time like the present. I've already used your post to create a script and am now carefully going through each line to understand how it works and what the effects are.
Good work on giving Avisynth a try. I always figured that if a klutz like me can do it, anyone can. I avoided it for years myself, but finally lordsmurf and a few others dragged me kicking and screaming into it out of sheer necessity for ancient family tapes and faded films. Fortunately you don't have to design the filters and commands, you just learn to use them from examples found in documentation and other threads. And fortunately you only have to build a toolkit of a few filters that handle common problems. Don't discount Virtualdub entirely. It does have many handy features and analysis tricks, and you'll find uses for a few of their filters such as ColorCamcorderDenoise. I've worked a lot of projects with Virtualdub alone, though admittedly they were videos is fairly good shape to begin with.

BTW, the Avisynth version I use is still the most popular, which is plain version 2.60. Mine is dated May 2015.

Quote:
Originally Posted by CMroz View Post
So I have the video opened and decoded by Avisynth, and open in VirtualDub. Do I add back in the audio track at this point using "audio from other file" or is this something I should have Avisynth do?
Despite the weird fact that the clever designer of DGIndex forgot about equally clever ways of remuxing the audio, there are several ways of doing it. Actually several methods already existed, so i guess the designer didn't try to re-invent the wheel. Notice that when you create a .d2v project file you also get an audio file. It's usually AC3 but could also be mp2 or some other format.

There's an Avisynth plugin called NicAudio (http://avisynth.nl/index.php/NicAudio). Use it in a script to remux the audio with the Audiodub() function when you open a source file. An example from an old thread that used Dolby AC3 audio:
Code:
aud=NicAC3Source("E:\Comedy Sample PID 125 L2 2ch 48 256 DELAY 5ms.AC3")
vid=MPEG2Source("E:\Comedy Sample.d2v")
AudioDub(vid,aud)
...and so on...
You won't likely run into oddball audio formats with home video sources, but in case you find some unidentified sound source you can use the audio functions of FFMS2 (http://avisynth.nl/index.php/FFmpegSource) to try and decode it from a source file like .ts, .m2ts, .mp4, .mkv, etc.:
Code:
aud=FFAudioSource("E:\Oddball Sample.ts")
vid=MPEG2Source("E:\Oddball Sample.d2v")
AudioDub(vid,aud)
You can always load an avi or mpeg into VirtualDub and save the audio-only as an uncompressed PCM (.wav) file:
Code:
aud=WavSource("E:\saved audio.wav")
vid=AviSourced("E:\saved video.avi")
AudioDub(vid,aud)
WavSource() is related to AviSource() and similar source functions, explained at http://avisynth.nl/index.php/AviSource. When you want to look up some Avisynth function, go to Google and enter "Avisynth" followed by a function or filter name. Avisynth also installs online help in the Avisynth program folder. Look into your Windows program listings, open the Avisynth program group, and click "Avisynth documentation". There's an A-to-Z alphabet grid in the upper left-hand margin. The internet wiki pages are often updated or have more graphics. I keep a shortcut to Avisynth Help on my desktop. It's a good thing you can't wear out desktop icons by clicking on them!

The other way of remuxing audio is what you mentioned earlier, using VirtualDub to add audio from another source file. I've used that plenty of times, but it does get tricky if your script does some cutting internally, in which case the imported audio will no longer be in sync.

Quote:
Originally Posted by CMroz View Post
The only other item I'm trying to fully understand is exactly how Crop & AddBorders works. The descriptions on the wiki seem straightforward, but I can't quite get my head around how the math works to center the image (-0,2,0,-8) (0,4,0,6) or what the -0 does?
Hmm. Hope there's not a minus -0 in there. It means the same thing as plain zero. Crop() works in a left-to-right, top-to-bottom direction.

Let's say you want to remove 8 pixels from the left border and 8 pixels from the right border. If you remove 8 pixels from the left border, you go 8 pixels into the frame from left to right. But if you remove 8 pixels from the right-hand border, you move in the opposite direction, so 8 becomes minus 8 (-8) because you're removing pixels from right to left instead of left to right. So the command to remove 8 pixels each from the left and right borders would be Crop(8,0,-8,0). It gets a little more complicated the way some people write it another way: If you remove pixels from left to right, and you have a frame that's 720 pixels wide, you could write it as Crop(8,0,712,0). Personally I think the second way is more confusing. When in doubt I just stick to the way it's shown in examples.

AddBorders() doesn't use the left-to-right or top-down direction. It just adds pixels to whatever edge you tell it to, and the order for the numbers given is always left, top, right, bottom. in other words, the AddBorders() sequence numbers start at the left side and move clockwise around the frame.

Centering seems simple. In the example of your video you resized to a 640x480 frame that is 480 pixels in height. If you remove 2 pixels from the top and 8 pixels from the bottom, you've removed a total of 10 pixels and the new height is 470 pixels instead of 480. To center the frame vertically you add half the needed pixels to the top and half to the bottom. Well, 1/2 of 10 is 5. But you can't use odd-numbers of pixel groups, you must always use 2's (and if it's interlaced YV12, you have to work in groups of 4 vertically!). So you compromise: add 4 pixels to the top border and 6 pixels to the bottom. That centers the frame vertically, more or less within 2 pixels, and restores the original frame height of 480 pixels.

You can also be somewhat obsessive-compulsive with Avisynth and even with VirtualDub), and try for perfection. As long as you realize that perfection isn't possible no matter what you use, you'll avoid wearing yourself out. Fact is, some broken things just can't be fixed.

The forum has hundreds of threads with details about Avisynth (and Virtualdub) projects that work with video samples, good and bad, garbage and pristine. Browsing those threads is the way most of us learn to identify problems and work with the software.

Last edited by sanlyn; 01-17-2019 at 01:45 AM.
Reply With Quote
  #9  
01-17-2019, 08:24 PM
CMroz CMroz is offline
Free Member
 
Join Date: Dec 2018
Posts: 5
Thanked 0 Times in 0 Posts
Thank you again for the guidance. I'm re-working all of the DVDs that I've transferred so far. I think it will be worth the time to do it the right. I couldn't have gotten this far without your help!

Thanks also for the centering/crop explanation. I knew using even number was required but for some reason wasn't thinking about that when I was typing it all in. I think the numbers not being the same threw me off, but it makes complete sense now.

One last questions before I go too far down an incorrect road (again). I am cutting the videos into smaller clips to make them easier to navigate and share. Currently VirtualDub is pretty bogged down once I have the video loaded with Avisynth and I'm unable to scrub around as quickly as I normally could. Do you see any issues with me simply saving the file once loaded (using Lagarith lossless compression) and then opening the resulting AVI file and making my cuts, and saving out the individual clips (again with Lagarith)? I assume lossless is lossless, so it shouldn't degrade quality, but I always feel cautious about saving, reopening, and saving again.
Reply With Quote
  #10  
01-17-2019, 08:34 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,232
Thanked 975 Times in 829 Posts
Accidentally or not, you've happened onto one of the major advantages of lossless codecs: the ability to recompress multliple lossless versions and intermediate working files without damaging a single pixel. I do it all the time, breaking up 90-minute captures into 5- to 8-minute segments, each segment taking a handful or so of working versions of the same thing before I get a final output.

At project's end you don't have to save all those intermediates, but you might want to keep text notes and old scripts.
Reply With Quote
The following users thank sanlyn for this useful post: CMroz (01-17-2019)
  #11  
01-20-2019, 10:36 AM
CMroz CMroz is offline
Free Member
 
Join Date: Dec 2018
Posts: 5
Thanked 0 Times in 0 Posts
Hello again Sanlyn. I've been running into a problem with my project now that I'm using Avisynth, and I wanted to get your thoughts. I've been following the same steps for all of the DVDs, and while some have completed successfully, many times I get an "out of memory error" from VirtualDub. Sometimes when I run the process again it works fine. My computer has plenty of memory and hard drive space so I'm struggling to solve this. The encodes are taking around 8-11 hours each and this happens at the very end of the process (of course). When I attempt to open the saved AVI, I get the message that VirtualDub is "Reconstructing missing index block".

I've searched around for similar issues here and on other forums and it doesn't seem that common, and it's usually related a particular plugin. I was wondering if you've ever run into this?

Here is the script I'm using:
Code:
Import("D:\Avisynth 2.5\plugins\RemoveDirtMC.avs")

MPEG2Source("E:\Family Videos\Disc 06\Disc06.d2v")
Levels(12,1.1,255,16,235,dither=true,coring=false)
AssumeTFF()
QTGMC(preset="slow",EZDenoise=4,denoiser="dfttest",TR2=2,border=true)
RemoveDirtMC(30,false)
FluxSmoothT()
TemporalSoften(4,4,8,15,2)
Spline36Resize(640,height)
MergeChroma(aWarpSharp2(depth=20))
LimitedSharpenFaster()
AddGrainC(1.75,1.75)
Crop(-0,2,0,-8).AddBorders(0,4,0,6)
Here is the VD log:[*] Beginning dub operation.
[i] Dub: Input (decompression) format is: YUV420.
[i] Dub: Output (compression) format is: RGB888.
[E] Error: Out of memory (unable to allocate 9254880 bytes)
Reply With Quote
  #12  
01-20-2019, 06:45 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,232
Thanked 975 Times in 829 Posts
Your script is CPU and memory-swap intensive. It doesn't always clear out RAM after completion.
It's been years since I spent 8 hours filtering and recompressing an entire video capture. Any app would have a problem with that. I encode short segments and join them later in my encoders.
Never save Avisynth output to RGB. Since the next step is usually MPEG or h.264 encoding,. I save output to YV12 using Lagarith.
When Avisynth starts acting silly I reboot Windows.
Reply With Quote
Reply




Tags
deinterlace, dvd, mkvtoolnix, vhs, virtualdub

Similar Threads
Thread Thread Starter Forum Replies Last Post
Camcorder capturing: aspect ratio, dropped frames, green lines? cicaesar Capture, Record, Transfer 10 12-05-2018 07:12 AM
Aspect Ratio problem with NTSC tapes? latreche34 Videography: Cameras, TVs and Players 15 05-28-2018 03:30 AM
Problem with x264 aspect ratio/upscale in Virtualdub Bobban Encode, Convert for streaming 2 06-27-2017 04:20 PM
Aspect Ratio Problem with Avisynth zack82 Capture, Record, Transfer 3 07-25-2014 03:18 AM
Help Fix Aspect Ratio Konfusion Restore, Filter, Improve Quality 3 11-04-2006 01:43 PM

Thread Tools



 
All times are GMT -5. The time now is 09:30 AM