Skip to content

types

This module defines the various types of options that can be used with FFmpeg. These option types can be one of several different categories. The source of these types is defined within the AVOptionType enumeration found in FFmpeg's opt.h header file.

Attributes:

Name Type Description
Boolean

This represents FFmpeg's boolean type. It can accept either a Python boolean value (True or False)

Color

It can be the name of a color as defined below (case insensitive match) or a [0x|#]RRGGBB[AA] sequence, possibly followed by @ and a string representing the alpha component.

Double

This represents FFmpeg's double type. It can accept either a Python integer or float value

Duration

This represents FFmpeg's duration type. It can accept either a Python integer or float value

Flags

This represents FFmpeg's flags type. It accepts a string in the format "A+B",

Float

This represents FFmpeg's float type. It can accept either a Python integer or float value

Func

ref: OPT_TYPE_FUNC

Image_size

Specify the size of the sourced video, it may be a string of the form widthxheight, or the name of a size abbreviation.

Int

This represents FFmpeg's integer type. It can accept either a Python integer value

Int64

This represents FFmpeg's integer type. It can accept either a Python integer value

Pix_fmt

please see ffmpeg -pix_fmts for a list of supported pixel formats.

Rational

Specify the frame rate of a video, expressed as the number of frames generated per second. It has to be a string in the format frame_rate_num/frame_rate_den, an integer number, a float number or a valid video frame rate abbreviation.

String

This represents FFmpeg's string type. It can accept either a Python string value

Time

ref: OPT_TYPE_TIME

Video_rate

Specify the frame rate of a video, expressed as the number of frames generated per second. It has to be a string in the format frame_rate_num/frame_rate_den, an integer number, a float number or a valid video frame rate abbreviation.

Boolean module-attribute

Boolean = (
    bool
    | Literal["true", "false", "1", "0"]
    | Default
    | LazyValue
)

This represents FFmpeg's boolean type. It can accept either a Python boolean value (True or False) or a string that represents a boolean value ("true", "false", "1", or "0").

Color module-attribute

Color = str | Default | LazyValue

It can be the name of a color as defined below (case insensitive match) or a [0x|#]RRGGBB[AA] sequence, possibly followed by @ and a string representing the alpha component. The alpha component may be a string composed by "0x" followed by an hexadecimal number or a decimal number between 0.0 and 1.0, which represents the opacity value (‘0x00’ or ‘0.0’ means completely transparent, ‘0xff’ or ‘1.0’ completely opaque). If the alpha component is not specified then ‘0xff’ is assumed. The string ‘random’ will result in a random color.

Note

Document

Double module-attribute

Double = int | float | Default | LazyValue

This represents FFmpeg's double type. It can accept either a Python integer or float value or a string that represents a double value.

Duration module-attribute

Duration = str | int | float | Default | LazyValue

This represents FFmpeg's duration type. It can accept either a Python integer or float value or a string that represents a duration value.

Note

Document

Flags module-attribute

Flags = str | Default | LazyValue

This represents FFmpeg's flags type. It accepts a string in the format "A+B", where "A" and "B" are individual flags. For example, "fast+bilinear" would represent two flags, "fast" and "bilinear", to be used in FFmpeg's command line.

Float module-attribute

Float = int | float | Default | LazyValue

This represents FFmpeg's float type. It can accept either a Python integer or float value or a string that represents a float value.

Func module-attribute

Func = str | int | float | Default | LazyValue

ref: OPT_TYPE_FUNC

Image_size module-attribute

Image_size = str | Default | LazyValue

Specify the size of the sourced video, it may be a string of the form widthxheight, or the name of a size abbreviation.

Note

Document

Int module-attribute

Int = int | Default | LazyValue

This represents FFmpeg's integer type. It can accept either a Python integer value or a string that represents a integer value.

Int64 module-attribute

Int64 = int | Default | LazyValue

This represents FFmpeg's integer type. It can accept either a Python integer value or a string that represents a integer value.

Pix_fmt module-attribute

Pix_fmt = str | Default | LazyValue

please see ffmpeg -pix_fmts for a list of supported pixel formats.

Rational module-attribute

Rational = str | Default | LazyValue

Specify the frame rate of a video, expressed as the number of frames generated per second. It has to be a string in the format frame_rate_num/frame_rate_den, an integer number, a float number or a valid video frame rate abbreviation.

Note

Document

String module-attribute

String = str | int | float | Default | LazyValue

This represents FFmpeg's string type. It can accept either a Python string value or a int/float that will be converted to a string.

Time module-attribute

Time = str | int | float | Default | LazyValue

ref: OPT_TYPE_TIME

Video_rate module-attribute

Video_rate = str | int | float | Default | LazyValue

Specify the frame rate of a video, expressed as the number of frames generated per second. It has to be a string in the format frame_rate_num/frame_rate_den, an integer number, a float number or a valid video frame rate abbreviation.

Note

Document