/*! * Copyright (c) 2025-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 { Muxer } from "../muxer"; import type { Output, OutputAudioTrack, OutputSubtitleTrack, OutputVideoTrack } from "../output"; import { type MkvOutputFormat } from "../output-format"; import type { EncodedPacket } from "../packet"; import { type SubtitleCue, type SubtitleMetadata } from "../subtitles"; export declare class MatroskaMuxer extends Muxer { private writer; private ebmlWriter; private format; private trackDatas; private allTracksKnown; private segment; private segmentInfo; private seekHead; private tracksElement; private tagsElement; private attachmentsElement; private segmentDuration; private cues; private currentCluster; private currentClusterStartMsTimestamp; private currentClusterMaxMsTimestamp; private trackDatasInCurrentCluster; private duration; constructor(output: Output, format: MkvOutputFormat); start(): Promise; private writeEBMLHeader; /** * Creates a SeekHead element which is positioned near the start of the file and allows the media player to seek to * relevant sections more easily. Since we don't know the positions of those sections yet, we'll set them later. */ private maybeCreateSeekHead; private createSegmentInfo; private createTracks; private videoSpecificTrackInfo; private audioSpecificTrackInfo; private subtitleSpecificTrackInfo; private maybeCreateTags; private maybeCreateAttachments; private createSegment; private createCues; private get segmentDataOffset(); private allTracksAreKnown; getMimeType(): Promise; private getVideoTrackData; private getAudioTrackData; private getSubtitleTrackData; addEncodedVideoPacket(track: OutputVideoTrack, packet: EncodedPacket, meta?: EncodedVideoChunkMetadata): Promise; addEncodedAudioPacket(track: OutputAudioTrack, packet: EncodedPacket, meta?: EncodedAudioChunkMetadata): Promise; addSubtitleCue(track: OutputSubtitleTrack, cue: SubtitleCue, meta?: SubtitleMetadata): Promise; private interleaveChunks; /** * Due to [a bug in Chromium](https://bugs.chromium.org/p/chromium/issues/detail?id=1377842), VP9 streams often * lack color space information. This method patches in that information. */ private fixVP9ColorSpace; /** Converts a read-only external chunk into an internal one for easier use. */ private createInternalChunk; /** Writes a block containing media data to the file. */ private writeBlock; /** Creates a new Cluster element to contain media chunks. */ private createNewCluster; private finalizeCurrentCluster; onTrackClose(): Promise; /** Finalizes the file, making it ready for use. Must be called after all media chunks have been added. */ finalize(): Promise; } //# sourceMappingURL=matroska-muxer.d.ts.map