API / Minn\Media\Av / Analyzer

Analyzer final class

Minn\Media\Av\Analyzer · public/minn/src/Minn/Media/Av/Analyzer.php · 114 lines

A media file's analysis, keyed as the reference's media reader keys the one it hands to the wp_read_audio_metadata and wp_read_video_metadata filters (probe media-meta): the file's size, format and type, its audio and video streams, its playing time and bitrate, and its tags. The format is found by the file's first bytes; a file named .mp3 with none is still typed as MPEG audio.

Constants and properties

privateATOMS = array ( 0 => 'ftyp', 1 => 'moov', 2 => 'mdat', 3 => 'free', 4 => 'wide', 5 => 'skip', 6 => 'pnot', )

Public

staticanalyze(string $path): ?array#

The analysis of the file at a path; null when there is no such file.

@return array<string, mixed>|null
staticplaytimeString(int|float $seconds): string#

A playing time as a clock: minutes and seconds, with hours past the first.

Internals 3

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privateanalyzed(Minn\Media\Av\Source $source): array#
@return array<string, mixed>
privatestream(Minn\Media\Av\Source $source, int $start, int $end): array#

The stream's own part of the analysis, by its first bytes.

@return array<string, mixed>
privatempeg(Minn\Media\Av\Source $source, int $start, int $end): array#
@return array<string, mixed>