52 $info = &$this->getid3->info;
54 $info[
'fileformat'] =
'quicktime';
55 $info[
'quicktime'][
'hinting'] =
false;
56 $info[
'quicktime'][
'controller'] =
'standard';
58 fseek($this->getid3->fp,
$info[
'avdataoffset'], SEEK_SET);
63 while ($offset <
$info[
'avdataend']) {
65 $info[
'error'][] =
'Unable to parse atom at offset '.$offset.
' because beyond '.round(PHP_INT_MAX / 1073741824).
'GB limit of PHP filesystem functions';
68 fseek($this->getid3->fp, $offset, SEEK_SET);
69 $AtomHeader =
fread($this->getid3->fp, 8);
72 $atomname = substr($AtomHeader, 4, 4);
79 $info[
'quicktime'][$atomname][
'name'] = $atomname;
80 $info[
'quicktime'][$atomname][
'size'] = $atomsize;
81 $info[
'quicktime'][$atomname][
'offset'] = $offset;
83 if (($offset + $atomsize) >
$info[
'avdataend']) {
84 $info[
'error'][] =
'Atom at offset '.$offset.
' claims to go beyond end-of-file (length: '.$atomsize.
' bytes)';
98 if (($atomsize > 8) && (!isset(
$info[
'avdataend_tmp']) || (
$info[
'quicktime'][$atomname][
'size'] > (
$info[
'avdataend_tmp'] -
$info[
'avdataoffset'])))) {
100 $info[
'avdataoffset'] =
$info[
'quicktime'][$atomname][
'offset'] + 8;
101 $OldAVDataEnd =
$info[
'avdataend'];
102 $info[
'avdataend'] =
$info[
'quicktime'][$atomname][
'offset'] +
$info[
'quicktime'][$atomname][
'size'];
105 $getid3_temp->openfile($this->getid3->filename);
106 $getid3_temp->info[
'avdataoffset'] = $info[
'avdataoffset'];
107 $getid3_temp->info[
'avdataend'] = $info[
'avdataend'];
109 if ($getid3_mp3->MPEGaudioHeaderValid($getid3_mp3->MPEGaudioHeaderDecode(
fread($this->getid3->fp, 4)))) {
110 $getid3_mp3->getOnlyMPEGaudioInfo($getid3_temp->info[
'avdataoffset'],
false);
111 if (!empty($getid3_temp->info[
'warning'])) {
112 foreach ($getid3_temp->info[
'warning'] as $value) {
113 $info[
'warning'][] = $value;
116 if (!empty($getid3_temp->info[
'mpeg'])) {
117 $info[
'mpeg'] = $getid3_temp->info[
'mpeg'];
118 if (isset($info[
'mpeg'][
'audio'])) {
119 $info[
'audio'][
'dataformat'] =
'mp3';
120 $info[
'audio'][
'codec'] = (!empty($info[
'mpeg'][
'audio'][
'encoder']) ? $info[
'mpeg'][
'audio'][
'encoder'] : (!empty($info[
'mpeg'][
'audio'][
'codec']) ? $info[
'mpeg'][
'audio'][
'codec'] : (!empty($info[
'mpeg'][
'audio'][
'LAME']) ?
'LAME' :
'mp3')));
121 $info[
'audio'][
'sample_rate'] = $info[
'mpeg'][
'audio'][
'sample_rate'];
122 $info[
'audio'][
'channels'] = $info[
'mpeg'][
'audio'][
'channels'];
123 $info[
'audio'][
'bitrate'] = $info[
'mpeg'][
'audio'][
'bitrate'];
124 $info[
'audio'][
'bitrate_mode'] = strtolower($info[
'mpeg'][
'audio'][
'bitrate_mode']);
125 $info[
'bitrate'] = $info[
'audio'][
'bitrate'];
129 unset($getid3_mp3, $getid3_temp);
130 $info[
'avdataend'] = $OldAVDataEnd;
131 unset($OldAVDataEnd);
143 $atomHierarchy =
array();
144 $info[
'quicktime'][$atomname] = $this->
QuicktimeParseAtom($atomname, $atomsize,
fread($this->getid3->fp, $atomsize), $offset, $atomHierarchy, $this->ParseAllPossibleAtoms);
148 $offset += $atomsize;
152 if (!empty(
$info[
'avdataend_tmp'])) {
156 unset(
$info[
'avdataend_tmp']);
159 if (!isset(
$info[
'bitrate']) && isset(
$info[
'playtime_seconds'])) {
160 $info[
'bitrate'] = ((
$info[
'avdataend'] -
$info[
'avdataoffset']) * 8) /
$info[
'playtime_seconds'];
162 if (isset(
$info[
'bitrate']) && !isset(
$info[
'audio'][
'bitrate']) && !isset(
$info[
'quicktime'][
'video'])) {
165 if (!empty(
$info[
'playtime_seconds']) && !isset(
$info[
'video'][
'frame_rate']) && !empty(
$info[
'quicktime'][
'stts_framecount'])) {
166 foreach (
$info[
'quicktime'][
'stts_framecount'] as $key => $samples_count) {
167 $samples_per_second = $samples_count /
$info[
'playtime_seconds'];
168 if ($samples_per_second > 240) {
171 $info[
'video'][
'frame_rate'] = $samples_per_second;
176 if ((
$info[
'audio'][
'dataformat'] ==
'mp4') && empty(
$info[
'video'][
'resolution_x'])) {
177 $info[
'fileformat'] =
'mp4';
178 $info[
'mime_type'] =
'audio/mp4';
179 unset(
$info[
'video'][
'dataformat']);
182 if (!$this->ReturnAtomData) {
183 unset(
$info[
'quicktime'][
'moov']);
186 if (empty(
$info[
'audio'][
'dataformat']) && !empty(
$info[
'quicktime'][
'audio'])) {
187 $info[
'audio'][
'dataformat'] =
'quicktime';
189 if (empty(
$info[
'video'][
'dataformat']) && !empty(
$info[
'quicktime'][
'video'])) {
190 $info[
'video'][
'dataformat'] =
'quicktime';
209 $info = &$this->getid3->info;
211 $atom_parent = array_pop($atomHierarchy);
212 array_push($atomHierarchy, $atomname);
213 $atom_structure[
'hierarchy'] = implode(
' ', $atomHierarchy);
214 $atom_structure[
'name'] = $atomname;
215 $atom_structure[
'size'] = $atomsize;
216 $atom_structure[
'offset'] = $baseoffset;
241 $allnumericnames =
true;
242 foreach ($atom_structure[
'subatoms'] as $subatomarray) {
243 if (!is_integer($subatomarray[
'name']) || (count($subatomarray[
'subatoms']) != 1)) {
244 $allnumericnames =
false;
248 if ($allnumericnames) {
250 foreach ($atom_structure[
'subatoms'] as $subatomarray) {
251 foreach ($subatomarray[
'subatoms'] as $newData_subatomarray) {
252 unset($newData_subatomarray[
'hierarchy'], $newData_subatomarray[
'name']);
253 $newData[$subatomarray[
'name']] = $newData_subatomarray;
257 $atom_structure[
'data'] = $newData;
258 unset($atom_structure[
'subatoms']);
262 case "\x00\x00\x00\x01":
263 case "\x00\x00\x00\x02":
264 case "\x00\x00\x00\x03":
265 case "\x00\x00\x00\x04":
266 case "\x00\x00\x00\x05":
268 $atom_structure[
'name'] = $atomname;
277 foreach ($atom_structure[
'subatoms'] as $key => $value_array) {
278 if (isset($value_array[
'sample_description_table'])) {
279 foreach ($value_array[
'sample_description_table'] as $key2 => $value_array2) {
280 if (isset($value_array2[
'data_format'])) {
281 switch ($value_array2[
'data_format']) {
293 } elseif (isset($value_array[
'time_to_sample_table'])) {
294 foreach ($value_array[
'time_to_sample_table'] as $key2 => $value_array2) {
295 if (isset($value_array2[
'sample_count']) && isset($value_array2[
'sample_duration']) && ($value_array2[
'sample_duration'] > 0)) {
296 $framerate = round(
$info[
'quicktime'][
'time_scale'] / $value_array2[
'sample_duration'], 3);
297 $framecount = $value_array2[
'sample_count'];
302 if ($isVideo && $framerate) {
303 $info[
'quicktime'][
'video'][
'frame_rate'] = $framerate;
304 $info[
'video'][
'frame_rate'] =
$info[
'quicktime'][
'video'][
'frame_rate'];
306 if ($isVideo && $framecount) {
307 $info[
'quicktime'][
'video'][
'frame_count'] = $framecount;
386 if ($atom_parent ==
'udta') {
390 $atom_structure[
'data'] = substr($atom_data, 4);
393 if (empty(
$info[
'comments'][
'language']) || (!in_array($atom_structure[
'language'],
$info[
'comments'][
'language']))) {
394 $info[
'comments'][
'language'][] = $atom_structure[
'language'];
399 if (substr($atom_data, 2, 2) ==
"\x10\xB5") {
402 while ($atomoffset < strlen($atom_data)) {
404 $boxsmalltype = substr($atom_data, $atomoffset + 2, 2);
405 $boxsmalldata = substr($atom_data, $atomoffset + 4, $boxsmallsize);
406 switch ($boxsmalltype) {
408 $atom_structure[
'data'] = $boxsmalldata;
411 $info[
'warning'][] =
'Unknown QuickTime smallbox type: "'.Helper::PrintHexBytes($boxsmalltype).
'" at offset '.$baseoffset;
412 $atom_structure[
'data'] = $atom_data;
415 $atomoffset += (4 + $boxsmallsize);
418 while ($atomoffset < strlen($atom_data)) {
420 $boxtype = substr($atom_data, $atomoffset + 4, 4);
421 $boxdata = substr($atom_data, $atomoffset + 8, $boxsize - 8);
423 $info[
'warning'][] =
'Invalid QuickTime atom box size "'.$boxsize.
'" in atom "'.$atomname.
'" at offset: '.($atom_structure[
'offset'] + $atomoffset);
424 $atom_structure[
'data'] = null;
425 $atomoffset = strlen($atom_data);
428 $atomoffset += $boxsize;
433 $atom_structure[$boxtype] = substr($boxdata, 4);
439 switch ($atom_structure[
'flags_raw']) {
457 $atom_structure[
'data'] = empty($num) ?
'' : $num;
458 $atom_structure[
'data'] .= empty($num_total) ?
'' :
'/'.$num_total;
483 $atom_structure[
'data'] = substr($boxdata, 8);
494 $atom_structure[
'data'] = substr($boxdata, 8);
501 $info[
'warning'][] =
'Unknown QuickTime box type: "'.Helper::PrintHexBytes($boxtype).
'" at offset '.$baseoffset;
502 $atom_structure[
'data'] = $atom_data;
514 $info[
'quicktime'][
'autoplay'] = $atom_structure[
'autoplay'];
532 $atom_structure[
'data'] = $atom_data;
540 $CompressedFileData = substr($atom_data, 4);
541 if ($UncompressedHeader = @gzuncompress($CompressedFileData)) {
544 $info[
'warning'][] =
'Error decompressing compressed MOV atom at offset '.$atom_structure[
'offset'];
549 $atom_structure[
'compression_id'] = $atom_data;
556 $atom_structure[
'flags'][
'internal_data'] = (bool) ($atom_structure[
'flags_raw'] & 0x000001);
558 $atom_structure[
'reference_type_name'] = substr($atom_data, 4, 4);
560 switch ($atom_structure[
'reference_type_name']) {
562 $atom_structure[
'url'] = $this->
NoNullString(substr($atom_data, 12));
566 $atom_structure[
'file_alias'] = substr($atom_data, 12);
570 $atom_structure[
'resource_alias'] = substr($atom_data, 12);
574 $atom_structure[
'data'] = substr($atom_data, 12);
592 $atom_structure[
'gestalt_selector'] = substr($atom_data, 4, 4);
601 $atom_structure[
'component_type'] = substr($atom_data, 4, 4);
602 $atom_structure[
'component_subtype'] = substr($atom_data, 8, 4);
603 $atom_structure[
'component_manufacturer'] = substr($atom_data, 12, 4);
614 $atom_structure[
'data_rate_bps'] = $atom_structure[
'data_rate'] * 10;
623 if (empty(
$info[
'comments'][
'language']) || (!in_array($atom_structure[
'language'],
$info[
'comments'][
'language']))) {
624 $info[
'comments'][
'language'][] = $atom_structure[
'language'];
642 $atom_structure[
'flags'][
'play_on_open'] = (bool) $atom_structure[
'play_on_open_flag'];
643 $atom_structure[
'flags'][
'slide_show'] = (bool) $atom_structure[
'slide_show_flag'];
645 $ptv_lookup[0] =
'normal';
646 $ptv_lookup[1] =
'double';
647 $ptv_lookup[2] =
'half';
648 $ptv_lookup[3] =
'full';
649 $ptv_lookup[4] =
'current';
650 if (isset($ptv_lookup[$atom_structure[
'display_size_raw']])) {
651 $atom_structure[
'display_size'] = $ptv_lookup[$atom_structure[
'display_size_raw']];
653 $info[
'warning'][] =
'unknown "ptv " display constant ('.$atom_structure[
'display_size_raw'].
')';
662 $stsdEntriesDataOffset = 8;
663 for ($i = 0; $i < $atom_structure[
'number_entries']; $i++) {
664 $atom_structure[
'sample_description_table'][$i][
'size'] =
Helper::BigEndian2Int(substr($atom_data, $stsdEntriesDataOffset, 4));
665 $stsdEntriesDataOffset += 4;
666 $atom_structure[
'sample_description_table'][$i][
'data_format'] = substr($atom_data, $stsdEntriesDataOffset, 4);
667 $stsdEntriesDataOffset += 4;
668 $atom_structure[
'sample_description_table'][$i][
'reserved'] =
Helper::BigEndian2Int(substr($atom_data, $stsdEntriesDataOffset, 6));
669 $stsdEntriesDataOffset += 6;
670 $atom_structure[
'sample_description_table'][$i][
'reference_index'] =
Helper::BigEndian2Int(substr($atom_data, $stsdEntriesDataOffset, 2));
671 $stsdEntriesDataOffset += 2;
672 $atom_structure[
'sample_description_table'][$i][
'data'] = substr($atom_data, $stsdEntriesDataOffset, ($atom_structure[
'sample_description_table'][$i][
'size'] - 4 - 4 - 6 - 2));
673 $stsdEntriesDataOffset += ($atom_structure[
'sample_description_table'][$i][
'size'] - 4 - 4 - 6 - 2);
675 $atom_structure[
'sample_description_table'][$i][
'encoder_version'] =
Helper::BigEndian2Int(substr($atom_structure[
'sample_description_table'][$i][
'data'], 0, 2));
676 $atom_structure[
'sample_description_table'][$i][
'encoder_revision'] =
Helper::BigEndian2Int(substr($atom_structure[
'sample_description_table'][$i][
'data'], 2, 2));
677 $atom_structure[
'sample_description_table'][$i][
'encoder_vendor'] = substr($atom_structure[
'sample_description_table'][$i][
'data'], 4, 4);
679 switch ($atom_structure[
'sample_description_table'][$i][
'encoder_vendor']) {
681 case "\x00\x00\x00\x00":
683 $atom_structure[
'sample_description_table'][$i][
'audio_channels'] =
Helper::BigEndian2Int(substr($atom_structure[
'sample_description_table'][$i][
'data'], 8, 2));
684 $atom_structure[
'sample_description_table'][$i][
'audio_bit_depth'] =
Helper::BigEndian2Int(substr($atom_structure[
'sample_description_table'][$i][
'data'], 10, 2));
685 $atom_structure[
'sample_description_table'][$i][
'audio_compression_id'] =
Helper::BigEndian2Int(substr($atom_structure[
'sample_description_table'][$i][
'data'], 12, 2));
686 $atom_structure[
'sample_description_table'][$i][
'audio_packet_size'] =
Helper::BigEndian2Int(substr($atom_structure[
'sample_description_table'][$i][
'data'], 14, 2));
687 $atom_structure[
'sample_description_table'][$i][
'audio_sample_rate'] =
Helper::FixedPoint16_16(substr($atom_structure[
'sample_description_table'][$i][
'data'], 16, 4));
689 switch ($atom_structure[
'sample_description_table'][$i][
'data_format']) {
692 $info[
'fileformat'] =
'mp4';
693 $info[
'video'][
'fourcc'] = $atom_structure[
'sample_description_table'][$i][
'data_format'];
698 $info[
'video'][
'dataformat'] =
'quicktimevr';
704 $info[
'quicktime'][
'audio'][
'sample_rate'] = $atom_structure[
'sample_description_table'][$i][
'audio_sample_rate'];
705 $info[
'quicktime'][
'audio'][
'channels'] = $atom_structure[
'sample_description_table'][$i][
'audio_channels'];
706 $info[
'quicktime'][
'audio'][
'bit_depth'] = $atom_structure[
'sample_description_table'][$i][
'audio_bit_depth'];
707 $info[
'audio'][
'codec'] =
$info[
'quicktime'][
'audio'][
'codec'];
708 $info[
'audio'][
'sample_rate'] =
$info[
'quicktime'][
'audio'][
'sample_rate'];
709 $info[
'audio'][
'channels'] =
$info[
'quicktime'][
'audio'][
'channels'];
710 $info[
'audio'][
'bits_per_sample'] =
$info[
'quicktime'][
'audio'][
'bit_depth'];
711 switch ($atom_structure[
'sample_description_table'][$i][
'data_format']) {
714 $info[
'audio'][
'lossless'] =
true;
717 $info[
'audio'][
'lossless'] =
false;
725 switch ($atom_structure[
'sample_description_table'][$i][
'data_format']) {
727 $info[
'fileformat'] =
'mp4';
732 $atom_structure[
'sample_description_table'][$i][
'video_temporal_quality'] =
Helper::BigEndian2Int(substr($atom_structure[
'sample_description_table'][$i][
'data'], 8, 4));
733 $atom_structure[
'sample_description_table'][$i][
'video_spatial_quality'] =
Helper::BigEndian2Int(substr($atom_structure[
'sample_description_table'][$i][
'data'], 12, 4));
734 $atom_structure[
'sample_description_table'][$i][
'video_frame_width'] =
Helper::BigEndian2Int(substr($atom_structure[
'sample_description_table'][$i][
'data'], 16, 2));
735 $atom_structure[
'sample_description_table'][$i][
'video_frame_height'] =
Helper::BigEndian2Int(substr($atom_structure[
'sample_description_table'][$i][
'data'], 18, 2));
736 $atom_structure[
'sample_description_table'][$i][
'video_resolution_x'] =
Helper::FixedPoint16_16(substr($atom_structure[
'sample_description_table'][$i][
'data'], 20, 4));
737 $atom_structure[
'sample_description_table'][$i][
'video_resolution_y'] =
Helper::FixedPoint16_16(substr($atom_structure[
'sample_description_table'][$i][
'data'], 24, 4));
738 $atom_structure[
'sample_description_table'][$i][
'video_data_size'] =
Helper::BigEndian2Int(substr($atom_structure[
'sample_description_table'][$i][
'data'], 28, 4));
739 $atom_structure[
'sample_description_table'][$i][
'video_frame_count'] =
Helper::BigEndian2Int(substr($atom_structure[
'sample_description_table'][$i][
'data'], 32, 2));
740 $atom_structure[
'sample_description_table'][$i][
'video_encoder_name_len'] =
Helper::BigEndian2Int(substr($atom_structure[
'sample_description_table'][$i][
'data'], 34, 1));
741 $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']);
742 $atom_structure[
'sample_description_table'][$i][
'video_pixel_color_depth'] =
Helper::BigEndian2Int(substr($atom_structure[
'sample_description_table'][$i][
'data'], 66, 2));
743 $atom_structure[
'sample_description_table'][$i][
'video_color_table_id'] =
Helper::BigEndian2Int(substr($atom_structure[
'sample_description_table'][$i][
'data'], 68, 2));
745 $atom_structure[
'sample_description_table'][$i][
'video_pixel_color_type'] = (($atom_structure[
'sample_description_table'][$i][
'video_pixel_color_depth'] > 32) ?
'grayscale' :
'color');
746 $atom_structure[
'sample_description_table'][$i][
'video_pixel_color_name'] = $this->
QuicktimeColorNameLookup($atom_structure[
'sample_description_table'][$i][
'video_pixel_color_depth']);
748 if ($atom_structure[
'sample_description_table'][$i][
'video_pixel_color_name'] !=
'invalid') {
749 $info[
'quicktime'][
'video'][
'codec_fourcc'] = $atom_structure[
'sample_description_table'][$i][
'data_format'];
750 $info[
'quicktime'][
'video'][
'codec_fourcc_lookup'] = $this->
QuicktimeVideoCodecLookup($atom_structure[
'sample_description_table'][$i][
'data_format']);
751 $info[
'quicktime'][
'video'][
'codec'] = (($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']);
752 $info[
'quicktime'][
'video'][
'color_depth'] = $atom_structure[
'sample_description_table'][$i][
'video_pixel_color_depth'];
753 $info[
'quicktime'][
'video'][
'color_depth_name'] = $atom_structure[
'sample_description_table'][$i][
'video_pixel_color_name'];
755 $info[
'video'][
'codec'] =
$info[
'quicktime'][
'video'][
'codec'];
756 $info[
'video'][
'bits_per_sample'] =
$info[
'quicktime'][
'video'][
'color_depth'];
758 $info[
'video'][
'lossless'] =
false;
759 $info[
'video'][
'pixel_aspect_ratio'] = (float) 1;
764 switch (strtolower($atom_structure[
'sample_description_table'][$i][
'data_format'])) {
766 $info[
'audio'][
'dataformat'] =
'mp4';
767 $info[
'quicktime'][
'audio'][
'codec'] =
'mp4';
773 $info[
'video'][
'dataformat'] =
'3ivx';
777 $info[
'video'][
'dataformat'] =
'xvid';
781 $info[
'video'][
'dataformat'] =
'mpeg4';
791 $info[
'video'][
'dataformat'] =
'divx';
798 unset($atom_structure[
'sample_description_table'][$i][
'data']);
806 $sttsEntriesDataOffset = 8;
809 for ($i = 0; $i < $atom_structure[
'number_entries']; $i++) {
810 $atom_structure[
'time_to_sample_table'][$i][
'sample_count'] =
Helper::BigEndian2Int(substr($atom_data, $sttsEntriesDataOffset, 4));
811 $sttsEntriesDataOffset += 4;
812 $atom_structure[
'time_to_sample_table'][$i][
'sample_duration'] =
Helper::BigEndian2Int(substr($atom_data, $sttsEntriesDataOffset, 4));
813 $sttsEntriesDataOffset += 4;
815 $frames_count += $atom_structure[
'time_to_sample_table'][$i][
'sample_count'];
828 $info[
'quicktime'][
'stts_framecount'][] = $frames_count;
853 $stssEntriesDataOffset = 8;
854 for ($i = 0; $i < $atom_structure[
'number_entries']; $i++) {
855 $atom_structure[
'time_to_sample_table'][$i] =
Helper::BigEndian2Int(substr($atom_data, $stssEntriesDataOffset, 4));
856 $stssEntriesDataOffset += 4;
866 $stscEntriesDataOffset = 8;
867 for ($i = 0; $i < $atom_structure[
'number_entries']; $i++) {
868 $atom_structure[
'sample_to_chunk_table'][$i][
'first_chunk'] =
Helper::BigEndian2Int(substr($atom_data, $stscEntriesDataOffset, 4));
869 $stscEntriesDataOffset += 4;
870 $atom_structure[
'sample_to_chunk_table'][$i][
'samples_per_chunk'] =
Helper::BigEndian2Int(substr($atom_data, $stscEntriesDataOffset, 4));
871 $stscEntriesDataOffset += 4;
872 $atom_structure[
'sample_to_chunk_table'][$i][
'sample_description'] =
Helper::BigEndian2Int(substr($atom_data, $stscEntriesDataOffset, 4));
873 $stscEntriesDataOffset += 4;
884 $stszEntriesDataOffset = 12;
885 if ($atom_structure[
'sample_size'] == 0) {
886 for ($i = 0; $i < $atom_structure[
'number_entries']; $i++) {
887 $atom_structure[
'sample_size_table'][$i] =
Helper::BigEndian2Int(substr($atom_data, $stszEntriesDataOffset, 4));
888 $stszEntriesDataOffset += 4;
899 $stcoEntriesDataOffset = 8;
900 for ($i = 0; $i < $atom_structure[
'number_entries']; $i++) {
901 $atom_structure[
'chunk_offset_table'][$i] =
Helper::BigEndian2Int(substr($atom_data, $stcoEntriesDataOffset, 4));
902 $stcoEntriesDataOffset += 4;
912 $stcoEntriesDataOffset = 8;
913 for ($i = 0; $i < $atom_structure[
'number_entries']; $i++) {
914 $atom_structure[
'chunk_offset_table'][$i] =
Helper::BigEndian2Int(substr($atom_data, $stcoEntriesDataOffset, 8));
915 $stcoEntriesDataOffset += 8;
925 for ($i = 0; $i < $atom_structure[
'number_entries']; $i++) {
926 $atom_structure[
'data_references'][$i][
'size'] =
Helper::BigEndian2Int(substr($atom_data, $drefDataOffset, 4));
927 $drefDataOffset += 4;
928 $atom_structure[
'data_references'][$i][
'type'] = substr($atom_data, $drefDataOffset, 4);
929 $drefDataOffset += 4;
930 $atom_structure[
'data_references'][$i][
'version'] =
Helper::BigEndian2Int(substr($atom_data, $drefDataOffset, 1));
931 $drefDataOffset += 1;
932 $atom_structure[
'data_references'][$i][
'flags_raw'] =
Helper::BigEndian2Int(substr($atom_data, $drefDataOffset, 3));
933 $drefDataOffset += 3;
934 $atom_structure[
'data_references'][$i][
'data'] = substr($atom_data, $drefDataOffset, ($atom_structure[
'data_references'][$i][
'size'] - 4 - 4 - 1 - 3));
935 $drefDataOffset += ($atom_structure[
'data_references'][$i][
'size'] - 4 - 4 - 1 - 3);
937 $atom_structure[
'data_references'][$i][
'flags'][
'self_reference'] = (bool) ($atom_structure[
'data_references'][$i][
'flags_raw'] & 0x001);
967 $atom_structure[
'flags'][
'no_lean_ahead'] = (bool) ($atom_structure[
'flags_raw'] & 0x001);
973 $atom_structure[
'component_type'] = substr($atom_data, 4, 4);
974 $atom_structure[
'component_subtype'] = substr($atom_data, 8, 4);
975 $atom_structure[
'component_manufacturer'] = substr($atom_data, 12, 4);
978 $atom_structure[
'component_name'] = $this->
Pascal2String(substr($atom_data, 24));
980 if (($atom_structure[
'component_subtype'] ==
'STpn') && ($atom_structure[
'component_manufacturer'] ==
'zzzz')) {
981 $info[
'video'][
'dataformat'] =
'quicktimevr';
995 if ($atom_structure[
'time_scale'] == 0) {
996 $info[
'error'][] =
'Corrupt Quicktime file: mdhd.time_scale == zero';
1000 $info[
'quicktime'][
'time_scale'] = (isset(
$info[
'quicktime'][
'time_scale']) ? max(
$info[
'quicktime'][
'time_scale'], $atom_structure[
'time_scale']) : $atom_structure[
'time_scale']);
1002 $atom_structure[
'creation_time_unix'] =
Helper::DateMac2Unix($atom_structure[
'creation_time']);
1004 $atom_structure[
'playtime_seconds'] = $atom_structure[
'duration'] / $atom_structure[
'time_scale'];
1006 if (empty(
$info[
'comments'][
'language']) || (!in_array($atom_structure[
'language'],
$info[
'comments'][
'language']))) {
1007 $info[
'comments'][
'language'][] = $atom_structure[
'language'];
1014 $atom_structure[
'atom_type'] = substr($atom_data, 6, 4);
1017 $atom_structure[
'modification_date_unix'] =
Helper::DateMac2Unix($atom_structure[
'modification_date']);
1023 $atom_structure[
'clipping_data'] = substr($atom_data, 10);
1032 $atom_structure[
'default_hints'][
'double_buffer'] = (bool) ($atom_structure[
'default_hints_raw'] & 0x0020);
1033 $atom_structure[
'default_hints'][
'high_quality'] = (bool) ($atom_structure[
'default_hints_raw'] & 0x0100);
1041 for ($i = 0; $i < (strlen($atom_data) % 4); $i++) {
1050 for ($i = 0; $i < $atom_structure[
'number_entries']; $i++) {
1051 $atom_structure[
'edit_list'][$i][
'track_duration'] =
Helper::BigEndian2Int(substr($atom_data, 8 + ($i * 12) + 0, 4));
1052 $atom_structure[
'edit_list'][$i][
'media_time'] =
Helper::BigEndian2Int(substr($atom_data, 8 + ($i * 12) + 4, 4));
1053 $atom_structure[
'edit_list'][$i][
'media_rate'] =
Helper::FixedPoint16_16(substr($atom_data, 8 + ($i * 12) + 8, 4));
1060 $atom_structure[
'matte_data_raw'] = substr($atom_data, 4);
1067 for ($colortableentry = 0; $colortableentry < $atom_structure[
'color_table_size']; $colortableentry++) {
1068 $atom_structure[
'color_table'][$colortableentry][
'alpha'] =
Helper::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 0, 2));
1069 $atom_structure[
'color_table'][$colortableentry][
'red'] =
Helper::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 2, 2));
1070 $atom_structure[
'color_table'][$colortableentry][
'green'] =
Helper::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 4, 2));
1071 $atom_structure[
'color_table'][$colortableentry][
'blue'] =
Helper::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 6, 2));
1084 $atom_structure[
'reserved'] = substr($atom_data, 26, 10);
1102 if ($atom_structure[
'time_scale'] == 0) {
1103 $info[
'error'][] =
'Corrupt Quicktime file: mvhd.time_scale == zero';
1107 $atom_structure[
'creation_time_unix'] =
Helper::DateMac2Unix($atom_structure[
'creation_time']);
1109 $info[
'quicktime'][
'time_scale'] = (isset(
$info[
'quicktime'][
'time_scale']) ? max(
$info[
'quicktime'][
'time_scale'], $atom_structure[
'time_scale']) : $atom_structure[
'time_scale']);
1110 $info[
'quicktime'][
'display_scale'] = $atom_structure[
'matrix_a'];
1111 $info[
'playtime_seconds'] = $atom_structure[
'duration'] / $atom_structure[
'time_scale'];
1139 $atom_structure[
'flags'][
'enabled'] = (bool) ($atom_structure[
'flags_raw'] & 0x0001);
1140 $atom_structure[
'flags'][
'in_movie'] = (bool) ($atom_structure[
'flags_raw'] & 0x0002);
1141 $atom_structure[
'flags'][
'in_preview'] = (bool) ($atom_structure[
'flags_raw'] & 0x0004);
1142 $atom_structure[
'flags'][
'in_poster'] = (bool) ($atom_structure[
'flags_raw'] & 0x0008);
1143 $atom_structure[
'creation_time_unix'] =
Helper::DateMac2Unix($atom_structure[
'creation_time']);
1146 if ($atom_structure[
'flags'][
'enabled'] == 1) {
1147 if (!isset(
$info[
'video'][
'resolution_x']) || !isset(
$info[
'video'][
'resolution_y'])) {
1148 $info[
'video'][
'resolution_x'] = $atom_structure[
'width'];
1149 $info[
'video'][
'resolution_y'] = $atom_structure[
'height'];
1151 $info[
'video'][
'resolution_x'] = max(
$info[
'video'][
'resolution_x'], $atom_structure[
'width']);
1152 $info[
'video'][
'resolution_y'] = max(
$info[
'video'][
'resolution_y'], $atom_structure[
'height']);
1153 $info[
'quicktime'][
'video'][
'resolution_x'] =
$info[
'video'][
'resolution_x'];
1154 $info[
'quicktime'][
'video'][
'resolution_y'] =
$info[
'video'][
'resolution_y'];
1156 if (isset(
$info[
'video'][
'resolution_x'])) { unset(
$info[
'video'][
'resolution_x']); }
1157 if (isset(
$info[
'video'][
'resolution_y'])) { unset(
$info[
'video'][
'resolution_y']); }
1158 if (isset(
$info[
'quicktime'][
'video'])) { unset(
$info[
'quicktime'][
'video']); }
1187 $atom_structure[
'num_iods_tracks'] = ($atom_structure[
'length'] - 7) / 6;
1188 for ($i = 0; $i < $atom_structure[
'num_iods_tracks']; $i++) {
1189 $atom_structure[
'track'][$i][
'ES_ID_IncTag'] =
Helper::BigEndian2Int(substr($atom_data, $offset, 1));
1202 $atom_structure[
'signature'] = substr($atom_data, 0, 4);
1204 $atom_structure[
'fourcc'] = substr($atom_data, 8, 4);
1234 $atom_structure[
'ctyp'] = substr($atom_data, 0, 4);
1235 $info[
'quicktime'][
'controller'] = $atom_structure[
'ctyp'];
1236 switch ($atom_structure[
'ctyp']) {
1238 $info[
'video'][
'dataformat'] =
'quicktimevr';
1251 $info[
'quicktime'][
'hinting'] =
true;
1255 for ($i = 0; $i < ($atom_structure[
'size'] - 8); $i += 4) {
1278 $atom_structure[
'data'] = $atom_data;
1279 if (preg_match(
'#([\\+\\-][0-9\\.]+)([\\+\\-][0-9\\.]+)([\\+\\-][0-9\\.]+)?/$#i', $atom_data, $matches)) {
1280 @list($all, $latitude, $longitude, $altitude) = $matches;
1281 $info[
'quicktime'][
'comments'][
'gps_latitude'][] = floatval($latitude);
1282 $info[
'quicktime'][
'comments'][
'gps_longitude'][] = floatval($longitude);
1283 if (!empty($altitude)) {
1284 $info[
'quicktime'][
'comments'][
'gps_altitude'][] = floatval($altitude);
1287 $info[
'warning'][] =
'QuickTime atom "©xyz" data does not match expected data pattern at offset '.$baseoffset.
'. Please report as GetId3Core() bug.';
1299 if (preg_match(
'/^\xFF\xD8\xFF/', $atom_data)) {
1300 $atom_structure[
'data'] = $atom_data;
1301 $atom_structure[
'image_mime'] =
'image/jpeg';
1302 $atom_structure[
'description'] = (($atomname ==
'NCTH') ?
'Nikon Camera Thumbnail Image' : (($atomname ==
'NCVW') ?
'Nikon Camera Preview Image' :
'Nikon preview image'));
1303 $info[
'quicktime'][
'comments'][
'picture'][] =
array(
'image_mime'=>$atom_structure[
'image_mime'],
'data'=>$atom_data,
'description'=>$atom_structure[
'description']);
1308 $atom_structure[
'data'] = $atom_data;
1316 $atom_structure[
'data'] = $atom_data;
1319 case "\x00\x00\x00\x00":
1333 $atom_structure[
'language'] = substr($atom_data, 4 + 0, 2);
1335 $atom_structure[
'data'] = substr($atom_data, 4 + 4);
1339 $info[
'warning'][] =
'Unknown QuickTime atom type: "'.$atomname.
'" ('.trim(
Helper::PrintHexBytes($atomname)).
') at offset '.$baseoffset;
1340 $atom_structure[
'data'] = $atom_data;
1343 array_pop($atomHierarchy);
1345 return $atom_structure;
1359 $atom_structure =
false;
1361 $subatomcounter = 0;
1365 while ($subatomoffset < strlen($atom_data)) {
1367 $subatomname = substr($atom_data, $subatomoffset + 4, 4);
1368 $subatomdata = substr($atom_data, $subatomoffset + 8, $subatomsize - 8);
1369 if ($subatomsize == 0) {
1373 return $atom_structure;
1378 $subatomoffset += $subatomsize;
1382 return $atom_structure;
1397 $b = ord(substr(
$data, $offset++, 1));
1398 $length = ($length << 7) | ($b & 0x7F);
1399 }
while (($b & 0x80) && ($num_bytes++ < 4));
1412 static $QuicktimeLanguageLookup =
array();
1413 if (empty($QuicktimeLanguageLookup)) {
1414 $QuicktimeLanguageLookup[0] =
'English';
1415 $QuicktimeLanguageLookup[1] =
'French';
1416 $QuicktimeLanguageLookup[2] =
'German';
1417 $QuicktimeLanguageLookup[3] =
'Italian';
1418 $QuicktimeLanguageLookup[4] =
'Dutch';
1419 $QuicktimeLanguageLookup[5] =
'Swedish';
1420 $QuicktimeLanguageLookup[6] =
'Spanish';
1421 $QuicktimeLanguageLookup[7] =
'Danish';
1422 $QuicktimeLanguageLookup[8] =
'Portuguese';
1423 $QuicktimeLanguageLookup[9] =
'Norwegian';
1424 $QuicktimeLanguageLookup[10] =
'Hebrew';
1425 $QuicktimeLanguageLookup[11] =
'Japanese';
1426 $QuicktimeLanguageLookup[12] =
'Arabic';
1427 $QuicktimeLanguageLookup[13] =
'Finnish';
1428 $QuicktimeLanguageLookup[14] =
'Greek';
1429 $QuicktimeLanguageLookup[15] =
'Icelandic';
1430 $QuicktimeLanguageLookup[16] =
'Maltese';
1431 $QuicktimeLanguageLookup[17] =
'Turkish';
1432 $QuicktimeLanguageLookup[18] =
'Croatian';
1433 $QuicktimeLanguageLookup[19] =
'Chinese (Traditional)';
1434 $QuicktimeLanguageLookup[20] =
'Urdu';
1435 $QuicktimeLanguageLookup[21] =
'Hindi';
1436 $QuicktimeLanguageLookup[22] =
'Thai';
1437 $QuicktimeLanguageLookup[23] =
'Korean';
1438 $QuicktimeLanguageLookup[24] =
'Lithuanian';
1439 $QuicktimeLanguageLookup[25] =
'Polish';
1440 $QuicktimeLanguageLookup[26] =
'Hungarian';
1441 $QuicktimeLanguageLookup[27] =
'Estonian';
1442 $QuicktimeLanguageLookup[28] =
'Lettish';
1443 $QuicktimeLanguageLookup[28] =
'Latvian';
1444 $QuicktimeLanguageLookup[29] =
'Saamisk';
1445 $QuicktimeLanguageLookup[29] =
'Lappish';
1446 $QuicktimeLanguageLookup[30] =
'Faeroese';
1447 $QuicktimeLanguageLookup[31] =
'Farsi';
1448 $QuicktimeLanguageLookup[31] =
'Persian';
1449 $QuicktimeLanguageLookup[32] =
'Russian';
1450 $QuicktimeLanguageLookup[33] =
'Chinese (Simplified)';
1451 $QuicktimeLanguageLookup[34] =
'Flemish';
1452 $QuicktimeLanguageLookup[35] =
'Irish';
1453 $QuicktimeLanguageLookup[36] =
'Albanian';
1454 $QuicktimeLanguageLookup[37] =
'Romanian';
1455 $QuicktimeLanguageLookup[38] =
'Czech';
1456 $QuicktimeLanguageLookup[39] =
'Slovak';
1457 $QuicktimeLanguageLookup[40] =
'Slovenian';
1458 $QuicktimeLanguageLookup[41] =
'Yiddish';
1459 $QuicktimeLanguageLookup[42] =
'Serbian';
1460 $QuicktimeLanguageLookup[43] =
'Macedonian';
1461 $QuicktimeLanguageLookup[44] =
'Bulgarian';
1462 $QuicktimeLanguageLookup[45] =
'Ukrainian';
1463 $QuicktimeLanguageLookup[46] =
'Byelorussian';
1464 $QuicktimeLanguageLookup[47] =
'Uzbek';
1465 $QuicktimeLanguageLookup[48] =
'Kazakh';
1466 $QuicktimeLanguageLookup[49] =
'Azerbaijani';
1467 $QuicktimeLanguageLookup[50] =
'AzerbaijanAr';
1468 $QuicktimeLanguageLookup[51] =
'Armenian';
1469 $QuicktimeLanguageLookup[52] =
'Georgian';
1470 $QuicktimeLanguageLookup[53] =
'Moldavian';
1471 $QuicktimeLanguageLookup[54] =
'Kirghiz';
1472 $QuicktimeLanguageLookup[55] =
'Tajiki';
1473 $QuicktimeLanguageLookup[56] =
'Turkmen';
1474 $QuicktimeLanguageLookup[57] =
'Mongolian';
1475 $QuicktimeLanguageLookup[58] =
'MongolianCyr';
1476 $QuicktimeLanguageLookup[59] =
'Pashto';
1477 $QuicktimeLanguageLookup[60] =
'Kurdish';
1478 $QuicktimeLanguageLookup[61] =
'Kashmiri';
1479 $QuicktimeLanguageLookup[62] =
'Sindhi';
1480 $QuicktimeLanguageLookup[63] =
'Tibetan';
1481 $QuicktimeLanguageLookup[64] =
'Nepali';
1482 $QuicktimeLanguageLookup[65] =
'Sanskrit';
1483 $QuicktimeLanguageLookup[66] =
'Marathi';
1484 $QuicktimeLanguageLookup[67] =
'Bengali';
1485 $QuicktimeLanguageLookup[68] =
'Assamese';
1486 $QuicktimeLanguageLookup[69] =
'Gujarati';
1487 $QuicktimeLanguageLookup[70] =
'Punjabi';
1488 $QuicktimeLanguageLookup[71] =
'Oriya';
1489 $QuicktimeLanguageLookup[72] =
'Malayalam';
1490 $QuicktimeLanguageLookup[73] =
'Kannada';
1491 $QuicktimeLanguageLookup[74] =
'Tamil';
1492 $QuicktimeLanguageLookup[75] =
'Telugu';
1493 $QuicktimeLanguageLookup[76] =
'Sinhalese';
1494 $QuicktimeLanguageLookup[77] =
'Burmese';
1495 $QuicktimeLanguageLookup[78] =
'Khmer';
1496 $QuicktimeLanguageLookup[79] =
'Lao';
1497 $QuicktimeLanguageLookup[80] =
'Vietnamese';
1498 $QuicktimeLanguageLookup[81] =
'Indonesian';
1499 $QuicktimeLanguageLookup[82] =
'Tagalog';
1500 $QuicktimeLanguageLookup[83] =
'MalayRoman';
1501 $QuicktimeLanguageLookup[84] =
'MalayArabic';
1502 $QuicktimeLanguageLookup[85] =
'Amharic';
1503 $QuicktimeLanguageLookup[86] =
'Tigrinya';
1504 $QuicktimeLanguageLookup[87] =
'Galla';
1505 $QuicktimeLanguageLookup[87] =
'Oromo';
1506 $QuicktimeLanguageLookup[88] =
'Somali';
1507 $QuicktimeLanguageLookup[89] =
'Swahili';
1508 $QuicktimeLanguageLookup[90] =
'Ruanda';
1509 $QuicktimeLanguageLookup[91] =
'Rundi';
1510 $QuicktimeLanguageLookup[92] =
'Chewa';
1511 $QuicktimeLanguageLookup[93] =
'Malagasy';
1512 $QuicktimeLanguageLookup[94] =
'Esperanto';
1513 $QuicktimeLanguageLookup[128] =
'Welsh';
1514 $QuicktimeLanguageLookup[129] =
'Basque';
1515 $QuicktimeLanguageLookup[130] =
'Catalan';
1516 $QuicktimeLanguageLookup[131] =
'Latin';
1517 $QuicktimeLanguageLookup[132] =
'Quechua';
1518 $QuicktimeLanguageLookup[133] =
'Guarani';
1519 $QuicktimeLanguageLookup[134] =
'Aymara';
1520 $QuicktimeLanguageLookup[135] =
'Tatar';
1521 $QuicktimeLanguageLookup[136] =
'Uighur';
1522 $QuicktimeLanguageLookup[137] =
'Dzongkha';
1523 $QuicktimeLanguageLookup[138] =
'JavaneseRom';
1526 return (isset($QuicktimeLanguageLookup[$languageid]) ? $QuicktimeLanguageLookup[$languageid] :
'invalid');
1537 static $QuicktimeVideoCodecLookup =
array();
1538 if (empty($QuicktimeVideoCodecLookup)) {
1539 $QuicktimeVideoCodecLookup[
'.SGI'] =
'SGI';
1540 $QuicktimeVideoCodecLookup[
'3IV1'] =
'3ivx MPEG-4 v1';
1541 $QuicktimeVideoCodecLookup[
'3IV2'] =
'3ivx MPEG-4 v2';
1542 $QuicktimeVideoCodecLookup[
'3IVX'] =
'3ivx MPEG-4';
1543 $QuicktimeVideoCodecLookup[
'8BPS'] =
'Planar RGB';
1544 $QuicktimeVideoCodecLookup[
'avc1'] =
'H.264/MPEG-4 AVC';
1545 $QuicktimeVideoCodecLookup[
'avr '] =
'AVR-JPEG';
1546 $QuicktimeVideoCodecLookup[
'b16g'] =
'16Gray';
1547 $QuicktimeVideoCodecLookup[
'b32a'] =
'32AlphaGray';
1548 $QuicktimeVideoCodecLookup[
'b48r'] =
'48RGB';
1549 $QuicktimeVideoCodecLookup[
'b64a'] =
'64ARGB';
1550 $QuicktimeVideoCodecLookup[
'base'] =
'Base';
1551 $QuicktimeVideoCodecLookup[
'clou'] =
'Cloud';
1552 $QuicktimeVideoCodecLookup[
'cmyk'] =
'CMYK';
1553 $QuicktimeVideoCodecLookup[
'cvid'] =
'Cinepak';
1554 $QuicktimeVideoCodecLookup[
'dmb1'] =
'OpenDML JPEG';
1555 $QuicktimeVideoCodecLookup[
'dvc '] =
'DVC-NTSC';
1556 $QuicktimeVideoCodecLookup[
'dvcp'] =
'DVC-PAL';
1557 $QuicktimeVideoCodecLookup[
'dvpn'] =
'DVCPro-NTSC';
1558 $QuicktimeVideoCodecLookup[
'dvpp'] =
'DVCPro-PAL';
1559 $QuicktimeVideoCodecLookup[
'fire'] =
'Fire';
1560 $QuicktimeVideoCodecLookup[
'flic'] =
'FLC';
1561 $QuicktimeVideoCodecLookup[
'gif '] =
'GIF';
1562 $QuicktimeVideoCodecLookup[
'h261'] =
'H261';
1563 $QuicktimeVideoCodecLookup[
'h263'] =
'H263';
1564 $QuicktimeVideoCodecLookup[
'IV41'] =
'Indeo4';
1565 $QuicktimeVideoCodecLookup[
'jpeg'] =
'JPEG';
1566 $QuicktimeVideoCodecLookup[
'kpcd'] =
'PhotoCD';
1567 $QuicktimeVideoCodecLookup[
'mjpa'] =
'Motion JPEG-A';
1568 $QuicktimeVideoCodecLookup[
'mjpb'] =
'Motion JPEG-B';
1569 $QuicktimeVideoCodecLookup[
'msvc'] =
'Microsoft Video1';
1570 $QuicktimeVideoCodecLookup[
'myuv'] =
'MPEG YUV420';
1571 $QuicktimeVideoCodecLookup[
'path'] =
'Vector';
1572 $QuicktimeVideoCodecLookup[
'png '] =
'PNG';
1573 $QuicktimeVideoCodecLookup[
'PNTG'] =
'MacPaint';
1574 $QuicktimeVideoCodecLookup[
'qdgx'] =
'QuickDrawGX';
1575 $QuicktimeVideoCodecLookup[
'qdrw'] =
'QuickDraw';
1576 $QuicktimeVideoCodecLookup[
'raw '] =
'RAW';
1577 $QuicktimeVideoCodecLookup[
'ripl'] =
'WaterRipple';
1578 $QuicktimeVideoCodecLookup[
'rpza'] =
'Video';
1579 $QuicktimeVideoCodecLookup[
'smc '] =
'Graphics';
1580 $QuicktimeVideoCodecLookup[
'SVQ1'] =
'Sorenson Video 1';
1581 $QuicktimeVideoCodecLookup[
'SVQ1'] =
'Sorenson Video 3';
1582 $QuicktimeVideoCodecLookup[
'syv9'] =
'Sorenson YUV9';
1583 $QuicktimeVideoCodecLookup[
'tga '] =
'Targa';
1584 $QuicktimeVideoCodecLookup[
'tiff'] =
'TIFF';
1585 $QuicktimeVideoCodecLookup[
'WRAW'] =
'Windows RAW';
1586 $QuicktimeVideoCodecLookup[
'WRLE'] =
'BMP';
1587 $QuicktimeVideoCodecLookup[
'y420'] =
'YUV420';
1588 $QuicktimeVideoCodecLookup[
'yuv2'] =
'ComponentVideo';
1589 $QuicktimeVideoCodecLookup[
'yuvs'] =
'ComponentVideoUnsigned';
1590 $QuicktimeVideoCodecLookup[
'yuvu'] =
'ComponentVideoSigned';
1593 return (isset($QuicktimeVideoCodecLookup[$codecid]) ? $QuicktimeVideoCodecLookup[$codecid] :
'');
1604 static $QuicktimeAudioCodecLookup =
array();
1605 if (empty($QuicktimeAudioCodecLookup)) {
1606 $QuicktimeAudioCodecLookup[
'.mp3'] =
'Fraunhofer MPEG Layer-III alias';
1607 $QuicktimeAudioCodecLookup[
'aac '] =
'ISO/IEC 14496-3 AAC';
1608 $QuicktimeAudioCodecLookup[
'agsm'] =
'Apple GSM 10:1';
1609 $QuicktimeAudioCodecLookup[
'alac'] =
'Apple Lossless Audio Codec';
1610 $QuicktimeAudioCodecLookup[
'alaw'] =
'A-law 2:1';
1611 $QuicktimeAudioCodecLookup[
'conv'] =
'Sample Format';
1612 $QuicktimeAudioCodecLookup[
'dvca'] =
'DV';
1613 $QuicktimeAudioCodecLookup[
'dvi '] =
'DV 4:1';
1614 $QuicktimeAudioCodecLookup[
'eqal'] =
'Frequency Equalizer';
1615 $QuicktimeAudioCodecLookup[
'fl32'] =
'32-bit Floating Point';
1616 $QuicktimeAudioCodecLookup[
'fl64'] =
'64-bit Floating Point';
1617 $QuicktimeAudioCodecLookup[
'ima4'] =
'Interactive Multimedia Association 4:1';
1618 $QuicktimeAudioCodecLookup[
'in24'] =
'24-bit Integer';
1619 $QuicktimeAudioCodecLookup[
'in32'] =
'32-bit Integer';
1620 $QuicktimeAudioCodecLookup[
'lpc '] =
'LPC 23:1';
1621 $QuicktimeAudioCodecLookup[
'MAC3'] =
'Macintosh Audio Compression/Expansion (MACE) 3:1';
1622 $QuicktimeAudioCodecLookup[
'MAC6'] =
'Macintosh Audio Compression/Expansion (MACE) 6:1';
1623 $QuicktimeAudioCodecLookup[
'mixb'] =
'8-bit Mixer';
1624 $QuicktimeAudioCodecLookup[
'mixw'] =
'16-bit Mixer';
1625 $QuicktimeAudioCodecLookup[
'mp4a'] =
'ISO/IEC 14496-3 AAC';
1626 $QuicktimeAudioCodecLookup[
'MS'.
"\x00\x02"] =
'Microsoft ADPCM';
1627 $QuicktimeAudioCodecLookup[
'MS'.
"\x00\x11"] =
'DV IMA';
1628 $QuicktimeAudioCodecLookup[
'MS'.
"\x00\x55"] =
'Fraunhofer MPEG Layer III';
1629 $QuicktimeAudioCodecLookup[
'NONE'] =
'No Encoding';
1630 $QuicktimeAudioCodecLookup[
'Qclp'] =
'Qualcomm PureVoice';
1631 $QuicktimeAudioCodecLookup[
'QDM2'] =
'QDesign Music 2';
1632 $QuicktimeAudioCodecLookup[
'QDMC'] =
'QDesign Music 1';
1633 $QuicktimeAudioCodecLookup[
'ratb'] =
'8-bit Rate';
1634 $QuicktimeAudioCodecLookup[
'ratw'] =
'16-bit Rate';
1635 $QuicktimeAudioCodecLookup[
'raw '] =
'raw PCM';
1636 $QuicktimeAudioCodecLookup[
'sour'] =
'Sound Source';
1637 $QuicktimeAudioCodecLookup[
'sowt'] =
'signed/two\'s complement (Little Endian)';
1638 $QuicktimeAudioCodecLookup[
'str1'] =
'Iomega MPEG layer II';
1639 $QuicktimeAudioCodecLookup[
'str2'] =
'Iomega MPEG *layer II';
1640 $QuicktimeAudioCodecLookup[
'str3'] =
'Iomega MPEG **layer II';
1641 $QuicktimeAudioCodecLookup[
'str4'] =
'Iomega MPEG ***layer II';
1642 $QuicktimeAudioCodecLookup[
'twos'] =
'signed/two\'s complement (Big Endian)';
1643 $QuicktimeAudioCodecLookup[
'ulaw'] =
'mu-law 2:1';
1646 return (isset($QuicktimeAudioCodecLookup[$codecid]) ? $QuicktimeAudioCodecLookup[$codecid] :
'');
1657 static $QuicktimeDCOMLookup =
array();
1658 if (empty($QuicktimeDCOMLookup)) {
1659 $QuicktimeDCOMLookup[
'zlib'] =
'ZLib Deflate';
1660 $QuicktimeDCOMLookup[
'adec'] =
'Apple Compression';
1663 return (isset($QuicktimeDCOMLookup[$compressionid]) ? $QuicktimeDCOMLookup[$compressionid] :
'');
1674 static $QuicktimeColorNameLookup =
array();
1675 if (empty($QuicktimeColorNameLookup)) {
1676 $QuicktimeColorNameLookup[1] =
'2-color (monochrome)';
1677 $QuicktimeColorNameLookup[2] =
'4-color';
1678 $QuicktimeColorNameLookup[4] =
'16-color';
1679 $QuicktimeColorNameLookup[8] =
'256-color';
1680 $QuicktimeColorNameLookup[16] =
'thousands (16-bit color)';
1681 $QuicktimeColorNameLookup[24] =
'millions (24-bit color)';
1682 $QuicktimeColorNameLookup[32] =
'millions+ (32-bit color)';
1683 $QuicktimeColorNameLookup[33] =
'black & white';
1684 $QuicktimeColorNameLookup[34] =
'4-gray';
1685 $QuicktimeColorNameLookup[36] =
'16-gray';
1686 $QuicktimeColorNameLookup[40] =
'256-gray';
1689 return (isset($QuicktimeColorNameLookup[$colordepthid]) ? $QuicktimeColorNameLookup[$colordepthid] :
'invalid');
1700 static $QuicktimeSTIKLookup =
array();
1701 if (empty($QuicktimeSTIKLookup)) {
1702 $QuicktimeSTIKLookup[0] =
'Movie';
1703 $QuicktimeSTIKLookup[1] =
'Normal';
1704 $QuicktimeSTIKLookup[2] =
'Audiobook';
1705 $QuicktimeSTIKLookup[5] =
'Whacked Bookmark';
1706 $QuicktimeSTIKLookup[6] =
'Music Video';
1707 $QuicktimeSTIKLookup[9] =
'Short Film';
1708 $QuicktimeSTIKLookup[10] =
'TV Show';
1709 $QuicktimeSTIKLookup[11] =
'Booklet';
1710 $QuicktimeSTIKLookup[14] =
'Ringtone';
1711 $QuicktimeSTIKLookup[21] =
'Podcast';
1714 return (isset($QuicktimeSTIKLookup[$stik]) ? $QuicktimeSTIKLookup[$stik] :
'invalid');
1725 static $QuicktimeIODSaudioProfileNameLookup =
array();
1726 if (empty($QuicktimeIODSaudioProfileNameLookup)) {
1727 $QuicktimeIODSaudioProfileNameLookup =
array(
1728 0x00 =>
'ISO Reserved (0x00)',
1729 0x01 =>
'Main Audio Profile @ Level 1',
1730 0x02 =>
'Main Audio Profile @ Level 2',
1731 0x03 =>
'Main Audio Profile @ Level 3',
1732 0x04 =>
'Main Audio Profile @ Level 4',
1733 0x05 =>
'Scalable Audio Profile @ Level 1',
1734 0x06 =>
'Scalable Audio Profile @ Level 2',
1735 0x07 =>
'Scalable Audio Profile @ Level 3',
1736 0x08 =>
'Scalable Audio Profile @ Level 4',
1737 0x09 =>
'Speech Audio Profile @ Level 1',
1738 0x0A =>
'Speech Audio Profile @ Level 2',
1739 0x0B =>
'Synthetic Audio Profile @ Level 1',
1740 0x0C =>
'Synthetic Audio Profile @ Level 2',
1741 0x0D =>
'Synthetic Audio Profile @ Level 3',
1742 0x0E =>
'High Quality Audio Profile @ Level 1',
1743 0x0F =>
'High Quality Audio Profile @ Level 2',
1744 0x10 =>
'High Quality Audio Profile @ Level 3',
1745 0x11 =>
'High Quality Audio Profile @ Level 4',
1746 0x12 =>
'High Quality Audio Profile @ Level 5',
1747 0x13 =>
'High Quality Audio Profile @ Level 6',
1748 0x14 =>
'High Quality Audio Profile @ Level 7',
1749 0x15 =>
'High Quality Audio Profile @ Level 8',
1750 0x16 =>
'Low Delay Audio Profile @ Level 1',
1751 0x17 =>
'Low Delay Audio Profile @ Level 2',
1752 0x18 =>
'Low Delay Audio Profile @ Level 3',
1753 0x19 =>
'Low Delay Audio Profile @ Level 4',
1754 0x1A =>
'Low Delay Audio Profile @ Level 5',
1755 0x1B =>
'Low Delay Audio Profile @ Level 6',
1756 0x1C =>
'Low Delay Audio Profile @ Level 7',
1757 0x1D =>
'Low Delay Audio Profile @ Level 8',
1758 0x1E =>
'Natural Audio Profile @ Level 1',
1759 0x1F =>
'Natural Audio Profile @ Level 2',
1760 0x20 =>
'Natural Audio Profile @ Level 3',
1761 0x21 =>
'Natural Audio Profile @ Level 4',
1762 0x22 =>
'Mobile Audio Internetworking Profile @ Level 1',
1763 0x23 =>
'Mobile Audio Internetworking Profile @ Level 2',
1764 0x24 =>
'Mobile Audio Internetworking Profile @ Level 3',
1765 0x25 =>
'Mobile Audio Internetworking Profile @ Level 4',
1766 0x26 =>
'Mobile Audio Internetworking Profile @ Level 5',
1767 0x27 =>
'Mobile Audio Internetworking Profile @ Level 6',
1768 0x28 =>
'AAC Profile @ Level 1',
1769 0x29 =>
'AAC Profile @ Level 2',
1770 0x2A =>
'AAC Profile @ Level 4',
1771 0x2B =>
'AAC Profile @ Level 5',
1772 0x2C =>
'High Efficiency AAC Profile @ Level 2',
1773 0x2D =>
'High Efficiency AAC Profile @ Level 3',
1774 0x2E =>
'High Efficiency AAC Profile @ Level 4',
1775 0x2F =>
'High Efficiency AAC Profile @ Level 5',
1776 0xFE =>
'Not part of MPEG-4 audio profiles',
1777 0xFF =>
'No audio capability required',
1781 return (isset($QuicktimeIODSaudioProfileNameLookup[$audio_profile_id]) ? $QuicktimeIODSaudioProfileNameLookup[$audio_profile_id] :
'ISO Reserved / User Private');
1792 static $QuicktimeIODSvideoProfileNameLookup =
array();
1793 if (empty($QuicktimeIODSvideoProfileNameLookup)) {
1794 $QuicktimeIODSvideoProfileNameLookup =
array(
1795 0x00 =>
'Reserved (0x00) Profile',
1796 0x01 =>
'Simple Profile @ Level 1',
1797 0x02 =>
'Simple Profile @ Level 2',
1798 0x03 =>
'Simple Profile @ Level 3',
1799 0x08 =>
'Simple Profile @ Level 0',
1800 0x10 =>
'Simple Scalable Profile @ Level 0',
1801 0x11 =>
'Simple Scalable Profile @ Level 1',
1802 0x12 =>
'Simple Scalable Profile @ Level 2',
1803 0x15 =>
'AVC/H264 Profile',
1804 0x21 =>
'Core Profile @ Level 1',
1805 0x22 =>
'Core Profile @ Level 2',
1806 0x32 =>
'Main Profile @ Level 2',
1807 0x33 =>
'Main Profile @ Level 3',
1808 0x34 =>
'Main Profile @ Level 4',
1809 0x42 =>
'N-bit Profile @ Level 2',
1810 0x51 =>
'Scalable Texture Profile @ Level 1',
1811 0x61 =>
'Simple Face Animation Profile @ Level 1',
1812 0x62 =>
'Simple Face Animation Profile @ Level 2',
1813 0x63 =>
'Simple FBA Profile @ Level 1',
1814 0x64 =>
'Simple FBA Profile @ Level 2',
1815 0x71 =>
'Basic Animated Texture Profile @ Level 1',
1816 0x72 =>
'Basic Animated Texture Profile @ Level 2',
1817 0x81 =>
'Hybrid Profile @ Level 1',
1818 0x82 =>
'Hybrid Profile @ Level 2',
1819 0x91 =>
'Advanced Real Time Simple Profile @ Level 1',
1820 0x92 =>
'Advanced Real Time Simple Profile @ Level 2',
1821 0x93 =>
'Advanced Real Time Simple Profile @ Level 3',
1822 0x94 =>
'Advanced Real Time Simple Profile @ Level 4',
1823 0xA1 =>
'Core Scalable Profile @ Level1',
1824 0xA2 =>
'Core Scalable Profile @ Level2',
1825 0xA3 =>
'Core Scalable Profile @ Level3',
1826 0xB1 =>
'Advanced Coding Efficiency Profile @ Level 1',
1827 0xB2 =>
'Advanced Coding Efficiency Profile @ Level 2',
1828 0xB3 =>
'Advanced Coding Efficiency Profile @ Level 3',
1829 0xB4 =>
'Advanced Coding Efficiency Profile @ Level 4',
1830 0xC1 =>
'Advanced Core Profile @ Level 1',
1831 0xC2 =>
'Advanced Core Profile @ Level 2',
1832 0xD1 =>
'Advanced Scalable Texture @ Level1',
1833 0xD2 =>
'Advanced Scalable Texture @ Level2',
1834 0xE1 =>
'Simple Studio Profile @ Level 1',
1835 0xE2 =>
'Simple Studio Profile @ Level 2',
1836 0xE3 =>
'Simple Studio Profile @ Level 3',
1837 0xE4 =>
'Simple Studio Profile @ Level 4',
1838 0xE5 =>
'Core Studio Profile @ Level 1',
1839 0xE6 =>
'Core Studio Profile @ Level 2',
1840 0xE7 =>
'Core Studio Profile @ Level 3',
1841 0xE8 =>
'Core Studio Profile @ Level 4',
1842 0xF0 =>
'Advanced Simple Profile @ Level 0',
1843 0xF1 =>
'Advanced Simple Profile @ Level 1',
1844 0xF2 =>
'Advanced Simple Profile @ Level 2',
1845 0xF3 =>
'Advanced Simple Profile @ Level 3',
1846 0xF4 =>
'Advanced Simple Profile @ Level 4',
1847 0xF5 =>
'Advanced Simple Profile @ Level 5',
1848 0xF7 =>
'Advanced Simple Profile @ Level 3b',
1849 0xF8 =>
'Fine Granularity Scalable Profile @ Level 0',
1850 0xF9 =>
'Fine Granularity Scalable Profile @ Level 1',
1851 0xFA =>
'Fine Granularity Scalable Profile @ Level 2',
1852 0xFB =>
'Fine Granularity Scalable Profile @ Level 3',
1853 0xFC =>
'Fine Granularity Scalable Profile @ Level 4',
1854 0xFD =>
'Fine Granularity Scalable Profile @ Level 5',
1855 0xFE =>
'Not part of MPEG-4 Visual profiles',
1856 0xFF =>
'No visual capability required',
1860 return (isset($QuicktimeIODSvideoProfileNameLookup[$video_profile_id]) ? $QuicktimeIODSvideoProfileNameLookup[$video_profile_id] :
'ISO Reserved Profile');
1871 static $QuicktimeContentRatingLookup =
array();
1872 if (empty($QuicktimeContentRatingLookup)) {
1873 $QuicktimeContentRatingLookup[0] =
'None';
1874 $QuicktimeContentRatingLookup[2] =
'Clean';
1875 $QuicktimeContentRatingLookup[4] =
'Explicit';
1878 return (isset($QuicktimeContentRatingLookup[$rtng]) ? $QuicktimeContentRatingLookup[$rtng] :
'invalid');
1889 static $QuicktimeStoreAccountTypeLookup =
array();
1890 if (empty($QuicktimeStoreAccountTypeLookup)) {
1891 $QuicktimeStoreAccountTypeLookup[0] =
'iTunes';
1892 $QuicktimeStoreAccountTypeLookup[1] =
'AOL';
1895 return (isset($QuicktimeStoreAccountTypeLookup[$akid]) ? $QuicktimeStoreAccountTypeLookup[$akid] :
'invalid');
1906 static $QuicktimeStoreFrontCodeLookup =
array();
1907 if (empty($QuicktimeStoreFrontCodeLookup)) {
1908 $QuicktimeStoreFrontCodeLookup[143460] =
'Australia';
1909 $QuicktimeStoreFrontCodeLookup[143445] =
'Austria';
1910 $QuicktimeStoreFrontCodeLookup[143446] =
'Belgium';
1911 $QuicktimeStoreFrontCodeLookup[143455] =
'Canada';
1912 $QuicktimeStoreFrontCodeLookup[143458] =
'Denmark';
1913 $QuicktimeStoreFrontCodeLookup[143447] =
'Finland';
1914 $QuicktimeStoreFrontCodeLookup[143442] =
'France';
1915 $QuicktimeStoreFrontCodeLookup[143443] =
'Germany';
1916 $QuicktimeStoreFrontCodeLookup[143448] =
'Greece';
1917 $QuicktimeStoreFrontCodeLookup[143449] =
'Ireland';
1918 $QuicktimeStoreFrontCodeLookup[143450] =
'Italy';
1919 $QuicktimeStoreFrontCodeLookup[143462] =
'Japan';
1920 $QuicktimeStoreFrontCodeLookup[143451] =
'Luxembourg';
1921 $QuicktimeStoreFrontCodeLookup[143452] =
'Netherlands';
1922 $QuicktimeStoreFrontCodeLookup[143461] =
'New Zealand';
1923 $QuicktimeStoreFrontCodeLookup[143457] =
'Norway';
1924 $QuicktimeStoreFrontCodeLookup[143453] =
'Portugal';
1925 $QuicktimeStoreFrontCodeLookup[143454] =
'Spain';
1926 $QuicktimeStoreFrontCodeLookup[143456] =
'Sweden';
1927 $QuicktimeStoreFrontCodeLookup[143459] =
'Switzerland';
1928 $QuicktimeStoreFrontCodeLookup[143444] =
'United Kingdom';
1929 $QuicktimeStoreFrontCodeLookup[143441] =
'United States';
1932 return (isset($QuicktimeStoreFrontCodeLookup[$sfid]) ? $QuicktimeStoreFrontCodeLookup[$sfid] :
'invalid');
1958 $NCTGtagName =
array(
1959 0x00000001 =>
'Make',
1960 0x00000002 =>
'Model',
1961 0x00000003 =>
'Software',
1962 0x00000011 =>
'CreateDate',
1963 0x00000012 =>
'DateTimeOriginal',
1964 0x00000013 =>
'FrameCount',
1965 0x00000016 =>
'FrameRate',
1966 0x00000022 =>
'FrameWidth',
1967 0x00000023 =>
'FrameHeight',
1968 0x00000032 =>
'AudioChannels',
1969 0x00000033 =>
'AudioBitsPerSample',
1970 0x00000034 =>
'AudioSampleRate',
1971 0x02000001 =>
'MakerNoteVersion',
1972 0x02000005 =>
'WhiteBalance',
1973 0x0200000b =>
'WhiteBalanceFineTune',
1974 0x0200001e =>
'ColorSpace',
1975 0x02000023 =>
'PictureControlData',
1976 0x02000024 =>
'WorldTime',
1977 0x02000032 =>
'UnknownInfo',
1978 0x02000083 =>
'LensType',
1979 0x02000084 =>
'Lens',
1983 $datalength = strlen($atom_data);
1985 while ($offset < $datalength) {
1990 switch ($data_size_type) {
1993 $offset += ($data_size * 1);
1996 $data = substr($atom_data, $offset, $data_size * 1);
1997 $offset += ($data_size * 1);
2002 for ($i = $data_size - 1; $i >= 0; $i--) {
2003 $data .= substr($atom_data, $offset + ($i * 2), 2);
2006 $offset += ($data_size * 2);
2010 for ($i = $data_size - 1; $i >= 0; $i--) {
2011 $data .= substr($atom_data, $offset + ($i * 4), 4);
2014 $offset += ($data_size * 4);
2018 for ($i = 0; $i < $data_size; $i++) {
2021 if ($denomninator == 0) {
2024 $data[$i] = (double) $numerator / $denomninator;
2027 $offset += (8 * $data_size);
2028 if (count(
$data) == 1) {
2033 $data = substr($atom_data, $offset, $data_size * 1);
2034 $offset += ($data_size * 1);
2037 $data = substr($atom_data, $offset, $data_size * 2);
2038 $offset += ($data_size * 2);
2041 echo 'QuicktimeParseNikonNCTG()::unknown $data_size_type: '.$data_size_type.
'<br>';
2045 switch ($record_type) {
2056 $data =
'Adobe RGB';
2061 $PictureControlAdjust =
array(0=>
'default', 1=>
'quick', 2=>
'full');
2062 $FilterEffect =
array(0x80=>
'off', 0x81=>
'yellow', 0x82=>
'orange', 0x83=>
'red', 0x84=>
'green', 0xff=>
'n/a');
2063 $ToningEffect =
array(0x80=>
'b&w', 0x81=>
'sepia', 0x82=>
'cyanotype', 0x83=>
'red', 0x84=>
'yellow', 0x85=>
'green', 0x86=>
'blue-green', 0x87=>
'blue', 0x88=>
'purple-blue', 0x89=>
'red-purple', 0xff=>
'n/a');
2065 'PictureControlVersion' => substr(
$data, 0, 4),
2066 'PictureControlName' => rtrim(substr(
$data, 4, 20),
"\x00"),
2067 'PictureControlBase' => rtrim(substr(
$data, 24, 20),
"\x00"),
2069 'PictureControlAdjust' => $PictureControlAdjust[ord(substr(
$data, 48, 1))],
2070 'PictureControlQuickAdjust' => ord(substr(
$data, 49, 1)),
2071 'Sharpness' => ord(substr(
$data, 50, 1)),
2072 'Contrast' => ord(substr(
$data, 51, 1)),
2073 'Brightness' => ord(substr(
$data, 52, 1)),
2074 'Saturation' => ord(substr(
$data, 53, 1)),
2075 'HueAdjustment' => ord(substr(
$data, 54, 1)),
2076 'FilterEffect' => $FilterEffect[ord(substr(
$data, 55, 1))],
2077 'ToningEffect' => $ToningEffect[ord(substr(
$data, 56, 1))],
2078 'ToningSaturation' => ord(substr(
$data, 57, 1)),
2085 if ($timezone & 0x8000) {
2086 $timezone = 0 - (0x10000 - $timezone);
2093 $datedisplayformat =
'D/M/Y';
break;
2095 $datedisplayformat =
'M/D/Y';
break;
2098 $datedisplayformat =
'Y/M/D';
break;
2101 $data =
array(
'timezone'=>floatval($timezone),
'dst'=>$dst,
'display'=>$datedisplayformat);
2106 'mf' => (
bool) (
$data & 0x01),
2107 'd' => (
bool) (
$data & 0x02),
2108 'g' => (
bool) (
$data & 0x04),
2109 'vr' => (
bool) (
$data & 0x08),
2113 $tag_name = (isset($NCTGtagName[$record_type]) ? $NCTGtagName[$record_type] :
'0x'.str_pad(dechex($record_type), 8,
'0', STR_PAD_LEFT));
2114 $parsed[$tag_name] =
$data;
2130 static $handyatomtranslatorarray =
array();
2131 if (empty($handyatomtranslatorarray)) {
2132 $handyatomtranslatorarray[
'©cpy'] =
'copyright';
2133 $handyatomtranslatorarray[
'©day'] =
'creation_date';
2134 $handyatomtranslatorarray[
'©dir'] =
'director';
2135 $handyatomtranslatorarray[
'©ed1'] =
'edit1';
2136 $handyatomtranslatorarray[
'©ed2'] =
'edit2';
2137 $handyatomtranslatorarray[
'©ed3'] =
'edit3';
2138 $handyatomtranslatorarray[
'©ed4'] =
'edit4';
2139 $handyatomtranslatorarray[
'©ed5'] =
'edit5';
2140 $handyatomtranslatorarray[
'©ed6'] =
'edit6';
2141 $handyatomtranslatorarray[
'©ed7'] =
'edit7';
2142 $handyatomtranslatorarray[
'©ed8'] =
'edit8';
2143 $handyatomtranslatorarray[
'©ed9'] =
'edit9';
2144 $handyatomtranslatorarray[
'©fmt'] =
'format';
2145 $handyatomtranslatorarray[
'©inf'] =
'information';
2146 $handyatomtranslatorarray[
'©prd'] =
'producer';
2147 $handyatomtranslatorarray[
'©prf'] =
'performers';
2148 $handyatomtranslatorarray[
'©req'] =
'system_requirements';
2149 $handyatomtranslatorarray[
'©src'] =
'source_credit';
2150 $handyatomtranslatorarray[
'©wrt'] =
'writer';
2153 $handyatomtranslatorarray[
'©nam'] =
'title';
2154 $handyatomtranslatorarray[
'©cmt'] =
'comment';
2155 $handyatomtranslatorarray[
'©wrn'] =
'warning';
2156 $handyatomtranslatorarray[
'©hst'] =
'host_computer';
2157 $handyatomtranslatorarray[
'©mak'] =
'make';
2158 $handyatomtranslatorarray[
'©mod'] =
'model';
2159 $handyatomtranslatorarray[
'©PRD'] =
'product';
2160 $handyatomtranslatorarray[
'©swr'] =
'software';
2161 $handyatomtranslatorarray[
'©aut'] =
'author';
2162 $handyatomtranslatorarray[
'©ART'] =
'artist';
2163 $handyatomtranslatorarray[
'©trk'] =
'track';
2164 $handyatomtranslatorarray[
'©alb'] =
'album';
2165 $handyatomtranslatorarray[
'©com'] =
'comment';
2166 $handyatomtranslatorarray[
'©gen'] =
'genre';
2167 $handyatomtranslatorarray[
'©ope'] =
'composer';
2168 $handyatomtranslatorarray[
'©url'] =
'url';
2169 $handyatomtranslatorarray[
'©enc'] =
'encoder';
2172 $handyatomtranslatorarray[
'©art'] =
'artist';
2173 $handyatomtranslatorarray[
'aART'] =
'album_artist';
2174 $handyatomtranslatorarray[
'trkn'] =
'track_number';
2175 $handyatomtranslatorarray[
'disk'] =
'disc_number';
2176 $handyatomtranslatorarray[
'gnre'] =
'genre';
2177 $handyatomtranslatorarray[
'©too'] =
'encoder';
2178 $handyatomtranslatorarray[
'tmpo'] =
'bpm';
2179 $handyatomtranslatorarray[
'cprt'] =
'copyright';
2180 $handyatomtranslatorarray[
'cpil'] =
'compilation';
2181 $handyatomtranslatorarray[
'covr'] =
'picture';
2182 $handyatomtranslatorarray[
'rtng'] =
'rating';
2183 $handyatomtranslatorarray[
'©grp'] =
'grouping';
2184 $handyatomtranslatorarray[
'stik'] =
'stik';
2185 $handyatomtranslatorarray[
'pcst'] =
'podcast';
2186 $handyatomtranslatorarray[
'catg'] =
'category';
2187 $handyatomtranslatorarray[
'keyw'] =
'keyword';
2188 $handyatomtranslatorarray[
'purl'] =
'podcast_url';
2189 $handyatomtranslatorarray[
'egid'] =
'episode_guid';
2190 $handyatomtranslatorarray[
'desc'] =
'description';
2191 $handyatomtranslatorarray[
'©lyr'] =
'lyrics';
2192 $handyatomtranslatorarray[
'tvnn'] =
'tv_network_name';
2193 $handyatomtranslatorarray[
'tvsh'] =
'tv_show_name';
2194 $handyatomtranslatorarray[
'tvsn'] =
'tv_season';
2195 $handyatomtranslatorarray[
'tves'] =
'tv_episode';
2196 $handyatomtranslatorarray[
'purd'] =
'purchase_date';
2197 $handyatomtranslatorarray[
'pgap'] =
'gapless_playback';
2221 $info = &$this->getid3->info;
2223 if ($boxname && ($boxname != $keyname)) {
2224 $comment_key = (isset($handyatomtranslatorarray[$boxname]) ? $handyatomtranslatorarray[$boxname] : $boxname);
2225 } elseif (isset($handyatomtranslatorarray[$keyname])) {
2226 $comment_key = $handyatomtranslatorarray[$keyname];
2229 if ($comment_key ==
'picture') {
2230 if (!is_array(
$data)) {
2232 if (preg_match(
'#^\x89\x50\x4E\x47\x0D\x0A\x1A\x0A#',
$data)) {
2233 $image_mime =
'image/png';
2234 } elseif (preg_match(
'#^\xFF\xD8\xFF#',
$data)) {
2235 $image_mime =
'image/jpeg';
2236 } elseif (preg_match(
'#^GIF#',
$data)) {
2237 $image_mime =
'image/gif';
2238 } elseif (preg_match(
'#^BM#',
$data)) {
2239 $image_mime =
'image/bmp';
2244 $info[
'quicktime'][
'comments'][$comment_key][] =
$data;
2258 if (substr($nullterminatedstring, strlen($nullterminatedstring) - 1, 1) ===
"\x00") {
2259 return substr($nullterminatedstring, 0, strlen($nullterminatedstring) - 1);
2262 return $nullterminatedstring;
2273 return substr($pascalstring, 1);
static DateMac2Unix($macdate)
QuicktimeContentRatingLookup($rtng)
array $QuicktimeContentRatingLookup
static PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8')
QuicktimeIODSvideoProfileName($video_profile_id)
array $QuicktimeIODSvideoProfileNameLookup
GetId3() by James Heinrich info@getid3.org //.
QuicktimeStoreFrontCodeLookup($sfid)
array $QuicktimeStoreFrontCodeLookup
QuicktimeLanguageLookup($languageid)
array $QuicktimeLanguageLookup
Pascal2String($pascalstring)
GetId3() by James Heinrich info@getid3.org //.
static LookupGenreName($genreid, $allowSCMPXextended=true)
QuicktimeParseAtom($atomname, $atomsize, $atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms)
QuicktimeColorNameLookup($colordepthid)
array $QuicktimeColorNameLookup
static FixedPoint2_30($rawdata)
QuicktimeIODSaudioProfileName($audio_profile_id)
array $QuicktimeIODSaudioProfileNameLookup
QuicktimeStoreAccountTypeLookup($akid)
array $QuicktimeStoreAccountTypeLookup
NoNullString($nullterminatedstring)
fseek($bytes, $whence=SEEK_SET)
QuicktimeAudioCodecLookup($codecid)
array $QuicktimeAudioCodecLookup
QuicktimeDCOMLookup($compressionid)
array $QuicktimeDCOMLookup
GetId3() by James Heinrich info@getid3.org //.
GetId3() by James Heinrich info@getid3.org //.
quicktime_read_mp4_descr_length($data, &$offset)
Create styles array
The data for the language used.
static FixedPoint8_8($rawdata)
static BigEndian2Int($byteword, $synchsafe=false, $signed=false)
QuicktimeSTIKLookup($stik)
array $QuicktimeSTIKLookup
static intValueSupported($num)
null $hasINT64
QuicktimeParseNikonNCTG($atom_data)
CopyToAppropriateCommentsSection($keyname, $data, $boxname='')
array $handyatomtranslatorarray
QuicktimeVideoCodecLookup($codecid)
array $QuicktimeVideoCodecLookup
static FixedPoint16_16($rawdata)
QuicktimeParseContainerAtom($atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms)