Skip to content

node-av / lib / OptionInfo

Class: OptionInfo

Defined in: src/lib/option.ts:90

Option information descriptor.

Describes a single option available on an FFmpeg object. Contains metadata about the option including name, type, default value, valid range, and documentation. Used to discover and validate options.

Direct mapping to FFmpeg's AVOption.

Example

typescript
import { Option } from 'node-av';

// Get option info
const optInfo = Option.find(obj, 'bitrate');
if (optInfo) {
  console.log(`Option: ${optInfo.name}`);
  console.log(`Help: ${optInfo.help}`);
  console.log(`Type: ${optInfo.type}`);
  console.log(`Default: ${optInfo.defaultValue}`);
  console.log(`Range: ${optInfo.min} - ${optInfo.max}`);
}

See

AVOption - FFmpeg Doxygen

Constructors

Constructor

new OptionInfo(native): OptionInfo

Defined in: src/lib/option.ts:98

Internal

Parameters

native

NativeOption

The native option instance

Returns

OptionInfo

Accessors

defaultValue

Get Signature

get defaultValue(): unknown

Defined in: src/lib/option.ts:143

Default value.

The default value for this option. Type depends on the option type.

Direct mapping to AVOption->default_val.

Returns

unknown


flags

Get Signature

get flags(): AVOptionFlag

Defined in: src/lib/option.ts:176

Option flags.

Combination of AV_OPT_FLAG_* indicating option properties.

Direct mapping to AVOption->flags.

Returns

AVOptionFlag


help

Get Signature

get help(): string | null

Defined in: src/lib/option.ts:120

Option help text.

Human-readable description of the option's purpose.

Direct mapping to AVOption->help.

Returns

string | null


max

Get Signature

get max(): number

Defined in: src/lib/option.ts:165

Maximum value.

Maximum valid value for numeric options.

Direct mapping to AVOption->max.

Returns

number


min

Get Signature

get min(): number

Defined in: src/lib/option.ts:154

Minimum value.

Minimum valid value for numeric options.

Direct mapping to AVOption->min.

Returns

number


name

Get Signature

get name(): string | null

Defined in: src/lib/option.ts:109

Option name.

The name used to get/set this option.

Direct mapping to AVOption->name.

Returns

string | null


type

Get Signature

get type(): AVOptionType

Defined in: src/lib/option.ts:131

Option type.

Data type of the option value (AV_OPT_TYPE_*).

Direct mapping to AVOption->type.

Returns

AVOptionType


unit

Get Signature

get unit(): string | null

Defined in: src/lib/option.ts:216

Option unit.

Unit string for grouping related options.

Direct mapping to AVOption->unit.

Returns

string | null

Methods

getNative()

getNative(): NativeOption

Defined in: src/lib/option.ts:227

Internal

Get the underlying native Option object.

Returns

NativeOption

The native Option binding object


hasFlags()

hasFlags(...flags): boolean

Defined in: src/lib/option.ts:200

Check if option has specific flags.

Tests whether all specified flags are set using bitwise AND.

Parameters

flags

...AVOptionFlag[]

One or more flag values to check

Returns

boolean

true if all specified flags are set, false otherwise

Example

typescript
import { AV_OPT_FLAG_ENCODING_PARAM } from 'node-av/constants';

if (option.hasFlags(AV_OPT_FLAG_ENCODING_PARAM)) {
  console.log('This option is used for encoding');
}

See

flags For direct flags access