View Full Version : Getting Cropping\Resize Right
Bathrone
11th February 2006, 13:05
I had my process down pat for XVID and DIVX, and now that Im experimenting with x264 Im having problems with letterboxing.
Ok, so I use DGMPEGDEC, into AviSynth, into VirtualDUB for the video.
Previewing my transcodes in Virtualdub Ive got black bars top and bottom for 2.35:1 material. If I just do a resize, cos its Pal DVD 720x576 in widesceen cinemascope style 2.53:1 I think Im also encoding the letterboxing.
I dont know how many pixels I need to put into my avisynth script. My next problem is going to be what to do for widescreen 1.8:1 material.
I didnt have these problems before becuase I just patched the avi for the par.
Ive tried to search but am hopelessly confused and would appreciate any help :)
Matthew
12th February 2006, 08:37
It's been a long time since I encoded an XviD from dvd, but I remember Gordian Knot had good preview, and you can use autocrop. Auto Gordian Knot - which I haven't used - might be better.
The thing to remember is that aspect ratios are not necessarily exactly 2.35:1, they will often vary slightly, or there may even be borders on the side, so it's not possible to used fixed values.
MaximRecoil
12th February 2006, 17:10
With the method you are using, in your AVS script, just add in the crop values first and then the resize command after that.
Here is an example for a 1.85:1 DVD:
MPEG2Source("E:\test.d2v")
crop(4,66,-2,-68)
LanczosResize(640,352)
What it is doing is cropping 4 pixels from the left side, 66 pixels from the top, 2 pixels from the right side and 68 pixels from the bottom. In this example, that elimated all traces of black bars from all sides of the video frame.
The next line, resizes it to the correct aspect ratio. 640x346 is actually the exact ratio for 1.85:1, but I use 640x352 for both 1.78:1 (16:9) and 1.85:1 movies, because it is "close enough" to both aspect ratios with the added benefit of both 640 and 352 being multiples of 16, which some codecs prefer, or so I hear.
The easiest way to get the crop values in your case is to load the AVS script into VDub with only the MPEG2Source line, temporarily switch to "full processing mode", then go to Video > Filters > Add > Double Click "Null Transform" > Cropping.
This will give you a GUI to crop in, just click and drag the borders until there are no more black bars showing, be sure to keep the crop values as multiples of 2. If a perfect crop happens to be an odd number, it is better to cut one more pixel into the frame, than to back off a pixel leaving a little black.
So use the crop values you get here in your AVS script (don't forget to change back to fast recompress in VDub as well). For resizing, people commonly use 640x480 for 4:3 material, 640x272 for 2.35:1 and 640x352 for 16:9 and 1.85:1. Then when you load the script, the video will be all cropped and resized for you and you can proceed as usual with encoding it.
Bathrone
18th March 2006, 04:27
Thanks all :)
MaximRecoil I am greatly in your debt. Not only for this post, but for others in the past. My success in this has largely due to your explanations. Thanks alot, have a virtual beer. :D
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.