/*! * 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 { AppendOnlyStreamTarget } from 'mediabunny'; /** * Options for {@link MxfTarget}. * * @group \@mediabunny/server * @public */ export type MxfTargetOptions = { /** * Start timecode as `hh:mm:ss:ff`, or `hh:mm:ss;ff` for drop frame, written as the file's timecode * track. Broadcast delivery specifications generally require one; AS-11 does. */ startTimecode?: string; /** * Signal standard to force, by name as FFmpeg's `mxf` muxer takes it — `smpte274m` for 1125-line * HD, `smpte296m` for 750-line progressive. Left unset, the muxer infers one. */ signalStandard?: 'bt601' | 'bt1358' | 'smpte347m' | 'smpte274m' | 'smpte296m' | 'smpte349m' | 'smpte428'; /** Whether to keep the muxer's user-comment metadata. Defaults to true, as FFmpeg's does. */ storeUserComments?: boolean; /** * Writes the same bytes on every run, by setting FFmpeg's `bitexact` flag. * * MXF is the one container here where identical input does not give an identical file: `mxfenc` draws * the UMIDs at random, so two runs differ in those bytes while the essence repeats exactly. The flag * also drops the encoder and library version strings, which is what makes the file comparable. */ bitexact?: boolean; /** * The date written into the file's Preface and Identification sets. Defaults to the epoch, so two * runs of the same job produce the same bytes; `bitexact` alone does not, because it does not reach * these. Pass a `Date` for a real delivery date, or `null` for the wall clock. */ creationTime?: Date | null; /** * Bits per second to state as the video descriptor's `BitRate`, in place of the rate carried over * from the input. RDD 9 wants the rung's nominal rate there — 50000000 for XDCAM HD422 — where what * arrives is the average measured over whatever was written, which only approaches the nominal rate * over a long enough programme. * * Note that `ffprobe` reports `bit_rate=N/A` for an MXF video stream either way: FFmpeg's `mxf` * demuxer does not read that field back, so the only way to see it is to read the descriptor. */ videoBitRate?: number; }; /** * An {@link https://mediabunny.dev/guide/writing-media-files#target | output target} that writes **MXF * OP1a**, the operational pattern broadcast delivery specifications are written against — AS-11 (UK DPP) * among them. * * MXF is not muxed by this library. The target takes the **fragmented MP4** an `Output` writes and * remuxes it through FFmpeg's `mxf` muxer, so the file is OP1a by construction rather than by a * hand-written KLV layer. Use `new Mp4OutputFormat({ fastStart: 'fragmented' })`: a non-fragmented * format writes its `moov` only at the end and so cannot be read as it is produced. * * **Audio is one stream per channel.** Delivery specifications generally require discrete mono tracks * rather than an interleaved pair, so add an audio track per channel to the `Output`; each becomes its * own MXF track, frame-wrapped to the video's frame rate. * * Node only, and it writes to a path rather than a stream, because MXF's footer partition and index * tables need the file to be seekable. * * @example * ```ts * const output = new Output({ * format: new Mp4OutputFormat({ fastStart: 'fragmented' }), * target: new MxfTarget('/deliverables/programme.mxf', { startTimecode: '10:00:00:00' }), * }); * ``` * * @group \@mediabunny/server * @public */ export declare class MxfTarget extends AppendOnlyStreamTarget { constructor(path: string, options?: MxfTargetOptions); /** Packets written to the MXF file so far, counted after frame-wrapping rather than before. */ get writtenPackets(): number; } //# sourceMappingURL=mxf-target.d.ts.map