Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-inclu.../ID3
File: module.audio-video.quicktime.php
// 8-bit integer (boolean)
[500] Fix | Delete
$atom_structure['data'] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 1));
[501] Fix | Delete
break;
[502] Fix | Delete
[503] Fix | Delete
case 'tmpo':
[504] Fix | Delete
// 16-bit integer
[505] Fix | Delete
$atom_structure['data'] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 2));
[506] Fix | Delete
break;
[507] Fix | Delete
[508] Fix | Delete
case 'disk':
[509] Fix | Delete
case 'trkn':
[510] Fix | Delete
// binary
[511] Fix | Delete
$num = getid3_lib::BigEndian2Int(substr($boxdata, 10, 2));
[512] Fix | Delete
$num_total = getid3_lib::BigEndian2Int(substr($boxdata, 12, 2));
[513] Fix | Delete
$atom_structure['data'] = empty($num) ? '' : $num;
[514] Fix | Delete
$atom_structure['data'] .= empty($num_total) ? '' : '/'.$num_total;
[515] Fix | Delete
break;
[516] Fix | Delete
[517] Fix | Delete
case 'gnre':
[518] Fix | Delete
// enum
[519] Fix | Delete
$GenreID = getid3_lib::BigEndian2Int(substr($boxdata, 8, 4));
[520] Fix | Delete
$atom_structure['data'] = getid3_id3v1::LookupGenreName($GenreID - 1);
[521] Fix | Delete
break;
[522] Fix | Delete
[523] Fix | Delete
case 'rtng':
[524] Fix | Delete
// 8-bit integer
[525] Fix | Delete
$atom_structure[$atomname] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 1));
[526] Fix | Delete
$atom_structure['data'] = $this->QuicktimeContentRatingLookup($atom_structure[$atomname]);
[527] Fix | Delete
break;
[528] Fix | Delete
[529] Fix | Delete
case 'stik':
[530] Fix | Delete
// 8-bit integer (enum)
[531] Fix | Delete
$atom_structure[$atomname] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 1));
[532] Fix | Delete
$atom_structure['data'] = $this->QuicktimeSTIKLookup($atom_structure[$atomname]);
[533] Fix | Delete
break;
[534] Fix | Delete
[535] Fix | Delete
case 'sfID':
[536] Fix | Delete
// 32-bit integer
[537] Fix | Delete
$atom_structure[$atomname] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 4));
[538] Fix | Delete
$atom_structure['data'] = $this->QuicktimeStoreFrontCodeLookup($atom_structure[$atomname]);
[539] Fix | Delete
break;
[540] Fix | Delete
[541] Fix | Delete
case 'egid':
[542] Fix | Delete
case 'purl':
[543] Fix | Delete
$atom_structure['data'] = substr($boxdata, 8);
[544] Fix | Delete
break;
[545] Fix | Delete
[546] Fix | Delete
case 'plID':
[547] Fix | Delete
// 64-bit integer
[548] Fix | Delete
$atom_structure['data'] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 8));
[549] Fix | Delete
break;
[550] Fix | Delete
[551] Fix | Delete
case 'covr':
[552] Fix | Delete
$atom_structure['data'] = substr($boxdata, 8);
[553] Fix | Delete
// not a foolproof check, but better than nothing
[554] Fix | Delete
if (preg_match('#^\\xFF\\xD8\\xFF#', $atom_structure['data'])) {
[555] Fix | Delete
$atom_structure['image_mime'] = 'image/jpeg';
[556] Fix | Delete
} elseif (preg_match('#^\\x89\\x50\\x4E\\x47\\x0D\\x0A\\x1A\\x0A#', $atom_structure['data'])) {
[557] Fix | Delete
$atom_structure['image_mime'] = 'image/png';
[558] Fix | Delete
} elseif (preg_match('#^GIF#', $atom_structure['data'])) {
[559] Fix | Delete
$atom_structure['image_mime'] = 'image/gif';
[560] Fix | Delete
}
[561] Fix | Delete
$info['quicktime']['comments']['picture'][] = array('image_mime'=>$atom_structure['image_mime'], 'data'=>$atom_structure['data'], 'description'=>'cover');
[562] Fix | Delete
break;
[563] Fix | Delete
[564] Fix | Delete
case 'atID':
[565] Fix | Delete
case 'cnID':
[566] Fix | Delete
case 'geID':
[567] Fix | Delete
case 'tves':
[568] Fix | Delete
case 'tvsn':
[569] Fix | Delete
default:
[570] Fix | Delete
// 32-bit integer
[571] Fix | Delete
$atom_structure['data'] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 4));
[572] Fix | Delete
}
[573] Fix | Delete
break;
[574] Fix | Delete
[575] Fix | Delete
case 1: // text flag
[576] Fix | Delete
case 13: // image flag
[577] Fix | Delete
default:
[578] Fix | Delete
$atom_structure['data'] = substr($boxdata, 8);
[579] Fix | Delete
if ($atomname == 'covr') {
[580] Fix | Delete
if (!empty($atom_structure['data'])) {
[581] Fix | Delete
$atom_structure['image_mime'] = 'image/unknown'; // provide default MIME type to ensure array keys exist
[582] Fix | Delete
if (function_exists('getimagesizefromstring') && ($getimagesize = getimagesizefromstring($atom_structure['data'])) && !empty($getimagesize['mime'])) {
[583] Fix | Delete
$atom_structure['image_mime'] = $getimagesize['mime'];
[584] Fix | Delete
} else {
[585] Fix | Delete
// if getimagesizefromstring is not available, or fails for some reason, fall back to simple detection of common image formats
[586] Fix | Delete
$ImageFormatSignatures = array(
[587] Fix | Delete
'image/jpeg' => "\xFF\xD8\xFF",
[588] Fix | Delete
'image/png' => "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A",
[589] Fix | Delete
'image/gif' => 'GIF',
[590] Fix | Delete
);
[591] Fix | Delete
foreach ($ImageFormatSignatures as $mime => $image_format_signature) {
[592] Fix | Delete
if (substr($atom_structure['data'], 0, strlen($image_format_signature)) == $image_format_signature) {
[593] Fix | Delete
$atom_structure['image_mime'] = $mime;
[594] Fix | Delete
break;
[595] Fix | Delete
}
[596] Fix | Delete
}
[597] Fix | Delete
}
[598] Fix | Delete
$info['quicktime']['comments']['picture'][] = array('image_mime'=>$atom_structure['image_mime'], 'data'=>$atom_structure['data'], 'description'=>'cover');
[599] Fix | Delete
} else {
[600] Fix | Delete
$this->warning('Unknown empty "covr" image at offset '.$baseoffset);
[601] Fix | Delete
}
[602] Fix | Delete
}
[603] Fix | Delete
break;
[604] Fix | Delete
[605] Fix | Delete
}
[606] Fix | Delete
break;
[607] Fix | Delete
[608] Fix | Delete
default:
[609] Fix | Delete
$this->warning('Unknown QuickTime box type: "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $boxtype).'" ('.trim(getid3_lib::PrintHexBytes($boxtype)).') at offset '.$baseoffset);
[610] Fix | Delete
$atom_structure['data'] = $atom_data;
[611] Fix | Delete
[612] Fix | Delete
}
[613] Fix | Delete
}
[614] Fix | Delete
}
[615] Fix | Delete
}
[616] Fix | Delete
$this->CopyToAppropriateCommentsSection($atomname, $atom_structure['data'], $atom_structure['name']);
[617] Fix | Delete
break;
[618] Fix | Delete
[619] Fix | Delete
[620] Fix | Delete
case 'play': // auto-PLAY atom
[621] Fix | Delete
$atom_structure['autoplay'] = (bool) getid3_lib::BigEndian2Int(substr($atom_data, 0, 1));
[622] Fix | Delete
[623] Fix | Delete
$info['quicktime']['autoplay'] = $atom_structure['autoplay'];
[624] Fix | Delete
break;
[625] Fix | Delete
[626] Fix | Delete
[627] Fix | Delete
case 'WLOC': // Window LOCation atom
[628] Fix | Delete
$atom_structure['location_x'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 2));
[629] Fix | Delete
$atom_structure['location_y'] = getid3_lib::BigEndian2Int(substr($atom_data, 2, 2));
[630] Fix | Delete
break;
[631] Fix | Delete
[632] Fix | Delete
[633] Fix | Delete
case 'LOOP': // LOOPing atom
[634] Fix | Delete
case 'SelO': // play SELection Only atom
[635] Fix | Delete
case 'AllF': // play ALL Frames atom
[636] Fix | Delete
$atom_structure['data'] = getid3_lib::BigEndian2Int($atom_data);
[637] Fix | Delete
break;
[638] Fix | Delete
[639] Fix | Delete
[640] Fix | Delete
case 'name': //
[641] Fix | Delete
case 'MCPS': // Media Cleaner PRo
[642] Fix | Delete
case '@PRM': // adobe PReMiere version
[643] Fix | Delete
case '@PRQ': // adobe PRemiere Quicktime version
[644] Fix | Delete
$atom_structure['data'] = $atom_data;
[645] Fix | Delete
break;
[646] Fix | Delete
[647] Fix | Delete
[648] Fix | Delete
case 'cmvd': // Compressed MooV Data atom
[649] Fix | Delete
// Code by ubergeekØubergeek*tv based on information from
[650] Fix | Delete
// http://developer.apple.com/quicktime/icefloe/dispatch012.html
[651] Fix | Delete
$atom_structure['unCompressedSize'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 4));
[652] Fix | Delete
[653] Fix | Delete
$CompressedFileData = substr($atom_data, 4);
[654] Fix | Delete
if ($UncompressedHeader = @gzuncompress($CompressedFileData)) {
[655] Fix | Delete
$atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($UncompressedHeader, 0, $atomHierarchy, $ParseAllPossibleAtoms);
[656] Fix | Delete
} else {
[657] Fix | Delete
$this->warning('Error decompressing compressed MOV atom at offset '.$atom_structure['offset']);
[658] Fix | Delete
}
[659] Fix | Delete
break;
[660] Fix | Delete
[661] Fix | Delete
[662] Fix | Delete
case 'dcom': // Data COMpression atom
[663] Fix | Delete
$atom_structure['compression_id'] = $atom_data;
[664] Fix | Delete
$atom_structure['compression_text'] = $this->QuicktimeDCOMLookup($atom_data);
[665] Fix | Delete
break;
[666] Fix | Delete
[667] Fix | Delete
[668] Fix | Delete
case 'rdrf': // Reference movie Data ReFerence atom
[669] Fix | Delete
$atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1));
[670] Fix | Delete
$atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3));
[671] Fix | Delete
$atom_structure['flags']['internal_data'] = (bool) ($atom_structure['flags_raw'] & 0x000001);
[672] Fix | Delete
[673] Fix | Delete
$atom_structure['reference_type_name'] = substr($atom_data, 4, 4);
[674] Fix | Delete
$atom_structure['reference_length'] = getid3_lib::BigEndian2Int(substr($atom_data, 8, 4));
[675] Fix | Delete
switch ($atom_structure['reference_type_name']) {
[676] Fix | Delete
case 'url ':
[677] Fix | Delete
$atom_structure['url'] = $this->NoNullString(substr($atom_data, 12));
[678] Fix | Delete
break;
[679] Fix | Delete
[680] Fix | Delete
case 'alis':
[681] Fix | Delete
$atom_structure['file_alias'] = substr($atom_data, 12);
[682] Fix | Delete
break;
[683] Fix | Delete
[684] Fix | Delete
case 'rsrc':
[685] Fix | Delete
$atom_structure['resource_alias'] = substr($atom_data, 12);
[686] Fix | Delete
break;
[687] Fix | Delete
[688] Fix | Delete
default:
[689] Fix | Delete
$atom_structure['data'] = substr($atom_data, 12);
[690] Fix | Delete
break;
[691] Fix | Delete
}
[692] Fix | Delete
break;
[693] Fix | Delete
[694] Fix | Delete
[695] Fix | Delete
case 'rmqu': // Reference Movie QUality atom
[696] Fix | Delete
$atom_structure['movie_quality'] = getid3_lib::BigEndian2Int($atom_data);
[697] Fix | Delete
break;
[698] Fix | Delete
[699] Fix | Delete
[700] Fix | Delete
case 'rmcs': // Reference Movie Cpu Speed atom
[701] Fix | Delete
$atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1));
[702] Fix | Delete
$atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000
[703] Fix | Delete
$atom_structure['cpu_speed_rating'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 2));
[704] Fix | Delete
break;
[705] Fix | Delete
[706] Fix | Delete
[707] Fix | Delete
case 'rmvc': // Reference Movie Version Check atom
[708] Fix | Delete
$atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1));
[709] Fix | Delete
$atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000
[710] Fix | Delete
$atom_structure['gestalt_selector'] = substr($atom_data, 4, 4);
[711] Fix | Delete
$atom_structure['gestalt_value_mask'] = getid3_lib::BigEndian2Int(substr($atom_data, 8, 4));
[712] Fix | Delete
$atom_structure['gestalt_value'] = getid3_lib::BigEndian2Int(substr($atom_data, 12, 4));
[713] Fix | Delete
$atom_structure['gestalt_check_type'] = getid3_lib::BigEndian2Int(substr($atom_data, 14, 2));
[714] Fix | Delete
break;
[715] Fix | Delete
[716] Fix | Delete
[717] Fix | Delete
case 'rmcd': // Reference Movie Component check atom
[718] Fix | Delete
$atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1));
[719] Fix | Delete
$atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000
[720] Fix | Delete
$atom_structure['component_type'] = substr($atom_data, 4, 4);
[721] Fix | Delete
$atom_structure['component_subtype'] = substr($atom_data, 8, 4);
[722] Fix | Delete
$atom_structure['component_manufacturer'] = substr($atom_data, 12, 4);
[723] Fix | Delete
$atom_structure['component_flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 16, 4));
[724] Fix | Delete
$atom_structure['component_flags_mask'] = getid3_lib::BigEndian2Int(substr($atom_data, 20, 4));
[725] Fix | Delete
$atom_structure['component_min_version'] = getid3_lib::BigEndian2Int(substr($atom_data, 24, 4));
[726] Fix | Delete
break;
[727] Fix | Delete
[728] Fix | Delete
[729] Fix | Delete
case 'rmdr': // Reference Movie Data Rate atom
[730] Fix | Delete
$atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1));
[731] Fix | Delete
$atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000
[732] Fix | Delete
$atom_structure['data_rate'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 4));
[733] Fix | Delete
[734] Fix | Delete
$atom_structure['data_rate_bps'] = $atom_structure['data_rate'] * 10;
[735] Fix | Delete
break;
[736] Fix | Delete
[737] Fix | Delete
[738] Fix | Delete
case 'rmla': // Reference Movie Language Atom
[739] Fix | Delete
$atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1));
[740] Fix | Delete
$atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x0000
[741] Fix | Delete
$atom_structure['language_id'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 2));
[742] Fix | Delete
[743] Fix | Delete
$atom_structure['language'] = $this->QuicktimeLanguageLookup($atom_structure['language_id']);
[744] Fix | Delete
if (empty($info['comments']['language']) || (!in_array($atom_structure['language'], $info['comments']['language']))) {
[745] Fix | Delete
$info['comments']['language'][] = $atom_structure['language'];
[746] Fix | Delete
}
[747] Fix | Delete
break;
[748] Fix | Delete
[749] Fix | Delete
[750] Fix | Delete
case 'ptv ': // Print To Video - defines a movie's full screen mode
[751] Fix | Delete
// http://developer.apple.com/documentation/QuickTime/APIREF/SOURCESIV/at_ptv-_pg.htm
[752] Fix | Delete
$atom_structure['display_size_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 2));
[753] Fix | Delete
$atom_structure['reserved_1'] = getid3_lib::BigEndian2Int(substr($atom_data, 2, 2)); // hardcoded: 0x0000
[754] Fix | Delete
$atom_structure['reserved_2'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 2)); // hardcoded: 0x0000
[755] Fix | Delete
$atom_structure['slide_show_flag'] = getid3_lib::BigEndian2Int(substr($atom_data, 6, 1));
[756] Fix | Delete
$atom_structure['play_on_open_flag'] = getid3_lib::BigEndian2Int(substr($atom_data, 7, 1));
[757] Fix | Delete
[758] Fix | Delete
$atom_structure['flags']['play_on_open'] = (bool) $atom_structure['play_on_open_flag'];
[759] Fix | Delete
$atom_structure['flags']['slide_show'] = (bool) $atom_structure['slide_show_flag'];
[760] Fix | Delete
[761] Fix | Delete
$ptv_lookup = array(
[762] Fix | Delete
0 => 'normal',
[763] Fix | Delete
1 => 'double',
[764] Fix | Delete
2 => 'half',
[765] Fix | Delete
3 => 'full',
[766] Fix | Delete
4 => 'current'
[767] Fix | Delete
);
[768] Fix | Delete
if (isset($ptv_lookup[$atom_structure['display_size_raw']])) {
[769] Fix | Delete
$atom_structure['display_size'] = $ptv_lookup[$atom_structure['display_size_raw']];
[770] Fix | Delete
} else {
[771] Fix | Delete
$this->warning('unknown "ptv " display constant ('.$atom_structure['display_size_raw'].')');
[772] Fix | Delete
}
[773] Fix | Delete
break;
[774] Fix | Delete
[775] Fix | Delete
[776] Fix | Delete
case 'stsd': // Sample Table Sample Description atom
[777] Fix | Delete
$atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); // hardcoded: 0x00
[778] Fix | Delete
$atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x000000
[779] Fix | Delete
$atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data, 4, 4));
[780] Fix | Delete
[781] Fix | Delete
// see: https://github.com/JamesHeinrich/getID3/issues/111
[782] Fix | Delete
// Some corrupt files have been known to have high bits set in the number_entries field
[783] Fix | Delete
// This field shouldn't really need to be 32-bits, values stores are likely in the range 1-100000
[784] Fix | Delete
// Workaround: mask off the upper byte and throw a warning if it's nonzero
[785] Fix | Delete
if ($atom_structure['number_entries'] > 0x000FFFFF) {
[786] Fix | Delete
if ($atom_structure['number_entries'] > 0x00FFFFFF) {
[787] Fix | Delete
$this->warning('"stsd" atom contains improbably large number_entries (0x'.getid3_lib::PrintHexBytes(substr($atom_data, 4, 4), true, false).' = '.$atom_structure['number_entries'].'), probably in error. Ignoring upper byte and interpreting this as 0x'.getid3_lib::PrintHexBytes(substr($atom_data, 5, 3), true, false).' = '.($atom_structure['number_entries'] & 0x00FFFFFF));
[788] Fix | Delete
$atom_structure['number_entries'] = ($atom_structure['number_entries'] & 0x00FFFFFF);
[789] Fix | Delete
} else {
[790] Fix | Delete
$this->warning('"stsd" atom contains improbably large number_entries (0x'.getid3_lib::PrintHexBytes(substr($atom_data, 4, 4), true, false).' = '.$atom_structure['number_entries'].'), probably in error. Please report this to info@getid3.org referencing bug report #111');
[791] Fix | Delete
}
[792] Fix | Delete
}
[793] Fix | Delete
[794] Fix | Delete
$stsdEntriesDataOffset = 8;
[795] Fix | Delete
for ($i = 0; $i < $atom_structure['number_entries']; $i++) {
[796] Fix | Delete
$atom_structure['sample_description_table'][$i]['size'] = getid3_lib::BigEndian2Int(substr($atom_data, $stsdEntriesDataOffset, 4));
[797] Fix | Delete
$stsdEntriesDataOffset += 4;
[798] Fix | Delete
$atom_structure['sample_description_table'][$i]['data_format'] = substr($atom_data, $stsdEntriesDataOffset, 4);
[799] Fix | Delete
$stsdEntriesDataOffset += 4;
[800] Fix | Delete
$atom_structure['sample_description_table'][$i]['reserved'] = getid3_lib::BigEndian2Int(substr($atom_data, $stsdEntriesDataOffset, 6));
[801] Fix | Delete
$stsdEntriesDataOffset += 6;
[802] Fix | Delete
$atom_structure['sample_description_table'][$i]['reference_index'] = getid3_lib::BigEndian2Int(substr($atom_data, $stsdEntriesDataOffset, 2));
[803] Fix | Delete
$stsdEntriesDataOffset += 2;
[804] Fix | Delete
$atom_structure['sample_description_table'][$i]['data'] = substr($atom_data, $stsdEntriesDataOffset, ($atom_structure['sample_description_table'][$i]['size'] - 4 - 4 - 6 - 2));
[805] Fix | Delete
$stsdEntriesDataOffset += ($atom_structure['sample_description_table'][$i]['size'] - 4 - 4 - 6 - 2);
[806] Fix | Delete
if (substr($atom_structure['sample_description_table'][$i]['data'], 1, 54) == 'application/octet-stream;type=com.parrot.videometadata') {
[807] Fix | Delete
// special handling for apparently-malformed (TextMetaDataSampleEntry?) data for some version of Parrot drones
[808] Fix | Delete
$atom_structure['sample_description_table'][$i]['parrot_frame_metadata']['mime_type'] = substr($atom_structure['sample_description_table'][$i]['data'], 1, 55);
[809] Fix | Delete
$atom_structure['sample_description_table'][$i]['parrot_frame_metadata']['metadata_version'] = (int) substr($atom_structure['sample_description_table'][$i]['data'], 55, 1);
[810] Fix | Delete
unset($atom_structure['sample_description_table'][$i]['data']);
[811] Fix | Delete
$this->warning('incomplete/incorrect handling of "stsd" with Parrot metadata in this version of getID3() ['.$this->getid3->version().']');
[812] Fix | Delete
continue;
[813] Fix | Delete
}
[814] Fix | Delete
[815] Fix | Delete
$atom_structure['sample_description_table'][$i]['encoder_version'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 0, 2));
[816] Fix | Delete
$atom_structure['sample_description_table'][$i]['encoder_revision'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 2, 2));
[817] Fix | Delete
$atom_structure['sample_description_table'][$i]['encoder_vendor'] = substr($atom_structure['sample_description_table'][$i]['data'], 4, 4);
[818] Fix | Delete
[819] Fix | Delete
switch ($atom_structure['sample_description_table'][$i]['encoder_vendor']) {
[820] Fix | Delete
[821] Fix | Delete
case "\x00\x00\x00\x00":
[822] Fix | Delete
// audio tracks
[823] Fix | Delete
$atom_structure['sample_description_table'][$i]['audio_channels'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 8, 2));
[824] Fix | Delete
$atom_structure['sample_description_table'][$i]['audio_bit_depth'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 10, 2));
[825] Fix | Delete
$atom_structure['sample_description_table'][$i]['audio_compression_id'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 12, 2));
[826] Fix | Delete
$atom_structure['sample_description_table'][$i]['audio_packet_size'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 14, 2));
[827] Fix | Delete
$atom_structure['sample_description_table'][$i]['audio_sample_rate'] = getid3_lib::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 16, 4));
[828] Fix | Delete
[829] Fix | Delete
// video tracks
[830] Fix | Delete
// http://developer.apple.com/library/mac/#documentation/QuickTime/QTFF/QTFFChap3/qtff3.html
[831] Fix | Delete
$atom_structure['sample_description_table'][$i]['temporal_quality'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 8, 4));
[832] Fix | Delete
$atom_structure['sample_description_table'][$i]['spatial_quality'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 12, 4));
[833] Fix | Delete
$atom_structure['sample_description_table'][$i]['width'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 16, 2));
[834] Fix | Delete
$atom_structure['sample_description_table'][$i]['height'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 18, 2));
[835] Fix | Delete
$atom_structure['sample_description_table'][$i]['resolution_x'] = getid3_lib::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 24, 4));
[836] Fix | Delete
$atom_structure['sample_description_table'][$i]['resolution_y'] = getid3_lib::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 28, 4));
[837] Fix | Delete
$atom_structure['sample_description_table'][$i]['data_size'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 32, 4));
[838] Fix | Delete
$atom_structure['sample_description_table'][$i]['frame_count'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 36, 2));
[839] Fix | Delete
$atom_structure['sample_description_table'][$i]['compressor_name'] = substr($atom_structure['sample_description_table'][$i]['data'], 38, 4);
[840] Fix | Delete
$atom_structure['sample_description_table'][$i]['pixel_depth'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 42, 2));
[841] Fix | Delete
$atom_structure['sample_description_table'][$i]['color_table_id'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 44, 2));
[842] Fix | Delete
[843] Fix | Delete
switch ($atom_structure['sample_description_table'][$i]['data_format']) {
[844] Fix | Delete
case '2vuY':
[845] Fix | Delete
case 'avc1':
[846] Fix | Delete
case 'cvid':
[847] Fix | Delete
case 'dvc ':
[848] Fix | Delete
case 'dvcp':
[849] Fix | Delete
case 'gif ':
[850] Fix | Delete
case 'h263':
[851] Fix | Delete
case 'hvc1':
[852] Fix | Delete
case 'jpeg':
[853] Fix | Delete
case 'kpcd':
[854] Fix | Delete
case 'mjpa':
[855] Fix | Delete
case 'mjpb':
[856] Fix | Delete
case 'mp4v':
[857] Fix | Delete
case 'png ':
[858] Fix | Delete
case 'raw ':
[859] Fix | Delete
case 'rle ':
[860] Fix | Delete
case 'rpza':
[861] Fix | Delete
case 'smc ':
[862] Fix | Delete
case 'SVQ1':
[863] Fix | Delete
case 'SVQ3':
[864] Fix | Delete
case 'tiff':
[865] Fix | Delete
case 'v210':
[866] Fix | Delete
case 'v216':
[867] Fix | Delete
case 'v308':
[868] Fix | Delete
case 'v408':
[869] Fix | Delete
case 'v410':
[870] Fix | Delete
case 'yuv2':
[871] Fix | Delete
$info['fileformat'] = 'mp4';
[872] Fix | Delete
$info['video']['fourcc'] = $atom_structure['sample_description_table'][$i]['data_format'];
[873] Fix | Delete
if ($this->QuicktimeVideoCodecLookup($info['video']['fourcc'])) {
[874] Fix | Delete
$info['video']['fourcc_lookup'] = $this->QuicktimeVideoCodecLookup($info['video']['fourcc']);
[875] Fix | Delete
}
[876] Fix | Delete
[877] Fix | Delete
// https://www.getid3.org/phpBB3/viewtopic.php?t=1550
[878] Fix | Delete
//if ((!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($atom_structure['sample_description_table'][$i]['width'])) && (empty($info['video']['resolution_x']) || empty($info['video']['resolution_y']) || (number_format($info['video']['resolution_x'], 6) != number_format(round($info['video']['resolution_x']), 6)) || (number_format($info['video']['resolution_y'], 6) != number_format(round($info['video']['resolution_y']), 6)))) { // ugly check for floating point numbers
[879] Fix | Delete
if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($atom_structure['sample_description_table'][$i]['height'])) {
[880] Fix | Delete
// assume that values stored here are more important than values stored in [tkhd] atom
[881] Fix | Delete
$info['video']['resolution_x'] = $atom_structure['sample_description_table'][$i]['width'];
[882] Fix | Delete
$info['video']['resolution_y'] = $atom_structure['sample_description_table'][$i]['height'];
[883] Fix | Delete
$info['quicktime']['video']['resolution_x'] = $info['video']['resolution_x'];
[884] Fix | Delete
$info['quicktime']['video']['resolution_y'] = $info['video']['resolution_y'];
[885] Fix | Delete
}
[886] Fix | Delete
break;
[887] Fix | Delete
[888] Fix | Delete
case 'qtvr':
[889] Fix | Delete
$info['video']['dataformat'] = 'quicktimevr';
[890] Fix | Delete
break;
[891] Fix | Delete
[892] Fix | Delete
case 'mp4a':
[893] Fix | Delete
$atom_structure['sample_description_table'][$i]['subatoms'] = $this->QuicktimeParseContainerAtom(substr($atom_structure['sample_description_table'][$i]['data'], 20), $baseoffset + $stsdEntriesDataOffset - 20 - 16, $atomHierarchy, $ParseAllPossibleAtoms);
[894] Fix | Delete
[895] Fix | Delete
$info['quicktime']['audio']['codec'] = $this->QuicktimeAudioCodecLookup($atom_structure['sample_description_table'][$i]['data_format']);
[896] Fix | Delete
$info['quicktime']['audio']['sample_rate'] = $atom_structure['sample_description_table'][$i]['audio_sample_rate'];
[897] Fix | Delete
$info['quicktime']['audio']['channels'] = $atom_structure['sample_description_table'][$i]['audio_channels'];
[898] Fix | Delete
$info['quicktime']['audio']['bit_depth'] = $atom_structure['sample_description_table'][$i]['audio_bit_depth'];
[899] Fix | Delete
$info['audio']['codec'] = $info['quicktime']['audio']['codec'];
[900] Fix | Delete
$info['audio']['sample_rate'] = $info['quicktime']['audio']['sample_rate'];
[901] Fix | Delete
$info['audio']['channels'] = $info['quicktime']['audio']['channels'];
[902] Fix | Delete
$info['audio']['bits_per_sample'] = $info['quicktime']['audio']['bit_depth'];
[903] Fix | Delete
switch ($atom_structure['sample_description_table'][$i]['data_format']) {
[904] Fix | Delete
case 'raw ': // PCM
[905] Fix | Delete
case 'alac': // Apple Lossless Audio Codec
[906] Fix | Delete
case 'sowt': // signed/two's complement (Little Endian)
[907] Fix | Delete
case 'twos': // signed/two's complement (Big Endian)
[908] Fix | Delete
case 'in24': // 24-bit Integer
[909] Fix | Delete
case 'in32': // 32-bit Integer
[910] Fix | Delete
case 'fl32': // 32-bit Floating Point
[911] Fix | Delete
case 'fl64': // 64-bit Floating Point
[912] Fix | Delete
$info['audio']['lossless'] = $info['quicktime']['audio']['lossless'] = true;
[913] Fix | Delete
$info['audio']['bitrate'] = $info['quicktime']['audio']['bitrate'] = $info['audio']['channels'] * $info['audio']['bits_per_sample'] * $info['audio']['sample_rate'];
[914] Fix | Delete
break;
[915] Fix | Delete
default:
[916] Fix | Delete
$info['audio']['lossless'] = false;
[917] Fix | Delete
break;
[918] Fix | Delete
}
[919] Fix | Delete
break;
[920] Fix | Delete
[921] Fix | Delete
default:
[922] Fix | Delete
break;
[923] Fix | Delete
}
[924] Fix | Delete
break;
[925] Fix | Delete
[926] Fix | Delete
default:
[927] Fix | Delete
switch ($atom_structure['sample_description_table'][$i]['data_format']) {
[928] Fix | Delete
case 'mp4s':
[929] Fix | Delete
$info['fileformat'] = 'mp4';
[930] Fix | Delete
break;
[931] Fix | Delete
[932] Fix | Delete
default:
[933] Fix | Delete
// video atom
[934] Fix | Delete
$atom_structure['sample_description_table'][$i]['video_temporal_quality'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 8, 4));
[935] Fix | Delete
$atom_structure['sample_description_table'][$i]['video_spatial_quality'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 12, 4));
[936] Fix | Delete
$atom_structure['sample_description_table'][$i]['video_frame_width'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 16, 2));
[937] Fix | Delete
$atom_structure['sample_description_table'][$i]['video_frame_height'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 18, 2));
[938] Fix | Delete
$atom_structure['sample_description_table'][$i]['video_resolution_x'] = getid3_lib::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 20, 4));
[939] Fix | Delete
$atom_structure['sample_description_table'][$i]['video_resolution_y'] = getid3_lib::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 24, 4));
[940] Fix | Delete
$atom_structure['sample_description_table'][$i]['video_data_size'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 28, 4));
[941] Fix | Delete
$atom_structure['sample_description_table'][$i]['video_frame_count'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 32, 2));
[942] Fix | Delete
$atom_structure['sample_description_table'][$i]['video_encoder_name_len'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 34, 1));
[943] Fix | Delete
$atom_structure['sample_description_table'][$i]['video_encoder_name'] = substr($atom_structure['sample_description_table'][$i]['data'], 35, $atom_structure['sample_description_table'][$i]['video_encoder_name_len']);
[944] Fix | Delete
$atom_structure['sample_description_table'][$i]['video_pixel_color_depth'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 66, 2));
[945] Fix | Delete
$atom_structure['sample_description_table'][$i]['video_color_table_id'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 68, 2));
[946] Fix | Delete
[947] Fix | Delete
$atom_structure['sample_description_table'][$i]['video_pixel_color_type'] = (((int) $atom_structure['sample_description_table'][$i]['video_pixel_color_depth'] > 32) ? 'grayscale' : 'color');
[948] Fix | Delete
$atom_structure['sample_description_table'][$i]['video_pixel_color_name'] = $this->QuicktimeColorNameLookup($atom_structure['sample_description_table'][$i]['video_pixel_color_depth']);
[949] Fix | Delete
[950] Fix | Delete
if ($atom_structure['sample_description_table'][$i]['video_pixel_color_name'] != 'invalid') {
[951] Fix | Delete
$info['quicktime']['video']['codec_fourcc'] = $atom_structure['sample_description_table'][$i]['data_format'];
[952] Fix | Delete
$info['quicktime']['video']['codec_fourcc_lookup'] = $this->QuicktimeVideoCodecLookup($atom_structure['sample_description_table'][$i]['data_format']);
[953] Fix | Delete
$info['quicktime']['video']['codec'] = (((int) $atom_structure['sample_description_table'][$i]['video_encoder_name_len'] > 0) ? $atom_structure['sample_description_table'][$i]['video_encoder_name'] : $atom_structure['sample_description_table'][$i]['data_format']);
[954] Fix | Delete
$info['quicktime']['video']['color_depth'] = $atom_structure['sample_description_table'][$i]['video_pixel_color_depth'];
[955] Fix | Delete
$info['quicktime']['video']['color_depth_name'] = $atom_structure['sample_description_table'][$i]['video_pixel_color_name'];
[956] Fix | Delete
[957] Fix | Delete
$info['video']['codec'] = $info['quicktime']['video']['codec'];
[958] Fix | Delete
$info['video']['bits_per_sample'] = $info['quicktime']['video']['color_depth'];
[959] Fix | Delete
}
[960] Fix | Delete
$info['video']['lossless'] = false;
[961] Fix | Delete
$info['video']['pixel_aspect_ratio'] = (float) 1;
[962] Fix | Delete
break;
[963] Fix | Delete
}
[964] Fix | Delete
break;
[965] Fix | Delete
}
[966] Fix | Delete
switch (strtolower($atom_structure['sample_description_table'][$i]['data_format'])) {
[967] Fix | Delete
case 'mp4a':
[968] Fix | Delete
$info['audio']['dataformat'] = 'mp4';
[969] Fix | Delete
$info['quicktime']['audio']['codec'] = 'mp4';
[970] Fix | Delete
break;
[971] Fix | Delete
[972] Fix | Delete
case '3ivx':
[973] Fix | Delete
case '3iv1':
[974] Fix | Delete
case '3iv2':
[975] Fix | Delete
$info['video']['dataformat'] = '3ivx';
[976] Fix | Delete
break;
[977] Fix | Delete
[978] Fix | Delete
case 'xvid':
[979] Fix | Delete
$info['video']['dataformat'] = 'xvid';
[980] Fix | Delete
break;
[981] Fix | Delete
[982] Fix | Delete
case 'mp4v':
[983] Fix | Delete
$info['video']['dataformat'] = 'mpeg4';
[984] Fix | Delete
break;
[985] Fix | Delete
[986] Fix | Delete
case 'divx':
[987] Fix | Delete
case 'div1':
[988] Fix | Delete
case 'div2':
[989] Fix | Delete
case 'div3':
[990] Fix | Delete
case 'div4':
[991] Fix | Delete
case 'div5':
[992] Fix | Delete
case 'div6':
[993] Fix | Delete
$info['video']['dataformat'] = 'divx';
[994] Fix | Delete
break;
[995] Fix | Delete
[996] Fix | Delete
default:
[997] Fix | Delete
// do nothing
[998] Fix | Delete
break;
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function