Skip to content

node-av / api / DemuxerOptions

Interface: DemuxerOptions

Defined in: src/api/demuxer.ts:147

Options for Demuxer opening.

Properties

bufferSize?

optional bufferSize: number

Defined in: src/api/demuxer.ts:156

Buffer size for reading/writing operations.

This option allows you to specify the buffer size used for I/O operations.

Default

ts
65536

copyTs?

optional copyTs: boolean

Defined in: src/api/demuxer.ts:222

Copy timestamps from input to output.

When enabled, timestamps are passed through without modification. This disables most timestamp discontinuity corrections except for PTS wrap-around detection in discontinuous formats.

Matches FFmpeg CLI's -copyts option.

Default

ts
false

dtsDeltaThreshold?

optional dtsDeltaThreshold: number

Defined in: src/api/demuxer.ts:197

DTS delta threshold in seconds.

Timestamp discontinuity detection threshold for formats with AVFMT_TS_DISCONT flag. When DTS delta exceeds this value, it's considered a discontinuity.

Matches FFmpeg CLI's -dts_delta_threshold option.

Default

ts
10

dtsErrorThreshold?

optional dtsErrorThreshold: number

Defined in: src/api/demuxer.ts:209

DTS error threshold in seconds.

Timestamp discontinuity detection threshold for continuous formats (without AVFMT_TS_DISCONT). When DTS delta exceeds this value, it's considered a timestamp error.

Matches FFmpeg CLI's -dts_error_threshold option.

Default

ts
108000 (30 hours)

format?

optional format: string

Defined in: src/api/demuxer.ts:165

Force specific input format.

Use this to specify the input format explicitly instead of auto-detection. Useful for raw formats like 'rawvideo', 'rawaudio', etc.


options?

optional options: Record<string, string | number | boolean | null | undefined>

Defined in: src/api/demuxer.ts:230

FFmpeg format options passed directly to the input.

Key-value pairs of FFmpeg AVFormatContext options. These are passed directly to avformat_open_input().


signal?

optional signal: AbortSignal

Defined in: src/api/demuxer.ts:238

AbortSignal for cancellation.

When aborted, async generators stop yielding and async methods throw AbortError. The demux thread is stopped automatically.


skipStreamInfo?

optional skipStreamInfo: boolean

Defined in: src/api/demuxer.ts:175

Skip reading stream information on open.

If true, stream info (codecs, formats, etc.) will not be read during opening. This can speed up opening time for certain use cases where stream info is not needed.

Default

ts
false

startWithKeyframe?

optional startWithKeyframe: boolean

Defined in: src/api/demuxer.ts:185

Start reading packets from the first keyframe.

When enabled, all packets before the first keyframe will be skipped. Useful for seeking and trimming operations.

Default

ts
false