# AutoCrop

## Übersicht

Autor: Glenn Bussell
Version: 1.1
Download: http://www.videofringe.com/autocrop
Kategorie: TV Capture
Anforderungen: YV12 oder YUY2 Farbformat

### Description

AutoCrop is an AVISynth filter that automatically crops the black borders from a clip. It operates in either preview mode where it overlays the recommended cropping information on
the existing clip, or cropping mode where it really crops the clip. It can also ensure width and height are multiples of specified numbers so the cropped clip can be passed to the video compressor of your choice without problems.

### Usage

AutoCrop takes 10 parameters but they are all optional so you can just do AutoCrop() to get a feel for how the filter works. Parameters can either be specified in order or by name. I suggest specifying by name as there is a lot of parameters!

Parameter order follows.

AutoCrop(mode, wMultOf, hMultOf, leftAdd, rightAdd, topAdd, bottomAdd, threshold, samples, aspect)

### Syntax

mode - Integer - default 1

0 - Crop - Crops the image
1 - Preview - Suggested cropping information is overlayed on the existing clip, including a crop command that you can use to replace AutoCrop with.
2 - Log - Logs the cropping parameters to the file "AutoCrop.log" in the current directory.

wMultOf - Integer - default 4

Ensures that the width of the cropped clip will be a multiple of the number specified. Use this to ensure that clip is a valid for whatever codec you are going to compress with.

hMultOf - Integer - default 2

As above but for height

leftAdd - Integer - default 0

Forces autocrop to crop and additional 'leftAdd' pixels after it completes auto detection. You can use this option in conjunction with wMultOf. Useful for cropping out bad quality lines on the side of VHS captures.

rightAdd - Integer - default 0

See above but for the right.

topAdd - Integer - default 0

Forces autocrop to crop and additional 'topAdd' pixels after it completes auto detection. You can use this option in conjunction with hMultOf. Useful for cropping out bad quality
lines on the top of VHS captures.

bottomAdd - Integer - default 0

See above but for the bottom.

threshold - Integer (0-255) - default 40

Threshold is the average luminance a line must have before it's considered non blank.

samples - Integer - default 10

The number of frames to examine when determining the cropping information. This directly affects the startup time of the filter. In general 10 seems to be plenty, if the slow startup is bothering you make the number lower.

aspect - Float - default 0 - Aspect is ignored

-1 - Maintain aspect ratio of the source clip
0 - Aspect is ignored
>0 - Aspect ratio will be set to this. For example for a 4:3 aspect ratio you would pass
4.0/3.0 or 1.33333333333. Note 4/3 won't work the .0 is need to tell AVISynth the value is a float.

### Recommended use

I strongly suggest using the preview mode before committing to a particular crop. It's also worth noting that copy the suggested settings in to the standard AviSynth crop command is quicker than running AutoCrop with mode = 0.

### Source

Source is included in the distribution.

### Planned future enchancements

Blanking Mode

Copyright (c) 2002 Glenn Bussell. All rights reserved.
glenn@videofringe.com

This file is subject to the terms of the GNU General Public License as published by the Free Software Foundation. A copy of this license is included with this software distribution in the file COPYING. If you do not have a copy, you may obtain a copy by writing to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.