Skip to content
Type

PacketRetrievalOptions

Additional options for controlling packet retrieval.

ts
type PacketRetrievalOptions = {
	metadataOnly?: boolean;
	verifyKeyPackets?: boolean;
	skipLiveWait?: boolean;
};

Used by

Properties

metadataOnly

ts
metadataOnly?: boolean;

When set to true, only packet metadata (like timestamp) will be retrieved - the actual packet data will not be loaded.

verifyKeyPackets

ts
verifyKeyPackets?: boolean;

When set to true, key packets will be verified upon retrieval by looking into the packet's bitstream. If not enabled, the packet types will be determined solely by what's stored in the containing file and may be incorrect, potentially leading to decoder errors. Since determining a packet's actual type requires looking into its data, this option cannot be enabled together with metadataOnly.

skipLiveWait

ts
skipLiveWait?: boolean;

When querying packets in live media that are in the future relative to the current live edge, Mediabunny will, by default, wait for the stream to advance until the query can be satisfied. In a sense, Mediabunny simply treats live streams as media files that are still being written, and any read that depends on future information will wait until it can be fulfilled.

If you want to query packets based only on the currently known information, set this field to true - this way, Mediabunny will never wait for the live stream to catch up.

For non-live media, this field has no effect.

Released under the Mozilla Public License 2.0.