本文整理汇总了PHP中getid3_riff::fourccLookup方法的典型用法代码示例。如果您正苦于以下问题:PHP getid3_riff::fourccLookup方法的具体用法?PHP getid3_riff::fourccLookup怎么用?PHP getid3_riff::fourccLookup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类getid3_riff
的用法示例。
在下文中一共展示了getid3_riff::fourccLookup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Analyze
public function Analyze()
{
$info =& $this->getid3->info;
// parse container
try {
$this->parseEBML($info);
} catch (Exception $e) {
$info['error'][] = 'EBML parser: ' . $e->getMessage();
}
// calculate playtime
if (isset($info['matroska']['info']) && is_array($info['matroska']['info'])) {
foreach ($info['matroska']['info'] as $key => $infoarray) {
if (isset($infoarray['Duration'])) {
// TimecodeScale is how many nanoseconds each Duration unit is
$info['playtime_seconds'] = $infoarray['Duration'] * ((isset($infoarray['TimecodeScale']) ? $infoarray['TimecodeScale'] : 1000000) / 1000000000);
break;
}
}
}
// extract tags
if (isset($info['matroska']['tags']) && is_array($info['matroska']['tags'])) {
foreach ($info['matroska']['tags'] as $key => $infoarray) {
$this->ExtractCommentsSimpleTag($infoarray);
}
}
// process tracks
if (isset($info['matroska']['tracks']['tracks']) && is_array($info['matroska']['tracks']['tracks'])) {
foreach ($info['matroska']['tracks']['tracks'] as $key => $trackarray) {
$track_info = array();
$track_info['dataformat'] = self::CodecIDtoCommonName($trackarray['CodecID']);
$track_info['default'] = isset($trackarray['FlagDefault']) ? $trackarray['FlagDefault'] : true;
if (isset($trackarray['Name'])) {
$track_info['name'] = $trackarray['Name'];
}
switch ($trackarray['TrackType']) {
case 1:
// Video
$track_info['resolution_x'] = $trackarray['PixelWidth'];
$track_info['resolution_y'] = $trackarray['PixelHeight'];
$track_info['display_unit'] = self::displayUnit(isset($trackarray['DisplayUnit']) ? $trackarray['DisplayUnit'] : 0);
$track_info['display_x'] = isset($trackarray['DisplayWidth']) ? $trackarray['DisplayWidth'] : $trackarray['PixelWidth'];
$track_info['display_y'] = isset($trackarray['DisplayHeight']) ? $trackarray['DisplayHeight'] : $trackarray['PixelHeight'];
if (isset($trackarray['PixelCropBottom'])) {
$track_info['crop_bottom'] = $trackarray['PixelCropBottom'];
}
if (isset($trackarray['PixelCropTop'])) {
$track_info['crop_top'] = $trackarray['PixelCropTop'];
}
if (isset($trackarray['PixelCropLeft'])) {
$track_info['crop_left'] = $trackarray['PixelCropLeft'];
}
if (isset($trackarray['PixelCropRight'])) {
$track_info['crop_right'] = $trackarray['PixelCropRight'];
}
if (isset($trackarray['DefaultDuration'])) {
$track_info['frame_rate'] = round(1000000000 / $trackarray['DefaultDuration'], 3);
}
if (isset($trackarray['CodecName'])) {
$track_info['codec'] = $trackarray['CodecName'];
}
switch ($trackarray['CodecID']) {
case 'V_MS/VFW/FOURCC':
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH . 'module.audio-video.riff.php', __FILE__, true);
$parsed = getid3_riff::ParseBITMAPINFOHEADER($trackarray['CodecPrivate']);
$track_info['codec'] = getid3_riff::fourccLookup($parsed['fourcc']);
$info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $parsed;
break;
/*case 'V_MPEG4/ISO/AVC':
$h264['profile'] = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 1, 1));
$h264['level'] = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 3, 1));
$rn = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 4, 1));
$h264['NALUlength'] = ($rn & 3) + 1;
$rn = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 5, 1));
$nsps = ($rn & 31);
$offset = 6;
for ($i = 0; $i < $nsps; $i ++) {
$length = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], $offset, 2));
$h264['SPS'][] = substr($trackarray['CodecPrivate'], $offset + 2, $length);
$offset += 2 + $length;
}
$npps = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], $offset, 1));
$offset += 1;
for ($i = 0; $i < $npps; $i ++) {
$length = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], $offset, 2));
$h264['PPS'][] = substr($trackarray['CodecPrivate'], $offset + 2, $length);
$offset += 2 + $length;
}
$info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $h264;
break;*/
}
$info['video']['streams'][] = $track_info;
break;
case 2:
// Audio
$track_info['sample_rate'] = isset($trackarray['SamplingFrequency']) ? $trackarray['SamplingFrequency'] : 8000.0;
$track_info['channels'] = isset($trackarray['Channels']) ? $trackarray['Channels'] : 1;
$track_info['language'] = isset($trackarray['Language']) ? $trackarray['Language'] : 'eng';
if (isset($trackarray['BitDepth'])) {
$track_info['bits_per_sample'] = $trackarray['BitDepth'];
}
//.........这里部分代码省略.........
示例2: Analyze
//.........这里部分代码省略.........
$thisfile_asf_videomedia_currentstream['format_data']['format_data_size'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
$videomediaoffset += 4;
$thisfile_asf_videomedia_currentstream['format_data']['image_width'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
$videomediaoffset += 4;
$thisfile_asf_videomedia_currentstream['format_data']['image_height'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
$videomediaoffset += 4;
$thisfile_asf_videomedia_currentstream['format_data']['reserved'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 2));
$videomediaoffset += 2;
$thisfile_asf_videomedia_currentstream['format_data']['bits_per_pixel'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 2));
$videomediaoffset += 2;
$thisfile_asf_videomedia_currentstream['format_data']['codec_fourcc'] = substr($streamdata['type_specific_data'], $videomediaoffset, 4);
$videomediaoffset += 4;
$thisfile_asf_videomedia_currentstream['format_data']['image_size'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
$videomediaoffset += 4;
$thisfile_asf_videomedia_currentstream['format_data']['horizontal_pels'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
$videomediaoffset += 4;
$thisfile_asf_videomedia_currentstream['format_data']['vertical_pels'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
$videomediaoffset += 4;
$thisfile_asf_videomedia_currentstream['format_data']['colors_used'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
$videomediaoffset += 4;
$thisfile_asf_videomedia_currentstream['format_data']['colors_important'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
$videomediaoffset += 4;
$thisfile_asf_videomedia_currentstream['format_data']['codec_data'] = substr($streamdata['type_specific_data'], $videomediaoffset);
if (!empty($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'])) {
foreach ($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'] as $dummy => $dataarray) {
if (isset($dataarray['flags']['stream_number']) && $dataarray['flags']['stream_number'] == $streamnumber) {
$thisfile_asf_videomedia_currentstream['bitrate'] = $dataarray['bitrate'];
$thisfile_video['streams'][$streamnumber]['bitrate'] = $dataarray['bitrate'];
$thisfile_video['bitrate'] += $dataarray['bitrate'];
break;
}
}
}
$thisfile_asf_videomedia_currentstream['format_data']['codec'] = getid3_riff::fourccLookup($thisfile_asf_videomedia_currentstream['format_data']['codec_fourcc']);
$thisfile_video['streams'][$streamnumber]['fourcc'] = $thisfile_asf_videomedia_currentstream['format_data']['codec_fourcc'];
$thisfile_video['streams'][$streamnumber]['codec'] = $thisfile_asf_videomedia_currentstream['format_data']['codec'];
$thisfile_video['streams'][$streamnumber]['resolution_x'] = $thisfile_asf_videomedia_currentstream['image_width'];
$thisfile_video['streams'][$streamnumber]['resolution_y'] = $thisfile_asf_videomedia_currentstream['image_height'];
$thisfile_video['streams'][$streamnumber]['bits_per_sample'] = $thisfile_asf_videomedia_currentstream['format_data']['bits_per_pixel'];
break;
default:
break;
}
}
}
while ($this->ftell() < $info['avdataend']) {
$NextObjectDataHeader = $this->fread(24);
$offset = 0;
$NextObjectGUID = substr($NextObjectDataHeader, 0, 16);
$offset += 16;
$NextObjectGUIDtext = $this->BytestringToGUID($NextObjectGUID);
$NextObjectSize = getid3_lib::LittleEndian2Int(substr($NextObjectDataHeader, $offset, 8));
$offset += 8;
switch ($NextObjectGUID) {
case GETID3_ASF_Data_Object:
// Data Object: (mandatory, one only)
// Field Name Field Type Size (bits)
// Object ID GUID 128 // GUID for Data object - GETID3_ASF_Data_Object
// Object Size QWORD 64 // size of Data object, including 50 bytes of Data Object header. may be 0 if FilePropertiesObject.BroadcastFlag == 1
// File ID GUID 128 // unique identifier. identical to File ID field in Header Object
// Total Data Packets QWORD 64 // number of Data Packet entries in Data Object. invalid if FilePropertiesObject.BroadcastFlag == 1
// Reserved WORD 16 // hardcoded: 0x0101
// shortcut
$thisfile_asf['data_object'] = array();
$thisfile_asf_dataobject =& $thisfile_asf['data_object'];
$DataObjectData = $NextObjectDataHeader . $this->fread(50 - 24);
开发者ID:richardbota,项目名称:WordPress-Theme-Development-with-Bootstrap,代码行数:67,代码来源:module.audio-video.asf.php