/*! * Copyright (c) 2026-present, Vanilagy and contributors * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import { CustomVideoEncoder, type MaybePromise, VideoCodec, VideoSample } from 'mediabunny'; import * as NodeAv from 'node-av'; import { VideoBitDepth } from '../../../src/codec'; /** * The transfer characteristics to signal for output encoded at `outputBitDepth`, given what the incoming frames claim. * PQ and HLG are defined from 10 bits up, so encoding shallower leaves the label describing samples that no longer * exist; the transfer is then stated as unspecified rather than stamped onto bytes that cannot carry it. */ export declare const transferForOutputBitDepth: (frameColorTrc: NodeAv.AVColorTransferCharacteristic, outputBitDepth: VideoBitDepth | null) => NodeAv.AVColorTransferCharacteristic; /** * Picks the pixel format the codec context will be opened with. A bit depth demanded by the codec string is either * met or refused; where none is demanded, the incoming frames' depth is preserved when the encoder can. */ export declare const choosePixelFormat: (options: { codecName: string | null | undefined; /** Null when the encoder advertises no list, in which case any depth is assumed reachable. */ supportedPixelFormats: NodeAv.AVPixelFormat[] | null; /** The depth the codec string states, which the output will be labelled with. */ requestedBitDepth: VideoBitDepth | null; /** The depth of the frames handed to the encoder. */ incomingBitDepth: VideoBitDepth | null; wantsAlpha: boolean; }) => NodeAv.AVPixelFormat; export declare class NodeAvVideoEncoder extends CustomVideoEncoder { frame: NodeAv.Frame; packet: NodeAv.Packet; codecContext: NodeAv.CodecContext | null; scaler: NodeAv.SoftwareScaleContext | null; dstFrame: NodeAv.Frame | null; avCodec: NodeAv.Codec; lastBuffer: Buffer | null; packetEmitted: boolean; lastScalerKey: string | null; quantizer: number | null; preciseTimings: { microsecondTimestamp: number; timestamp: number; duration: number; timestampIsValid: boolean; durationIsValid: boolean; }[]; static supports(codec: VideoCodec, config: VideoEncoderConfig): boolean; init(): Promise; createCodecContext(): Promise; encode(videoSample: VideoSample, options: VideoEncoderEncodeOptions): Promise; receivePacket(ret: number): void; flush(): Promise; close(): MaybePromise; } //# sourceMappingURL=video-encoder.d.ts.map