Letterbox

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (note AVS+ differences)
(Syntax and Parameters: new parameter color_yuv)
Line 17: Line 17:
 
== Syntax and Parameters ==
 
== Syntax and Parameters ==
 
{{FuncDef
 
{{FuncDef
|Letterbox(clip ''clip'', int ''top'', int ''bottom'' [, int ''x1'' , int ''x2'' , int ''color'' ] )
+
|Letterbox(clip ''clip'', int ''top'', int ''bottom'' [, int ''x1'' , int ''x2'' , int ''color'' ] [, int ''color_yuv'' {{AvsPluscon}}])
 
}}
 
}}
  
Line 32: Line 32:
 
::Fill color; specified as an RGB value. See [[Colors|this page]] for more information on specifying colors.
 
::Fill color; specified as an RGB value. See [[Colors|this page]] for more information on specifying colors.
 
::*For YUV clips, colors are converted from full-range (0{{D}}-255{{D}}) to YV-range (16{{D}}-235{{D}}).
 
::*For YUV clips, colors are converted from full-range (0{{D}}-255{{D}}) to YV-range (16{{D}}-235{{D}}).
 +
 +
:{{Par2|color_yuv|int|}} {{AvsPluscon}}
 +
::Specifies the color of the border using YUV values. It requires setting pixel_type to one of the YUV formats; otherwise it doesn't do anything.
 +
::Similar to {{FuncArg|color_yuv}} in BlankClip
  
 
== Changes ==
 
== Changes ==

Revision as of 13:16, 6 December 2019

Fills the top and bottom rows of each frame, and optionally the left and right columns, with black or color. This has several common uses:

  • Black out video noise from the existing black bands in an image that's already letterboxed
  • Black out the video noise at the bottom of the frame in VHS tape sources.
  • Black out overscan areas in VCD or SVCD sources.
  • Create a quick rectangular mask for other filters – a so-called "garbage matte"

See also: AddBorders, which increases frame size. Letterbox does not change frame size.

The functionality of Letterbox can be duplicated with a combination of Crop and AddBorders, but Letterbox is faster and easier.

Generally, it's better to Crop video noise off than to black it out; many older lossy compression algorithms don't deal well with solid-color borders, unless the border happens to fall on a macroblock boundary (16 pixels for MPEG). However, in some cases, particularly for certain hardware players, it's better to use Letterbox because it lets you keep a standard frame size.

AVS+ also supports RGB64, PlanarRGBA and YUVA.


Syntax and Parameters

Letterbox(clip clip, int top, int bottom [, int x1 , int x2 , int color ] [, int color_yuv AVS+])

int  top, bottom = (required)
Number of top and bottom rows to blank out.
  • For YV12 sources, top and bottom must be mod2 (divisible by 2).
int  x1, x2 = 0
Number of left (x1) and right (x2) columns to blank out.
  • For YUY2, YV16 and YV12 sources, left and right must be mod2 (divisible by 2).
  • For YV411 sources, left and right must be mod4 (divisible by 4).
int  color = (black)
Fill color; specified as an RGB value. See this page for more information on specifying colors.
  • For YUV clips, colors are converted from full-range (0d-255d) to YV-range (16d-235d).
int  color_yuv =
AVS+
Specifies the color of the border using YUV values. It requires setting pixel_type to one of the YUV formats; otherwise it doesn't do anything.
Similar to color_yuv in BlankClip

Changes

v2.07 Added color option.
v2.06 Added optional left and right parameters (x1 and x2).
Personal tools