API / Minn\Media\Av / Flv

Flv final class

Minn\Media\Av\Flv · public/minn/src/Minn/Media/Av/Flv.php · 215 lines

Flash video (FLV) as the reference's media reader measures it (probe media-meta). The onMetaData script tag gives the playing time, frame rate, data rates and codecs; the first audio tag gives the rate, sample size and channels; the first video tag's Sorenson picture header the size, or for H.264 its sequence parameter set, read as the reference reads it. The video's data rate is kept as written (kilobits), the audio's made bits; a file with no audio and no video rate gives the video the file's own rate.

Used by 1

Constants and properties

privateVIDEO_CODECS = array ( 2 => 'Sorenson H.263', 3 => 'Screen video', 4 => 'On2 VP6', 5 => 'On2 VP6 with alpha channel', 6 => 'Screen video v2', 7 => 'Sorenson H.264', )
privateAUDIO_CODECS = 'Linear PCM, platform endian|ADPCM|mp3|Linear PCM, little endian|Nellymoser 16kHz mono|Nellymoser 8kHz mono|Nellymoser|G.711A-law logarithmic PCM|G.711 mu-law logarithmic PCM|reserved|AAC|Speex|||mp3 8kHz|Device-specific sound'
privatePICTURE_SIZES = array ( 2 => array ( 0 => 352, 1 => 288, ), 3 => array ( 0 => 176, 1 => 144, ), 4 => array ( 0 => 128, 1 => 96, ), 5 => array ( 0 => 320, 1 => 240, ), 6 => array ( 0 => 160, 1 => 120, ), )

Public

staticread(Minn\Media\Av\Source $source): array#

The file's analysis.

@return array<string, mixed>

Internals 6

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

privateaudio(int $flags, array $meta): array#

The audio: its codec (by the metadata's code), the first tag's rate, size and channels, and the metadata's rate in bits.

$metaarray<string, mixed>
@return array<string, mixed>
privatevideo(string $tag, array $meta): array#

The video: its frame rate, its size (from a Sorenson picture header), the metadata's data rate as written, and its codec.

$metaarray<string, mixed>
@return array<string, mixed>
privatepictureSize(string $bytes): array#

The width and height a Sorenson H.263 picture header gives: its picture size code, or the 8-bit or 16-bit size that follows it.

@return array{0: int, 1: int}
privateavcSize(string $tag): array#

The width and height an H.264 sequence header gives, read as the reference reads them: the first parameter set of the decoder configuration, as stored (its emulation-prevention bytes kept), its fields read in the layout of the profiles without chroma settings whatever its profile, and its crop counted in pairs of samples. A tag that is no sequence header has no size.

@return array{0: int, 1: int}
privatenumber(mixed $value): int|float|null#

A metadata value that is a number other than zero, or null (a string or a flag says nothing).

privatemetaData(string $bytes): array#

The onMetaData object's numbers, read from its AMF0 encoding.

@return array<string, mixed>