Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > (Auto) Gordian Knot

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th May 2014, 21:18   #1  |  Link
osullic
Registered User
 
Join Date: May 2007
Posts: 27
Auto Width outputs 720 width, but should it be lower?

I use Auto Gordian Knot to backup my DVDs to Xvid AVI. I set the output resolution to "Auto width", and this seems to invariably produce (at least in conjunction with the rest of my settings) an AVI that is 720 pixels wide. Seeing as the source is also 720 pixels wide, I thought this was ideal, and never gave it much further thought.

But I was thinking recently about the fact that AutoGK also uses AutoCrop to get rid of black borders. So the "source" may not necessarily be 720 pixels wide. Say for example AutoCrop crops 8 pixels off the left and right-hand sides of the input video - the "source" is then 704 pixels wide. Yet AutoGK seems to upscale this back to 720 pixels wide. What's the rationale behind upscaling like this, rather than just outputting the 704-pixel-wide AVI?

Thanks for your insight.

Last edited by osullic; 5th June 2014 at 23:11.
osullic is offline   Reply With Quote
Old 5th June 2014, 23:31   #2  |  Link
osullic
Registered User
 
Join Date: May 2007
Posts: 27
I was casually looking at an AutoGK log file today and think I stumbled on the answer to my question.
AutoCrop is run as one step of an AviSynth script, right before resizing:
Code:
out_width = 720
...
autocrop(movie,mode=0,wmultof=4,hmultof=4,samples=10,aspect=new_aspect,threshold=34,samplestartframe=0,leftadd=0,rightadd=0,topadd=0,bottomadd=0)
LanczosResize(out_width,out_height)
It seems that AutoCrop is simply applied to the video, and the "autocropped" video passed on as input to the LanczosResize filter for resizing. The LanczosResize filter naturally requires width and height parameters, but the width of the "autocropped" video is not known, the video is just passed along. So, the developer has made a judgement call and just set the width parameter for the LanczosResize filter to 720. (I'm referring to the case where "Auto width" has been selected in AutoGK's "Output resolution settings".)

I may be wrong, as I'm not familiar with AviSynth scripts, but this seems to make some sense.

Last edited by osullic; 6th June 2014 at 10:56.
osullic is offline   Reply With Quote
Old 9th June 2014, 08:40   #3  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,821
There's kind of 2 ways to resize a DVD to square pixel dimensions. You can increase the width or reduce the height. For example to resize a 16:9 NTSC DVD to square pixels you could resize to something like 852x480 or 720x400 (cropping aside). The latter reduces the original 480 height a bit which can potentially lose you a little picture detail.

I'm pretty sure AutoGK runs the compression test using a width of 640 (with auto-cropping applied and the height resized accordingly) then adjusts the resolution up or down according to the result. I think when it's set to "auto" the maximum width will be 720 because that's the maximum most AVI capable DVD players support, but I guess the upshot of it all is..... the greater the width, the less the height needs to be reduced.

If memory serves me correctly..... AutoGK crops the video to remove the black, then it resizes to whatever resolution it deems best after running the compression test. It actually resizes so the height is mod16 (evenly divisible by 16) and the width is resized accordingly. Then, in order to make the width mod16, it crops again to remove a little picture if need be. For example....

AutoGK might crop and resize, and the result without distorting the picture might be 728x400. That's cropped to 720x400 and then it's encoded. You might lose a few pixels from the sides but the picture won't be stretched/squished at all. That's the way I remember it. If you look at a script AutoGK uses for encoding you'll probably find autocrop appears twice. Once to remove the crud, then later on to make the width mod16.

The above applies to 2 pass encoding. I can't remember what the auto width setting does when running single pass encoding. It might just automatically resize to the maximum resolution (width of 720).

Maybe if you'd care to post a full copy of a script someone can have a look to see exactly what AutoGK is doing. I can have a look, although I'm not really an expert on Avisynth scripts myself, but I should be able to figure out the gist of it.
hello_hello is offline   Reply With Quote
Reply

Tags
auto width

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:26.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.