Link Search Menu Expand Document

danog\MadelineProto\RecordingFormat

Back to index

Author: Daniil Gentili daniil@daniil.it

Container format of a call recording, as passed to {@see Call::setOutput()}.

{@see self::Webm} and {@see self::Mkv} both mux the incoming audio and video into a Matroska file in pure PHP (the peer’s frames are stored as-is, so the video track is whatever codec the peer sends — VP8/VP9/H.264/AV1 — and the audio is OPUS); they differ only in the declared EBML DocType. {@see self::Opus} keeps the audio-only behaviour, writing an OGG OPUS stream.

When no format is passed to {@see Call::setOutput()}, it is autodetected from the extension of the target — but only if a {@see LocalFile} was given; a raw stream, whose extension is unknown, defaults to {@see self::Opus}.

Constants

  • danog\MadelineProto\RecordingFormat::Webm: Matroska container with the webm DocType.

  • danog\MadelineProto\RecordingFormat::Mkv: Matroska container with the matroska DocType.

  • danog\MadelineProto\RecordingFormat::Opus: OGG OPUS audio-only stream.

Properties

  • $name: string

Method list:

Methods:

fromFile(\danog\MadelineProto\LocalFile $file): \danog\MadelineProto\RecordingFormat

Autodetect the recording format from a file’s extension: .mkv and .webm map to the matching Matroska format, and anything else (including an unknown extension) to {@see self::Opus}.

Parameters:

  • $file: \danog\MadelineProto\LocalFile

See also:

matroskaFor(\danog\MadelineProto\LocalFile|\Amp\ByteStream\WritableStream $file, ?\danog\MadelineProto\RecordingFormat $format): \danog\MadelineProto\RecordingFormat

Resolve the format of a multi-party call recording, which is always Matroska: the given one, or else {@see self::Webm} for a .webm {@see LocalFile} and {@see self::Mkv} for anything else.

Parameters:

  • $file: \danog\MadelineProto\LocalFile|\Amp\ByteStream\WritableStream
  • $format: ?\danog\MadelineProto\RecordingFormat

See also:

isMatroska(): bool

Whether this format muxes video (and audio) into a Matroska container, rather than audio-only OGG.

docType(): string

The EBML DocType to declare in the Matroska header for this format.

cases(): array


Generated by danog/phpdoc