Matroska final class
Minn\Media\Av\Matroska · public/minn/src/Minn/Media/Av/Matroska.php · 314 lines
Matroska and WebM files (MKV, MKA, WebM) as the reference's media reader measures them (probe media-meta). The segment information gives the playing time and the date; the first video and audio tracks give the streams, named by their codec where the reader knows it (and by the codec identifier where it does not). MP3 and MP2 audio is described from its first frame, FLAC from its stream information, AC-3 from its first frame; the bitrate is the file's over its playing time, the video keeping what a known audio bitrate leaves.
Constants and properties
| private | SEGMENT = 408125543 | |
| private | CONTAINERS = array ( 0 => 440786851, 1 => 408125543, 2 => 357149030, 3 => 374648427, 4 => 174, 5 => 224, 6 => 225, ) | |
| private | VIDEO = array ( 'V_VP8' => 'vp8', 'V_MPEG4/ISO/AVC' => 'h264', 'V_MPEG4/ISO/ASP' => 'mpeg4', 'V_MS/VFW/FOURCC' => 'vcm', ) | |
| private | AUDIO = array ( 'A_AAC' => 'aac', 'A_AC3' => 'ac3', 'A_MPEG/L3' => 'mp3', 'A_MPEG/L2' => 'mp2', 'A_FLAC' => 'flac', 'A_PCM/INT/LIT' => 'pcm', 'A_VORBIS' => 'vorbis', ) | |
| private | FRAMED = array ( 0 => 'A_MPEG/L3', 1 => 'A_MPEG/L2', 2 => 'A_AC3', ) | The audio codecs described from their first frame, whose rate a file of audio alone keeps. |
| private | HEAD = 262144 | |
| private | EPOCH = 978307200 | Seconds between 1970 and 2001, where a Matroska date is counted from. |
Public
Internals 10
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | walk(string $bytes, int $at, int $end, array $found, ?array $track = NULL): void# | The elements from $at to $end that matter here, gathered into $found.
| ||||||
| private | element(int $id, string $value, array $found, ?array $track): void# | One element's value kept where it belongs.
| ||||||
| private | audio(array $track, string $bytes, ?int $segment): array# | A track's audio as the reference describes it: the codec's name, rate, channels, language and depth, then what the codec's own reader adds.
@return array<string, mixed> | ||||||
| private | video(array $track, int|float|null $bitrate): array# | A track's video: its codec's name (an AVI codec's named as AVI does), size, display size, frame rate and the bitrate it has.
@return array<string, mixed> | ||||||
| private | firstBlock(string $bytes, ?int $segment, int $number): ?string# | The first frame of a track, from the first cluster's blocks. | ||||||
| private | blockFor(string $block, int $number): ?string# | A block's payload when it belongs to the track numbered $number. | ||||||
| private | identifier(string $bytes, int $at): ?int# | An element id at $at, which it moves past: a variable-length number with its marker kept. | ||||||
| private | size(string $bytes, int $at): ?int# | An element size at $at, which it moves past: its marker dropped, all ones (an unknown size) read as the most there can be. | ||||||
| private | float(string $value): float# | A float element's value (four or eight bytes, big-endian). | ||||||
| private | signed(string $value): int# | A signed big-endian integer element's value. |
Nothing matches.