function analyze() { $bits = new FLV_Util_BitStreamReader($this->body); $this->codec = $bits->getInt(4); $this->frequency = $bits->getInt(2); $this->depth = $bits->getInt(1); $this->mode = $bits->getInt(1); }
function analyze() { $bits = new FLV_Util_BitStreamReader($this->body); $this->codec = $bits->getInt(4); $this->codec_name = $this->audioFormat($this->codec); $this->frequency = $bits->getInt(2); $this->frequency_rate = $this->audioFormat($this->frequency); $this->depth = $bits->getInt(1); $this->depth_bit = $this->audioBitDepth($this->depth); $this->mode = $bits->getInt(1); $this->mode_name = $this->audioMode($this->mode); }
function analyze() { $bits = new FLV_Util_BitStreamReader($this->body); $this->frametype = $bits->getInt(4); $this->codec = $bits->getInt(4); $this->codec_name = $this->videoCodec($this->codec); switch ($this->codec) { case $this->CODEC_SORENSON_H263: //skip video packet header $bits->seek(17 + 5 + 8, SEEK_CUR); $type = $bits->getInt(3); switch ($type) { case 0x0: $this->width = $bits->getInt(8); $this->height = $bits->getInt(8); break; case 0x1: $this->width = $bits->getInt(16); $this->height = $bits->getInt(16); break; case 0x2: //CIF $this->width = 352; $this->height = 288; break; case 0x3: //QCIF $this->width = 176; $this->height = 144; break; case 0x4: //SQCIF $this->width = 128; $this->height = 96; break; case 0x5: $this->width = 320; $this->height = 240; break; case 0x6: $this->width = 160; $this->height = 120; break; } break; case $this->CODEC_SORENSON: $bits->seek(4, SEEK_CUR); $this->width = $bits->getInt(12); $bits->seek(4, SEEK_CUR); $this->height = $bits->getInt(12); break; // format layout taken from libavcodec project (http://ffmpeg.mplayerhq.hu/) // format layout taken from libavcodec project (http://ffmpeg.mplayerhq.hu/) case $this->CODEC_ON2_VP6: if ($this->frametype == 1) { $adjW = $bits->getInt(4); $adjH = $bits->getInt(4); $mode = $bits->getInt(1); if ($mode === 0) { $bits->seek(15, SEEK_CUR); $this->height = $bits->getInt(8) * 16 - $adjH; $this->width = $bits->getInt(8) * 16 - $adjW; } } break; case $this->CODEC_ON2_VP6ALPHA: if ($this->frametype == 1) { $adjW = $bits->getInt(4); $adjH = $bits->getInt(4); $mode = $bits->getInt(1); if ($mode === 0) { $bits->seek(39, SEEK_CUR); $this->height = $bits->getInt(8) * 16 - $adjH; $this->width = $bits->getInt(8) * 16 - $adjW; } } break; /* TODO: not tested */ /* TODO: not tested */ case $this->CODEC_SCREENVIDEO_2: $this->width = $bits->getInt(12); $this->height = $bits->getInt(12); break; default: break; } }