Skip to content

node-av / webrtc / RTPStreamOptions

Interface: RTPStreamOptions

Defined in: src/api/rtp-stream.ts:26

Options for configuring RTP streaming.

Properties

audio?

optional audio?: object

Defined in: src/api/rtp-stream.ts:95

Audio stream configuration.

channels?

optional channels?: number

encoderOptions?

optional encoderOptions?: UnknownEncoderOptions

mtu?

optional mtu?: number

payloadType?

optional payloadType?: number

sampleFormat?

optional sampleFormat?: AVSampleFormat

sampleRate?

optional sampleRate?: number

ssrc?

optional ssrc?: number


hardware?

optional hardware?: "auto" | { device?: string; deviceType: FFHWDeviceType | AVHWDeviceType; options?: Record<string, string>; }

Defined in: src/api/rtp-stream.ts:72

Hardware acceleration configuration.

  • 'auto' - Automatically detect and use available hardware acceleration
  • Object with deviceType - Manually specify hardware acceleration type

Default

ts
{ deviceType: AV_HWDEVICE_TYPE_NONE }

inputOptions?

optional inputOptions?: DemuxerOptions<string & object | DemuxerFormat>

Defined in: src/api/rtp-stream.ts:77

Input media options passed to Demuxer.


onAudioPacket?

optional onAudioPacket?: (packet) => void

Defined in: src/api/rtp-stream.ts:41

Callback invoked for each audio RTP packet. Use this to send packets to your RTP implementation.

Parameters

packet

RtpPacket

Serialized RTP packet ready for transmission

Returns

void


onClose?

optional onClose?: (error?) => void

Defined in: src/api/rtp-stream.ts:48

Callback invoked when the stream is closed or encounters an error.

Parameters

error?

Error

Optional error if stream closed due to an error

Returns

void


onVideoPacket?

optional onVideoPacket?: (packet) => void

Defined in: src/api/rtp-stream.ts:33

Callback invoked for each video RTP packet. Use this to send packets to your RTP implementation.

Parameters

packet

RtpPacket

Serialized RTP packet ready for transmission

Returns

void


signal?

optional signal?: AbortSignal

Defined in: src/api/rtp-stream.ts:111

AbortSignal for cancellation.

When aborted, the stream stops gracefully, equivalent to calling stop(). If already aborted when start() is called, throws AbortError.


supportedAudioCodecs?

optional supportedAudioCodecs?: (AVCodecID | FFAudioEncoder)[]

Defined in: src/api/rtp-stream.ts:62

Supported audio codec IDs for transcoding decisions. If not provided or empty, all audio codecs are supported (passthrough only, no transcoding). If provided, only the specified codecs are supported and transcoding will be performed if needed.


supportedVideoCodecs?

optional supportedVideoCodecs?: (AVCodecID | FFVideoEncoder)[]

Defined in: src/api/rtp-stream.ts:55

Supported video codec IDs for transcoding decisions. If not provided or empty, all video codecs are supported (passthrough only, no transcoding). If provided, only the specified codecs are supported and transcoding will be performed if needed.


video?

optional video?: object

Defined in: src/api/rtp-stream.ts:82

Video stream configuration.

encoderOptions?

optional encoderOptions?: UnknownEncoderOptions

fps?

optional fps?: number

height?

optional height?: number

mtu?

optional mtu?: number

payloadType?

optional payloadType?: number

ssrc?

optional ssrc?: number

width?

optional width?: number