Video Settings

Enumerations for video format and display settings.

AlphaCompositingMode

class avblocks.AlphaCompositingMode

Bases: IntEnum

Defines the way a foreground image will be combined with background video.

Atop = 4

Foreground atop Background.

If Fa is foreground alpha, Frgb is foreground RGB, Ba is background alpha, Brgb is background RGB, then Rrgb is the compositing result: Rrgb = (Fa * Frgb) * Ba + (1 - Fa) * (Ba * Brgb)

Fa and Ba are alpha density value with range from 0.0 to 1.0

In = 2

Foreground in Background - the alpha compositing equivalent of clipping / intersection.

If Fa is foreground alpha, Frgb is foreground RGB, Ba is background alpha, Brgb is background RGB, then Rrgb is the compositing result: Rrgb = (Fa * Frgb) * Ba

Fa and Ba are alpha density value with range from 0.0 to 1.0

Out = 3

Foreground outside Background.

If Fa is foreground alpha, Frgb is foreground RGB, Ba is background alpha, Brgb is background RGB, then Rrgb is the compositing result: Rrgb = (Fa * Frgb) * (1 - Ba)

Fa and Ba are alpha density value with range from 0.0 to 1.0

Over = 1

Foreground over Background - in effect, normal painting operation.

If Fa is foreground alpha, Frgb is foreground RGB, Ba is background alpha, Brgb is background RGB, then Rrgb is the compositing result: Rrgb = (Fa * Frgb) + (1 - Fa) * (Ba * Brgb)

Normally, alpha blending implies a background alpha of 1.0 (Ba = 1.0), so the compositing result Rrgb becomes: Rrgb = (Fa * Frgb) + (1 - Fa) * Brgb

Fa and Ba are alpha density value with range from 0.0 to 1.0

Plus = 6

Foreground plus Background.

If Fa is foreground alpha, Frgb is foreground RGB, Ba is background alpha, Brgb is background RGB, then Rrgb is the compositing result: Rrgb = (Fa * Frgb) + (Ba * Brgb)

Fa and Ba are alpha density value with range from 0.0 to 1.0

Xor = 5

Foreground xor Background.

If Fa is foreground alpha, Frgb is foreground RGB, Ba is background alpha, Brgb is background RGB, then Rrgb is the compositing result: Rrgb = (Fa * Frgb) * (1 - Ba) + (1 - Fa) * (Ba * Brgb)

Fa and Ba are alpha density value with range from 0.0 to 1.0

DeinterlacingMethod

class avblocks.DeinterlacingMethod

Bases: IntEnum

Defines video deinterlacing methods.

Blend = 2

Motion adaptive deinterlacing.

CAVT = 6

Content adaptive vertical temporal (CAVT) filtering.

Duplicate = 1

Line doubling.

EdgeDetect = 4

Uses an edge detection filter.

Median = 3

Calculates the median of consecutive fields

MedianThreshold = 5

Calculates the median of consecutive fields using a threshold.

NoDeinterlacing = 0

No deinterlacing is performed. This can be used to prevent automatic deinterlacing if it’s not desired.

InterpolationMethod

class avblocks.InterpolationMethod

Bases: IntEnum

Defines methods for sample interpolation.

Cubic = 4

Cubic convolution interpolation

Lanczos = 16

Interpolation by 3-lobed Lanczos-windowed sinc function.

Linear = 2

Linear interpolation

NearestNeighbor = 1

Nearest neighbor interpolation

Super = 8

Supersampling interpolation

Unknown = 0

The interpolation method is unknown or not set.

ColorFormat

class avblocks.ColorFormat

Bases: IntEnum

Defines constants for various color formats.

A color format is combination of color space, color depth, chroma sub-sampling, component layout and packing.

BGR24 = 12

Composite B->G->R

BGR32 = 11

Composite B->G->R

BGR444 = 15

Composite B->G->R->A, 4 bit per component

BGR555 = 14

Composite B->G->R->A, 5 bit per component, 1 bit per A

BGR565 = 13

Composite B->G->R, 5 bit per B & R, 6 bit per G

BGRA32 = 21

Composite B->G->R->A

GRAY = 16

Luminance component only.

NV12 = 2

Planar Y, merged U->V (4:2:0).

UYVY = 4

Composite U->Y->V->Y (4:2:2).

Unknown = 0

The color format is not specified or unknown.

Y411 = 9

Composite Y, U, V (4:1:1).

Y41P = 10

Composite Y, U, V (4:1:1).

YUV411 = 5

Planar Y, U, V (4:1:1).

YUV420 = 6

Planar Y, U, V (4:2:0).

YUV420A = 17

Planar Y, U, V, Alpha

YUV422 = 7

Planar Y, U, V (4:2:2).

YUV422A = 18

Planar Y, U, V, Alpha

YUV444 = 8

Planar Y, U, V (4:4:4).

YUV444A = 19

Planar Y, U, V, Alpha

YUY2 = 3

Composite Y->U->Y->V (4:2:2).

YV12 = 1

Planar Y, V, U (4:2:0, note V,U order!).

YVU9 = 20

The vertical subsampling interval is 4. The horizontal subsampling interval is also 4 This means that a single V and a single U sample are taken for each square block of 16 image pixels. Effectively this averages 9 bits per pixel (16 pixels => 16Y + 1V + 1U => 144bits => 9bits/pixel)

ScanType

class avblocks.ScanType

Bases: IntEnum

Defines video interlace/scan types.

BottomFieldFirst = 3

Interlaced video, where the dominant (first in time) field is the bottom field.

Progressive = 1

Progressive (non-interlaced) video.

TopFieldFirst = 2

Interlaced video, where the dominant (first in time) field is the top field.

Unknown = 0

The interlace/scan type is not specified or not known.