videosphere
    Preparing search index...

    Function prepareBackupMetadataVideoForUpload

    • Stages the source stream to a short-lived temp file, runs ffmpeg with seekable input to write a metadata-injected MP4 or MOV (+faststart, -codec copy), then returns the output file as a web ReadableStream for backup upload. MP4/MOV sources usually place moov at the end of the file, so piping into ffmpeg stdin cannot demux the full media; a seekable temp copy is required for reliable metadata injection without re-encoding.

      Parameters

      • input: {
            source: Readable;
            expectedContentLength: number;
            sourceContentType?: string;
            metadata: BackupInjectedMetadata;
            signal?: AbortSignal;
        }

        Node readable source, expected byte length, source MIME type, metadata fields, and optional abort signal.

      Returns Promise<PreparedBackupMetadataVideo>

      Upload stream, content length, preserved container MIME type, and PreparedBackupMetadataVideo.dispose.