18 define(
'EBML_ID_CHAPTERS', 0x0043A770);
19 define(
'EBML_ID_SEEKHEAD', 0x014D9B74);
20 define(
'EBML_ID_TAGS', 0x0254C367);
21 define(
'EBML_ID_INFO', 0x0549A966);
22 define(
'EBML_ID_TRACKS', 0x0654AE6B);
23 define(
'EBML_ID_SEGMENT', 0x08538067);
24 define(
'EBML_ID_ATTACHMENTS', 0x0941A469);
25 define(
'EBML_ID_EBML', 0x0A45DFA3);
26 define(
'EBML_ID_CUES', 0x0C53BB6B);
27 define(
'EBML_ID_CLUSTER', 0x0F43B675);
28 define(
'EBML_ID_LANGUAGE', 0x02B59C);
29 define(
'EBML_ID_TRACKTIMECODESCALE', 0x03314F);
30 define(
'EBML_ID_DEFAULTDURATION', 0x03E383);
31 define(
'EBML_ID_CODECNAME', 0x058688);
32 define(
'EBML_ID_CODECDOWNLOADURL', 0x06B240);
33 define(
'EBML_ID_TIMECODESCALE', 0x0AD7B1);
34 define(
'EBML_ID_COLOURSPACE', 0x0EB524);
35 define(
'EBML_ID_GAMMAVALUE', 0x0FB523);
36 define(
'EBML_ID_CODECSETTINGS', 0x1A9697);
37 define(
'EBML_ID_CODECINFOURL', 0x1B4040);
38 define(
'EBML_ID_PREVFILENAME', 0x1C83AB);
39 define(
'EBML_ID_PREVUID', 0x1CB923);
40 define(
'EBML_ID_NEXTFILENAME', 0x1E83BB);
41 define(
'EBML_ID_NEXTUID', 0x1EB923);
42 define(
'EBML_ID_CONTENTCOMPALGO', 0x0254);
43 define(
'EBML_ID_CONTENTCOMPSETTINGS', 0x0255);
44 define(
'EBML_ID_DOCTYPE', 0x0282);
45 define(
'EBML_ID_DOCTYPEREADVERSION', 0x0285);
46 define(
'EBML_ID_EBMLVERSION', 0x0286);
47 define(
'EBML_ID_DOCTYPEVERSION', 0x0287);
48 define(
'EBML_ID_EBMLMAXIDLENGTH', 0x02F2);
49 define(
'EBML_ID_EBMLMAXSIZELENGTH', 0x02F3);
50 define(
'EBML_ID_EBMLREADVERSION', 0x02F7);
51 define(
'EBML_ID_CHAPLANGUAGE', 0x037C);
52 define(
'EBML_ID_CHAPCOUNTRY', 0x037E);
53 define(
'EBML_ID_SEGMENTFAMILY', 0x0444);
54 define(
'EBML_ID_DATEUTC', 0x0461);
55 define(
'EBML_ID_TAGLANGUAGE', 0x047A);
56 define(
'EBML_ID_TAGDEFAULT', 0x0484);
57 define(
'EBML_ID_TAGBINARY', 0x0485);
58 define(
'EBML_ID_TAGSTRING', 0x0487);
59 define(
'EBML_ID_DURATION', 0x0489);
60 define(
'EBML_ID_CHAPPROCESSPRIVATE', 0x050D);
61 define(
'EBML_ID_CHAPTERFLAGENABLED', 0x0598);
62 define(
'EBML_ID_TAGNAME', 0x05A3);
63 define(
'EBML_ID_EDITIONENTRY', 0x05B9);
64 define(
'EBML_ID_EDITIONUID', 0x05BC);
65 define(
'EBML_ID_EDITIONFLAGHIDDEN', 0x05BD);
66 define(
'EBML_ID_EDITIONFLAGDEFAULT', 0x05DB);
67 define(
'EBML_ID_EDITIONFLAGORDERED', 0x05DD);
68 define(
'EBML_ID_FILEDATA', 0x065C);
69 define(
'EBML_ID_FILEMIMETYPE', 0x0660);
70 define(
'EBML_ID_FILENAME', 0x066E);
71 define(
'EBML_ID_FILEREFERRAL', 0x0675);
72 define(
'EBML_ID_FILEDESCRIPTION', 0x067E);
73 define(
'EBML_ID_FILEUID', 0x06AE);
74 define(
'EBML_ID_CONTENTENCALGO', 0x07E1);
75 define(
'EBML_ID_CONTENTENCKEYID', 0x07E2);
76 define(
'EBML_ID_CONTENTSIGNATURE', 0x07E3);
77 define(
'EBML_ID_CONTENTSIGKEYID', 0x07E4);
78 define(
'EBML_ID_CONTENTSIGALGO', 0x07E5);
79 define(
'EBML_ID_CONTENTSIGHASHALGO', 0x07E6);
80 define(
'EBML_ID_MUXINGAPP', 0x0D80);
81 define(
'EBML_ID_SEEK', 0x0DBB);
82 define(
'EBML_ID_CONTENTENCODINGORDER', 0x1031);
83 define(
'EBML_ID_CONTENTENCODINGSCOPE', 0x1032);
84 define(
'EBML_ID_CONTENTENCODINGTYPE', 0x1033);
85 define(
'EBML_ID_CONTENTCOMPRESSION', 0x1034);
86 define(
'EBML_ID_CONTENTENCRYPTION', 0x1035);
87 define(
'EBML_ID_CUEREFNUMBER', 0x135F);
88 define(
'EBML_ID_NAME', 0x136E);
89 define(
'EBML_ID_CUEBLOCKNUMBER', 0x1378);
90 define(
'EBML_ID_TRACKOFFSET', 0x137F);
91 define(
'EBML_ID_SEEKID', 0x13AB);
92 define(
'EBML_ID_SEEKPOSITION', 0x13AC);
93 define(
'EBML_ID_STEREOMODE', 0x13B8);
94 define(
'EBML_ID_OLDSTEREOMODE', 0x13B9);
95 define(
'EBML_ID_PIXELCROPBOTTOM', 0x14AA);
96 define(
'EBML_ID_DISPLAYWIDTH', 0x14B0);
97 define(
'EBML_ID_DISPLAYUNIT', 0x14B2);
98 define(
'EBML_ID_ASPECTRATIOTYPE', 0x14B3);
99 define(
'EBML_ID_DISPLAYHEIGHT', 0x14BA);
100 define(
'EBML_ID_PIXELCROPTOP', 0x14BB);
101 define(
'EBML_ID_PIXELCROPLEFT', 0x14CC);
102 define(
'EBML_ID_PIXELCROPRIGHT', 0x14DD);
103 define(
'EBML_ID_FLAGFORCED', 0x15AA);
104 define(
'EBML_ID_MAXBLOCKADDITIONID', 0x15EE);
105 define(
'EBML_ID_WRITINGAPP', 0x1741);
106 define(
'EBML_ID_CLUSTERSILENTTRACKS', 0x1854);
107 define(
'EBML_ID_CLUSTERSILENTTRACKNUMBER', 0x18D7);
108 define(
'EBML_ID_ATTACHEDFILE', 0x21A7);
109 define(
'EBML_ID_CONTENTENCODING', 0x2240);
110 define(
'EBML_ID_BITDEPTH', 0x2264);
111 define(
'EBML_ID_CODECPRIVATE', 0x23A2);
112 define(
'EBML_ID_TARGETS', 0x23C0);
113 define(
'EBML_ID_CHAPTERPHYSICALEQUIV', 0x23C3);
114 define(
'EBML_ID_TAGCHAPTERUID', 0x23C4);
115 define(
'EBML_ID_TAGTRACKUID', 0x23C5);
116 define(
'EBML_ID_TAGATTACHMENTUID', 0x23C6);
117 define(
'EBML_ID_TAGEDITIONUID', 0x23C9);
118 define(
'EBML_ID_TARGETTYPE', 0x23CA);
119 define(
'EBML_ID_TRACKTRANSLATE', 0x2624);
120 define(
'EBML_ID_TRACKTRANSLATETRACKID', 0x26A5);
121 define(
'EBML_ID_TRACKTRANSLATECODEC', 0x26BF);
122 define(
'EBML_ID_TRACKTRANSLATEEDITIONUID', 0x26FC);
123 define(
'EBML_ID_SIMPLETAG', 0x27C8);
124 define(
'EBML_ID_TARGETTYPEVALUE', 0x28CA);
125 define(
'EBML_ID_CHAPPROCESSCOMMAND', 0x2911);
126 define(
'EBML_ID_CHAPPROCESSTIME', 0x2922);
127 define(
'EBML_ID_CHAPTERTRANSLATE', 0x2924);
128 define(
'EBML_ID_CHAPPROCESSDATA', 0x2933);
129 define(
'EBML_ID_CHAPPROCESS', 0x2944);
130 define(
'EBML_ID_CHAPPROCESSCODECID', 0x2955);
131 define(
'EBML_ID_CHAPTERTRANSLATEID', 0x29A5);
132 define(
'EBML_ID_CHAPTERTRANSLATECODEC', 0x29BF);
133 define(
'EBML_ID_CHAPTERTRANSLATEEDITIONUID', 0x29FC);
134 define(
'EBML_ID_CONTENTENCODINGS', 0x2D80);
135 define(
'EBML_ID_MINCACHE', 0x2DE7);
136 define(
'EBML_ID_MAXCACHE', 0x2DF8);
137 define(
'EBML_ID_CHAPTERSEGMENTUID', 0x2E67);
138 define(
'EBML_ID_CHAPTERSEGMENTEDITIONUID', 0x2EBC);
139 define(
'EBML_ID_TRACKOVERLAY', 0x2FAB);
140 define(
'EBML_ID_TAG', 0x3373);
141 define(
'EBML_ID_SEGMENTFILENAME', 0x3384);
142 define(
'EBML_ID_SEGMENTUID', 0x33A4);
143 define(
'EBML_ID_CHAPTERUID', 0x33C4);
144 define(
'EBML_ID_TRACKUID', 0x33C5);
145 define(
'EBML_ID_ATTACHMENTLINK', 0x3446);
146 define(
'EBML_ID_CLUSTERBLOCKADDITIONS', 0x35A1);
147 define(
'EBML_ID_CHANNELPOSITIONS', 0x347B);
148 define(
'EBML_ID_OUTPUTSAMPLINGFREQUENCY', 0x38B5);
149 define(
'EBML_ID_TITLE', 0x3BA9);
150 define(
'EBML_ID_CHAPTERDISPLAY', 0x00);
151 define(
'EBML_ID_TRACKTYPE', 0x03);
152 define(
'EBML_ID_CHAPSTRING', 0x05);
153 define(
'EBML_ID_CODECID', 0x06);
154 define(
'EBML_ID_FLAGDEFAULT', 0x08);
155 define(
'EBML_ID_CHAPTERTRACKNUMBER', 0x09);
156 define(
'EBML_ID_CLUSTERSLICES', 0x0E);
157 define(
'EBML_ID_CHAPTERTRACK', 0x0F);
158 define(
'EBML_ID_CHAPTERTIMESTART', 0x11);
159 define(
'EBML_ID_CHAPTERTIMEEND', 0x12);
160 define(
'EBML_ID_CUEREFTIME', 0x16);
161 define(
'EBML_ID_CUEREFCLUSTER', 0x17);
162 define(
'EBML_ID_CHAPTERFLAGHIDDEN', 0x18);
163 define(
'EBML_ID_FLAGINTERLACED', 0x1A);
164 define(
'EBML_ID_CLUSTERBLOCKDURATION', 0x1B);
165 define(
'EBML_ID_FLAGLACING', 0x1C);
166 define(
'EBML_ID_CHANNELS', 0x1F);
167 define(
'EBML_ID_CLUSTERBLOCKGROUP', 0x20);
168 define(
'EBML_ID_CLUSTERBLOCK', 0x21);
169 define(
'EBML_ID_CLUSTERBLOCKVIRTUAL', 0x22);
170 define(
'EBML_ID_CLUSTERSIMPLEBLOCK', 0x23);
171 define(
'EBML_ID_CLUSTERCODECSTATE', 0x24);
172 define(
'EBML_ID_CLUSTERBLOCKADDITIONAL', 0x25);
173 define(
'EBML_ID_CLUSTERBLOCKMORE', 0x26);
174 define(
'EBML_ID_CLUSTERPOSITION', 0x27);
175 define(
'EBML_ID_CODECDECODEALL', 0x2A);
176 define(
'EBML_ID_CLUSTERPREVSIZE', 0x2B);
177 define(
'EBML_ID_TRACKENTRY', 0x2E);
178 define(
'EBML_ID_CLUSTERENCRYPTEDBLOCK', 0x2F);
179 define(
'EBML_ID_PIXELWIDTH', 0x30);
180 define(
'EBML_ID_CUETIME', 0x33);
181 define(
'EBML_ID_SAMPLINGFREQUENCY', 0x35);
182 define(
'EBML_ID_CHAPTERATOM', 0x36);
183 define(
'EBML_ID_CUETRACKPOSITIONS', 0x37);
184 define(
'EBML_ID_FLAGENABLED', 0x39);
185 define(
'EBML_ID_PIXELHEIGHT', 0x3A);
186 define(
'EBML_ID_CUEPOINT', 0x3B);
187 define(
'EBML_ID_CRC32', 0x3F);
188 define(
'EBML_ID_CLUSTERBLOCKADDITIONID', 0x4B);
189 define(
'EBML_ID_CLUSTERLACENUMBER', 0x4C);
190 define(
'EBML_ID_CLUSTERFRAMENUMBER', 0x4D);
191 define(
'EBML_ID_CLUSTERDELAY', 0x4E);
192 define(
'EBML_ID_CLUSTERDURATION', 0x4F);
193 define(
'EBML_ID_TRACKNUMBER', 0x57);
194 define(
'EBML_ID_CUEREFERENCE', 0x5B);
195 define(
'EBML_ID_VIDEO', 0x60);
196 define(
'EBML_ID_AUDIO', 0x61);
197 define(
'EBML_ID_CLUSTERTIMESLICE', 0x68);
198 define(
'EBML_ID_CUECODECSTATE', 0x6A);
199 define(
'EBML_ID_CUEREFCODECSTATE', 0x6B);
200 define(
'EBML_ID_VOID', 0x6C);
201 define(
'EBML_ID_CLUSTERTIMECODE', 0x67);
202 define(
'EBML_ID_CLUSTERBLOCKADDID', 0x6E);
203 define(
'EBML_ID_CUECLUSTERPOSITION', 0x71);
204 define(
'EBML_ID_CUETRACK', 0x77);
205 define(
'EBML_ID_CLUSTERREFERENCEPRIORITY', 0x7A);
206 define(
'EBML_ID_CLUSTERREFERENCEBLOCK', 0x7B);
207 define(
'EBML_ID_CLUSTERREFERENCEVIRTUAL', 0x7D);
231 $info = &$this->getid3->info;
237 $this->
error(
'EBML parser: '.$e->getMessage());
241 if (isset(
$info[
'matroska'][
'info']) && is_array(
$info[
'matroska'][
'info'])) {
242 foreach (
$info[
'matroska'][
'info'] as
$key => $infoarray) {
243 if (isset($infoarray[
'Duration'])) {
245 $info[
'playtime_seconds'] = $infoarray[
'Duration'] * ((isset($infoarray[
'TimecodeScale']) ? $infoarray[
'TimecodeScale'] : 1000000) / 1000000000);
252 if (isset(
$info[
'matroska'][
'tags']) && is_array(
$info[
'matroska'][
'tags'])) {
253 foreach (
$info[
'matroska'][
'tags'] as
$key => $infoarray) {
259 if (isset(
$info[
'matroska'][
'tracks'][
'tracks']) && is_array(
$info[
'matroska'][
'tracks'][
'tracks'])) {
260 foreach (
$info[
'matroska'][
'tracks'][
'tracks'] as
$key => $trackarray) {
262 $track_info = array();
263 $track_info[
'dataformat'] = self::CodecIDtoCommonName($trackarray[
'CodecID']);
264 $track_info[
'default'] = (isset($trackarray[
'FlagDefault']) ? $trackarray[
'FlagDefault'] :
true);
265 if (isset($trackarray[
'Name'])) { $track_info[
'name'] = $trackarray[
'Name']; }
267 switch ($trackarray[
'TrackType']) {
270 $track_info[
'resolution_x'] = $trackarray[
'PixelWidth'];
271 $track_info[
'resolution_y'] = $trackarray[
'PixelHeight'];
272 $track_info[
'display_unit'] = self::displayUnit(isset($trackarray[
'DisplayUnit']) ? $trackarray[
'DisplayUnit'] : 0);
273 $track_info[
'display_x'] = (isset($trackarray[
'DisplayWidth']) ? $trackarray[
'DisplayWidth'] : $trackarray[
'PixelWidth']);
274 $track_info[
'display_y'] = (isset($trackarray[
'DisplayHeight']) ? $trackarray[
'DisplayHeight'] : $trackarray[
'PixelHeight']);
276 if (isset($trackarray[
'PixelCropBottom'])) { $track_info[
'crop_bottom'] = $trackarray[
'PixelCropBottom']; }
277 if (isset($trackarray[
'PixelCropTop'])) { $track_info[
'crop_top'] = $trackarray[
'PixelCropTop']; }
278 if (isset($trackarray[
'PixelCropLeft'])) { $track_info[
'crop_left'] = $trackarray[
'PixelCropLeft']; }
279 if (isset($trackarray[
'PixelCropRight'])) { $track_info[
'crop_right'] = $trackarray[
'PixelCropRight']; }
280 if (isset($trackarray[
'DefaultDuration'])) { $track_info[
'frame_rate'] = round(1000000000 / $trackarray[
'DefaultDuration'], 3); }
281 if (isset($trackarray[
'CodecName'])) { $track_info[
'codec'] = $trackarray[
'CodecName']; }
283 switch ($trackarray[
'CodecID']) {
284 case 'V_MS/VFW/FOURCC':
289 $info[
'matroska'][
'track_codec_parsed'][$trackarray[
'TrackNumber']] = $parsed;
316 $info[
'video'][
'streams'][] = $track_info;
320 $track_info[
'sample_rate'] = (isset($trackarray[
'SamplingFrequency']) ? $trackarray[
'SamplingFrequency'] : 8000.0);
321 $track_info[
'channels'] = (isset($trackarray[
'Channels']) ? $trackarray[
'Channels'] : 1);
322 $track_info[
'language'] = (isset($trackarray[
'Language']) ? $trackarray[
'Language'] :
'eng');
323 if (isset($trackarray[
'BitDepth'])) { $track_info[
'bits_per_sample'] = $trackarray[
'BitDepth']; }
324 if (isset($trackarray[
'CodecName'])) { $track_info[
'codec'] = $trackarray[
'CodecName']; }
326 switch ($trackarray[
'CodecID']) {
327 case 'A_PCM/INT/LIT':
328 case 'A_PCM/INT/BIG':
329 $track_info[
'bitrate'] = $trackarray[
'SamplingFrequency'] * $trackarray[
'Channels'] * $trackarray[
'BitDepth'];
338 $module_dataformat = ($track_info[
'dataformat'] ==
'mp2' ?
'mp3' : ($track_info[
'dataformat'] ==
'eac3' ?
'ac3' : $track_info[
'dataformat']));
341 if (!isset(
$info[
'matroska'][
'track_data_offsets'][$trackarray[
'TrackNumber']])) {
342 $this->
warning(
'Unable to parse audio data ['.basename(__FILE__).
':'.__LINE__.
'] because $info[matroska][track_data_offsets]['.$trackarray[
'TrackNumber'].
'] not set');
347 $getid3_temp =
new getID3();
348 if ($track_info[
'dataformat'] !=
'flac') {
349 $getid3_temp->openfile($this->getid3->filename);
351 $getid3_temp->info[
'avdataoffset'] =
$info[
'matroska'][
'track_data_offsets'][$trackarray[
'TrackNumber']][
'offset'];
352 if ($track_info[
'dataformat'][0] ==
'm' || $track_info[
'dataformat'] ==
'flac') {
353 $getid3_temp->info[
'avdataend'] =
$info[
'matroska'][
'track_data_offsets'][$trackarray[
'TrackNumber']][
'offset'] +
$info[
'matroska'][
'track_data_offsets'][$trackarray[
'TrackNumber']][
'length'];
357 $class =
'getid3_'.$module_dataformat;
358 $header_data_key = $track_info[
'dataformat'][0] ==
'm' ?
'mpeg' : $track_info[
'dataformat'];
359 $getid3_audio =
new $class($getid3_temp, __CLASS__);
360 if ($track_info[
'dataformat'] ==
'flac') {
361 $getid3_audio->AnalyzeString($trackarray[
'CodecPrivate']);
364 $getid3_audio->Analyze();
366 if (!empty($getid3_temp->info[$header_data_key])) {
367 $info[
'matroska'][
'track_codec_parsed'][$trackarray[
'TrackNumber']] = $getid3_temp->info[$header_data_key];
368 if (isset($getid3_temp->info[
'audio']) && is_array($getid3_temp->info[
'audio'])) {
369 foreach ($getid3_temp->info[
'audio'] as
$key => $value) {
370 $track_info[
$key] = $value;
375 $this->
warning(
'Unable to parse audio data ['.basename(__FILE__).
':'.__LINE__.
'] because '.$class.
'::Analyze() failed at offset '.$getid3_temp->info[
'avdataoffset']);
379 if (!empty($getid3_temp->info[
'error'])) {
380 foreach ($getid3_temp->info[
'error'] as $newerror) {
381 $this->
warning($class.
'() says: ['.$newerror.
']');
384 if (!empty($getid3_temp->info[
'warning'])) {
385 foreach ($getid3_temp->info[
'warning'] as $newerror) {
386 $this->
warning($class.
'() says: ['.$newerror.
']');
389 unset($getid3_temp, $getid3_audio);
393 case 'A_AAC/MPEG2/LC':
394 case 'A_AAC/MPEG2/LC/SBR':
395 case 'A_AAC/MPEG4/LC':
396 case 'A_AAC/MPEG4/LC/SBR':
397 $this->
warning($trackarray[
'CodecID'].
' audio data contains no header, audio/video bitrates can\'t be calculated');
401 if (!isset($trackarray[
'CodecPrivate'])) {
402 $this->
warning(
'Unable to parse audio data ['.basename(__FILE__).
':'.__LINE__.
'] because CodecPrivate data not set');
405 $vorbis_offset = strpos($trackarray[
'CodecPrivate'],
'vorbis', 1);
406 if ($vorbis_offset ===
false) {
407 $this->
warning(
'Unable to parse audio data ['.basename(__FILE__).
':'.__LINE__.
'] because CodecPrivate data does not contain "vorbis" keyword');
415 $getid3_temp =
new getID3();
419 $oggpageinfo[
'page_seqno'] = 0;
420 $getid3_ogg->ParseVorbisPageHeader($trackarray[
'CodecPrivate'], $vorbis_offset, $oggpageinfo);
421 if (!empty($getid3_temp->info[
'ogg'])) {
422 $info[
'matroska'][
'track_codec_parsed'][$trackarray[
'TrackNumber']] = $getid3_temp->info[
'ogg'];
423 if (isset($getid3_temp->info[
'audio']) && is_array($getid3_temp->info[
'audio'])) {
424 foreach ($getid3_temp->info[
'audio'] as
$key => $value) {
425 $track_info[
$key] = $value;
431 if (!empty($getid3_temp->info[
'error'])) {
432 foreach ($getid3_temp->info[
'error'] as $newerror) {
433 $this->
warning(
'getid3_ogg() says: ['.$newerror.
']');
436 if (!empty($getid3_temp->info[
'warning'])) {
437 foreach ($getid3_temp->info[
'warning'] as $newerror) {
438 $this->
warning(
'getid3_ogg() says: ['.$newerror.
']');
442 if (!empty($getid3_temp->info[
'ogg'][
'bitrate_nominal'])) {
443 $track_info[
'bitrate'] = $getid3_temp->info[
'ogg'][
'bitrate_nominal'];
445 unset($getid3_temp, $getid3_ogg, $oggpageinfo, $vorbis_offset);
452 foreach ($parsed as
$key => $value) {
454 $track_info[
$key] = $value;
457 $info[
'matroska'][
'track_codec_parsed'][$trackarray[
'TrackNumber']] = $parsed;
461 $this->
warning(
'Unhandled audio type "'.(isset($trackarray[
'CodecID']) ? $trackarray[
'CodecID'] :
'').
'"');
465 $info[
'audio'][
'streams'][] = $track_info;
470 if (!empty(
$info[
'video'][
'streams'])) {
471 $info[
'video'] = self::getDefaultStreamInfo(
$info[
'video'][
'streams']);
473 if (!empty(
$info[
'audio'][
'streams'])) {
474 $info[
'audio'] = self::getDefaultStreamInfo(
$info[
'audio'][
'streams']);
480 foreach (
$info[
'matroska'][
'attachments'] as
$i => $entry) {
481 if (strpos($entry[
'FileMimeType'],
'image/') === 0 && !empty($entry[
'FileData'])) {
482 $info[
'matroska'][
'comments'][
'picture'][] = array(
'data' => $entry[
'FileData'],
'image_mime' => $entry[
'FileMimeType'],
'filename' => $entry[
'FileName']);
488 if (!empty(
$info[
'video'][
'streams'])) {
489 $info[
'mime_type'] = (
$info[
'matroska'][
'doctype'] ==
'webm' ?
'video/webm' :
'video/x-matroska');
490 } elseif (!empty(
$info[
'audio'][
'streams'])) {
491 $info[
'mime_type'] = (
$info[
'matroska'][
'doctype'] ==
'webm' ?
'audio/webm' :
'audio/x-matroska');
492 } elseif (isset(
$info[
'mime_type'])) {
493 unset(
$info[
'mime_type']);
501 $this->current_offset =
$info[
'avdataoffset'];
504 switch ($top_element[
'id']) {
507 $info[
'matroska'][
'header'][
'offset'] = $top_element[
'offset'];
508 $info[
'matroska'][
'header'][
'length'] = $top_element[
'length'];
510 while ($this->
getEBMLelement($element_data, $top_element[
'end'],
true)) {
511 switch ($element_data[
'id']) {
524 $info[
'matroska'][
'doctype'] = $element_data[
'data'];
525 $info[
'fileformat'] = $element_data[
'data'];
533 unset($element_data[
'offset'], $element_data[
'end']);
534 $info[
'matroska'][
'header'][
'elements'][] = $element_data;
539 $info[
'matroska'][
'segment'][0][
'offset'] = $top_element[
'offset'];
540 $info[
'matroska'][
'segment'][0][
'length'] = $top_element[
'length'];
542 while ($this->
getEBMLelement($element_data, $top_element[
'end'])) {
544 $info[
'matroska'][
'segments'][] = $element_data;
546 switch ($element_data[
'id']) {
550 while ($this->
getEBMLelement($seek_entry, $element_data[
'end'])) {
551 switch ($seek_entry[
'id']) {
554 while ($this->
getEBMLelement($sub_seek_entry, $seek_entry[
'end'],
true)) {
556 switch ($sub_seek_entry[
'id']) {
559 $seek_entry[
'target_id'] = self::EBML2Int($sub_seek_entry[
'data']);
560 $seek_entry[
'target_name'] = self::EBMLidName($seek_entry[
'target_id']);
571 if (!isset($seek_entry[
'target_id'])) {
572 $this->
warning(
'seek_entry[target_id] unexpectedly not set at '.$seek_entry[
'offset']);
575 if (($seek_entry[
'target_id'] !=
EBML_ID_CLUSTER) || !self::$hide_clusters) {
576 $info[
'matroska'][
'seek'][] = $seek_entry;
588 $info[
'matroska'][
'tracks'] = $element_data;
590 while ($this->
getEBMLelement($track_entry, $element_data[
'end'])) {
591 switch ($track_entry[
'id']) {
596 switch ($subelement[
'id']) {
620 $track_entry[$subelement[
'id_name']] = $this->
readEBMLelementData($subelement[
'length'],
true);
633 while ($this->
getEBMLelement($sub_subelement, $subelement[
'end'],
true)) {
634 switch ($sub_subelement[
'id']) {
672 while ($this->
getEBMLelement($sub_subelement, $subelement[
'end'],
true)) {
673 switch ($sub_subelement[
'id']) {
698 while ($this->
getEBMLelement($sub_subelement, $subelement[
'end'])) {
699 switch ($sub_subelement[
'id']) {
704 switch ($sub_sub_subelement[
'id']) {
709 $track_entry[$sub_subelement[
'id_name']][$sub_sub_subelement[
'id_name']] =
getid3_lib::BigEndian2Int($sub_sub_subelement[
'data']);
714 while ($this->
getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement[
'end'],
true)) {
715 switch ($sub_sub_sub_subelement[
'id']) {
718 $track_entry[$sub_subelement[
'id_name']][$sub_sub_subelement[
'id_name']][$sub_sub_sub_subelement[
'id_name']] =
getid3_lib::BigEndian2Int($sub_sub_sub_subelement[
'data']);
722 $track_entry[$sub_subelement[
'id_name']][$sub_sub_subelement[
'id_name']][$sub_sub_sub_subelement[
'id_name']] = $sub_sub_sub_subelement[
'data'];
726 $this->
unhandledElement(
'track.contentencodings.contentencoding.contentcompression', __LINE__, $sub_sub_sub_subelement);
734 while ($this->
getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement[
'end'],
true)) {
735 switch ($sub_sub_sub_subelement[
'id']) {
740 $track_entry[$sub_subelement[
'id_name']][$sub_sub_subelement[
'id_name']][$sub_sub_sub_subelement[
'id_name']] =
getid3_lib::BigEndian2Int($sub_sub_sub_subelement[
'data']);
746 $track_entry[$sub_subelement[
'id_name']][$sub_sub_subelement[
'id_name']][$sub_sub_sub_subelement[
'id_name']] = $sub_sub_sub_subelement[
'data'];
750 $this->
unhandledElement(
'track.contentencodings.contentencoding.contentcompression', __LINE__, $sub_sub_sub_subelement);
757 $this->
unhandledElement(
'track.contentencodings.contentencoding', __LINE__, $sub_sub_subelement);
764 $this->
unhandledElement(
'track.contentencodings', __LINE__, $sub_subelement);
776 $info[
'matroska'][
'tracks'][
'tracks'][] = $track_entry;
787 $info_entry = array();
789 while ($this->
getEBMLelement($subelement, $element_data[
'end'],
true)) {
790 switch ($subelement[
'id']) {
802 $info_entry[$subelement[
'id_name'].
'_unix'] = self::EBMLdate2unix($info_entry[$subelement[
'id_name']]);
822 $info[
'matroska'][
'comments'][strtolower($subelement[
'id_name'])][] = $info_entry[$subelement[
'id_name']];
826 $chaptertranslate_entry = array();
828 while ($this->
getEBMLelement($sub_subelement, $subelement[
'end'],
true)) {
829 switch ($sub_subelement[
'id']) {
844 $this->
unhandledElement(
'info.chaptertranslate', __LINE__, $sub_subelement);
848 $info_entry[$subelement[
'id_name']] = $chaptertranslate_entry;
856 $info[
'matroska'][
'info'][] = $info_entry;
860 if (self::$hide_clusters) {
861 $this->current_offset = $element_data[
'end'];
864 $cues_entry = array();
866 while ($this->
getEBMLelement($subelement, $element_data[
'end'])) {
867 switch ($subelement[
'id']) {
870 $cuepoint_entry = array();
873 switch ($sub_subelement[
'id']) {
876 $cuetrackpositions_entry = array();
878 while ($this->
getEBMLelement($sub_sub_subelement, $sub_subelement[
'end'],
true)) {
879 switch ($sub_sub_subelement[
'id']) {
889 $this->
unhandledElement(
'cues.cuepoint.cuetrackpositions', __LINE__, $sub_sub_subelement);
893 $cuepoint_entry[$sub_subelement[
'id_name']][] = $cuetrackpositions_entry;
905 $cues_entry[] = $cuepoint_entry;
913 $info[
'matroska'][
'cues'] = $cues_entry;
917 $tags_entry = array();
919 while ($this->
getEBMLelement($subelement, $element_data[
'end'],
false)) {
920 switch ($subelement[
'id']) {
923 $tag_entry = array();
925 while ($this->
getEBMLelement($sub_subelement, $subelement[
'end'],
false)) {
926 switch ($sub_subelement[
'id']) {
929 $targets_entry = array();
931 while ($this->
getEBMLelement($sub_sub_subelement, $sub_subelement[
'end'],
true)) {
932 switch ($sub_sub_subelement[
'id']) {
936 $targets_entry[strtolower($sub_sub_subelement[
'id_name']).
'_long'] = self::TargetTypeValue($targets_entry[$sub_sub_subelement[
'id_name']]);
940 $targets_entry[$sub_sub_subelement[
'id_name']] = $sub_sub_subelement[
'data'];
955 $tag_entry[$sub_subelement[
'id_name']] = $targets_entry;
959 $tag_entry[$sub_subelement[
'id_name']][] = $this->
HandleEMBLSimpleTag($sub_subelement[
'end']);
967 $tags_entry[] = $tag_entry;
975 $info[
'matroska'][
'tags'] = $tags_entry;
980 while ($this->
getEBMLelement($subelement, $element_data[
'end'])) {
981 switch ($subelement[
'id']) {
984 $attachedfile_entry = array();
987 switch ($sub_subelement[
'id']) {
992 $attachedfile_entry[$sub_subelement[
'id_name']] = $sub_subelement[
'data'];
997 $attachedfile_entry[
'data_length'] = $sub_subelement[
'length'];
999 $attachedfile_entry[$sub_subelement[
'id_name']] = $this->
saveAttachment(
1000 $attachedfile_entry[
'FileName'],
1001 $attachedfile_entry[
'data_offset'],
1002 $attachedfile_entry[
'data_length']);
1004 $this->current_offset = $sub_subelement[
'end'];
1012 $this->
unhandledElement(
'attachments.attachedfile', __LINE__, $sub_subelement);
1016 $info[
'matroska'][
'attachments'][] = $attachedfile_entry;
1028 while ($this->
getEBMLelement($subelement, $element_data[
'end'])) {
1029 switch ($subelement[
'id']) {
1032 $editionentry_entry = array();
1035 switch ($sub_subelement[
'id']) {
1048 $chapteratom_entry = array();
1051 switch ($sub_sub_subelement[
'id']) {
1055 $chapteratom_entry[$sub_sub_subelement[
'id_name']] = $sub_sub_subelement[
'data'];
1070 $chaptertrack_entry = array();
1072 while ($this->
getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement[
'end'],
true)) {
1073 switch ($sub_sub_sub_subelement[
'id']) {
1080 $this->
unhandledElement(
'chapters.editionentry.chapteratom.chaptertrack', __LINE__, $sub_sub_sub_subelement);
1084 $chapteratom_entry[$sub_sub_subelement[
'id_name']][] = $chaptertrack_entry;
1088 $chapterdisplay_entry = array();
1090 while ($this->
getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement[
'end'],
true)) {
1091 switch ($sub_sub_sub_subelement[
'id']) {
1096 $chapterdisplay_entry[$sub_sub_sub_subelement[
'id_name']] = $sub_sub_sub_subelement[
'data'];
1100 $this->
unhandledElement(
'chapters.editionentry.chapteratom.chapterdisplay', __LINE__, $sub_sub_sub_subelement);
1104 $chapteratom_entry[$sub_sub_subelement[
'id_name']][] = $chapterdisplay_entry;
1108 $this->
unhandledElement(
'chapters.editionentry.chapteratom', __LINE__, $sub_sub_subelement);
1112 $editionentry_entry[$sub_subelement[
'id_name']][] = $chapteratom_entry;
1116 $this->
unhandledElement(
'chapters.editionentry', __LINE__, $sub_subelement);
1120 $info[
'matroska'][
'chapters'][] = $editionentry_entry;
1131 $cluster_entry = array();
1134 switch ($subelement[
'id']) {
1143 $cluster_silent_tracks = array();
1145 while ($this->
getEBMLelement($sub_subelement, $subelement[
'end'],
true)) {
1146 switch ($sub_subelement[
'id']) {
1153 $this->
unhandledElement(
'cluster.silenttracks', __LINE__, $sub_subelement);
1157 $cluster_entry[$subelement[
'id_name']][] = $cluster_silent_tracks;
1161 $cluster_block_group = array(
'offset' => $this->current_offset);
1164 switch ($sub_subelement[
'id']) {
1188 $cluster_entry[$subelement[
'id_name']][] = $cluster_block_group;
1199 $this->current_offset = $subelement[
'end'];
1201 if (!self::$hide_clusters) {
1202 $info[
'matroska'][
'cluster'][] = $cluster_entry;
1206 if (!self::$parse_whole_file) {
1207 if (isset(
$info[
'matroska'][
'info']) && is_array(
$info[
'matroska'][
'info'])) {
1208 if (isset(
$info[
'matroska'][
'tracks'][
'tracks']) && is_array(
$info[
'matroska'][
'tracks'][
'tracks'])) {
1209 if (count(
$info[
'matroska'][
'track_data_offsets']) == count(
$info[
'matroska'][
'tracks'][
'tracks'])) {
1232 if (($this->current_offset - $this->EBMLbuffer_offset) >= ($this->EBMLbuffer_length - $min_data)) {
1233 $read_bytes = max($min_data, $this->getid3->fread_buffer_size());
1236 $this->
fseek($this->current_offset);
1238 $this->EBMLbuffer = $this->
fread($read_bytes);
1239 $this->EBMLbuffer_length = strlen($this->EBMLbuffer);
1241 $this->
warning(
'EBML parser: '.$e->getMessage());
1245 if ($this->EBMLbuffer_length == 0 && $this->
feof()) {
1246 return $this->
error(
'EBML parser: ran out of file at offset '.$this->current_offset);
1256 $first_byte_int = ord($this->EBMLbuffer[$actual_offset]);
1257 if (0x80 & $first_byte_int) {
1259 } elseif (0x40 & $first_byte_int) {
1261 } elseif (0x20 & $first_byte_int) {
1263 } elseif (0x10 & $first_byte_int) {
1265 } elseif (0x08 & $first_byte_int) {
1267 } elseif (0x04 & $first_byte_int) {
1269 } elseif (0x02 & $first_byte_int) {
1271 } elseif (0x01 & $first_byte_int) {
1274 throw new Exception(
'invalid EBML integer (leading 0x00) at '.$this->current_offset);
1278 $int_value = self::EBML2Int(substr($this->EBMLbuffer, $actual_offset, $length));
1279 $this->current_offset += $length;
1288 $data = substr($this->EBMLbuffer, $this->current_offset - $this->EBMLbuffer_offset, $length);
1289 $this->current_offset += $length;
1294 if ($this->current_offset >= $parent_end) {
1299 $this->current_offset = PHP_INT_MAX;
1312 $element[
'id_name'] = self::EBMLidName($element[
'id']);
1318 $element[
'end'] = $this->current_offset + $element[
'length'];
1321 $dont_parse = (in_array($element[
'id'], $this->unuseful_elements) || $element[
'id_name'] == dechex($element[
'id']));
1322 if (($get_data ===
true || (is_array($get_data) && !in_array($element[
'id'], $get_data))) && !$dont_parse) {
1331 if (!in_array($element[
'id'], $this->unuseful_elements)) {
1332 $this->
warning(
'Unhandled '.
$type.
' element ['.basename(__FILE__).
':'.$line.
'] ('.$element[
'id'].
'::'.$element[
'id_name'].
' ['.$element[
'length'].
' bytes]) at '.$element[
'offset']);
1336 if (!isset($element[
'data'])) {
1337 $this->current_offset = $element[
'end'];
1342 if (!empty($SimpleTagArray[
'SimpleTag'])) {
1343 foreach ($SimpleTagArray[
'SimpleTag'] as $SimpleTagKey => $SimpleTagData) {
1344 if (!empty($SimpleTagData[
'TagName']) && !empty($SimpleTagData[
'TagString'])) {
1345 $this->getid3->info[
'matroska'][
'comments'][strtolower($SimpleTagData[
'TagName'])][] = $SimpleTagData[
'TagString'];
1347 if (!empty($SimpleTagData[
'SimpleTag'])) {
1357 $simpletag_entry = array();
1360 switch ($element[
'id']) {
1366 $simpletag_entry[$element[
'id_name']] = $element[
'data'];
1383 return $simpletag_entry;
1390 $block_data = array();
1391 $block_data[
'tracknumber'] = $this->
readEBMLint();
1396 $block_data[
'flags'][
'keyframe'] = (($block_data[
'flags_raw'] & 0x80) >> 7);
1402 $block_data[
'flags'][
'invisible'] = (bool)(($block_data[
'flags_raw'] & 0x08) >> 3);
1403 $block_data[
'flags'][
'lacing'] = (($block_data[
'flags_raw'] & 0x06) >> 1);
1405 $block_data[
'flags'][
'discardable'] = (($block_data[
'flags_raw'] & 0x01));
1410 $block_data[
'flags'][
'lacing_type'] = self::BlockLacingType($block_data[
'flags'][
'lacing']);
1413 if ($block_data[
'flags'][
'lacing'] > 0) {
1415 if ($block_data[
'flags'][
'lacing'] != 0x02) {
1416 for (
$i = 1;
$i < $block_data[
'lace_frames'];
$i ++) {
1417 if ($block_data[
'flags'][
'lacing'] == 0x03) {
1421 $block_data[
'lace_frames_size'][
$i] = 0;
1424 $block_data[
'lace_frames_size'][
$i] +=
$size;
1426 while (
$size == 255);
1429 if ($block_data[
'flags'][
'lacing'] == 0x01) {
1430 $block_data[
'lace_frames_size'][] = $element[
'end'] - $this->current_offset - array_sum($block_data[
'lace_frames_size']);
1435 if (!isset(
$info[
'matroska'][
'track_data_offsets'][$block_data[
'tracknumber']])) {
1444 $this->current_offset = $element[
'end'];
1469 $first_byte_int = ord($EBMLstring[0]);
1470 if (0x80 & $first_byte_int) {
1471 $EBMLstring[0] = chr($first_byte_int & 0x7F);
1472 } elseif (0x40 & $first_byte_int) {
1473 $EBMLstring[0] = chr($first_byte_int & 0x3F);
1474 } elseif (0x20 & $first_byte_int) {
1475 $EBMLstring[0] = chr($first_byte_int & 0x1F);
1476 } elseif (0x10 & $first_byte_int) {
1477 $EBMLstring[0] = chr($first_byte_int & 0x0F);
1478 } elseif (0x08 & $first_byte_int) {
1479 $EBMLstring[0] = chr($first_byte_int & 0x07);
1480 } elseif (0x04 & $first_byte_int) {
1481 $EBMLstring[0] = chr($first_byte_int & 0x03);
1482 } elseif (0x02 & $first_byte_int) {
1483 $EBMLstring[0] = chr($first_byte_int & 0x01);
1484 } elseif (0x01 & $first_byte_int) {
1485 $EBMLstring[0] = chr($first_byte_int & 0x00);
1494 return round(($EBMLdatestamp / 1000000000) + 978307200);
1499 static $TargetTypeValue = array();
1500 if (empty($TargetTypeValue)) {
1501 $TargetTypeValue[10] =
'A: ~ V:shot';
1502 $TargetTypeValue[20] =
'A:subtrack/part/movement ~ V:scene';
1503 $TargetTypeValue[30] =
'A:track/song ~ V:chapter';
1504 $TargetTypeValue[40] =
'A:part/session ~ V:part/session';
1505 $TargetTypeValue[50] =
'A:album/opera/concert ~ V:movie/episode/concert';
1506 $TargetTypeValue[60] =
'A:edition/issue/volume/opus ~ V:season/sequel/volume';
1507 $TargetTypeValue[70] =
'A:collection ~ V:collection';
1509 return (isset($TargetTypeValue[
$target_type]) ? $TargetTypeValue[$target_type] : $target_type);
1514 static $BlockLacingType = array();
1515 if (empty($BlockLacingType)) {
1516 $BlockLacingType[0x00] =
'no lacing';
1517 $BlockLacingType[0x01] =
'Xiph lacing';
1518 $BlockLacingType[0x02] =
'fixed-size lacing';
1519 $BlockLacingType[0x03] =
'EBML lacing';
1521 return (isset($BlockLacingType[$lacingtype]) ? $BlockLacingType[$lacingtype] : $lacingtype);
1526 static $CodecIDlist = array();
1527 if (empty($CodecIDlist)) {
1528 $CodecIDlist[
'A_AAC'] =
'aac';
1529 $CodecIDlist[
'A_AAC/MPEG2/LC'] =
'aac';
1530 $CodecIDlist[
'A_AC3'] =
'ac3';
1531 $CodecIDlist[
'A_EAC3'] =
'eac3';
1532 $CodecIDlist[
'A_DTS'] =
'dts';
1533 $CodecIDlist[
'A_FLAC'] =
'flac';
1534 $CodecIDlist[
'A_MPEG/L1'] =
'mp1';
1535 $CodecIDlist[
'A_MPEG/L2'] =
'mp2';
1536 $CodecIDlist[
'A_MPEG/L3'] =
'mp3';
1537 $CodecIDlist[
'A_PCM/INT/LIT'] =
'pcm';
1538 $CodecIDlist[
'A_PCM/INT/BIG'] =
'pcm';
1539 $CodecIDlist[
'A_QUICKTIME/QDMC'] =
'quicktime';
1540 $CodecIDlist[
'A_QUICKTIME/QDM2'] =
'quicktime';
1541 $CodecIDlist[
'A_VORBIS'] =
'vorbis';
1542 $CodecIDlist[
'V_MPEG1'] =
'mpeg';
1543 $CodecIDlist[
'V_THEORA'] =
'theora';
1544 $CodecIDlist[
'V_REAL/RV40'] =
'real';
1545 $CodecIDlist[
'V_REAL/RV10'] =
'real';
1546 $CodecIDlist[
'V_REAL/RV20'] =
'real';
1547 $CodecIDlist[
'V_REAL/RV30'] =
'real';
1548 $CodecIDlist[
'V_QUICKTIME'] =
'quicktime';
1549 $CodecIDlist[
'V_MPEG4/ISO/AP'] =
'mpeg4';
1550 $CodecIDlist[
'V_MPEG4/ISO/ASP'] =
'mpeg4';
1551 $CodecIDlist[
'V_MPEG4/ISO/AVC'] =
'h264';
1552 $CodecIDlist[
'V_MPEG4/ISO/SP'] =
'mpeg4';
1553 $CodecIDlist[
'V_VP8'] =
'vp8';
1554 $CodecIDlist[
'V_MS/VFW/FOURCC'] =
'vcm';
1555 $CodecIDlist[
'A_MS/ACM'] =
'acm';
1557 return (isset($CodecIDlist[$codecid]) ? $CodecIDlist[$codecid] : $codecid);
1561 static $EBMLidList = array();
1562 if (empty($EBMLidList)) {
1755 return (isset($EBMLidList[$value]) ? $EBMLidList[$value] : dechex($value));
1760 static $units = array(
1764 3 =>
'Display Aspect Ratio');
1766 return (isset($units[$value]) ? $units[$value] :
'unknown');
1771 foreach (array_reverse($streams) as
$stream) {
1772 if ($stream[
'default']) {
1777 $unset = array(
'default',
'name');
1778 foreach ($unset as $u) {
1779 if (isset($stream[$u])) {
1785 $info[
'streams'] = $streams;
const EBML_ID_CONTENTSIGALGO
const EBML_ID_CUECLUSTERPOSITION
const EBML_ID_CLUSTERCODECSTATE
const EBML_ID_TRACKNUMBER
const EBML_ID_CLUSTERPREVSIZE
const EBML_ID_CHAPPROCESSCODECID
const EBML_ID_CONTENTSIGNATURE
const EBML_ID_DISPLAYUNIT
const EBML_ID_TARGETTYPEVALUE
const EBML_ID_CLUSTERDURATION
const EBML_ID_CHAPTERDISPLAY
const EBML_ID_SAMPLINGFREQUENCY
const EBML_ID_ATTACHMENTLINK
const EBML_ID_CONTENTENCODING
const EBML_ID_ASPECTRATIOTYPE
const EBML_ID_CHAPTERTRANSLATEID
const EBML_ID_CLUSTERBLOCKADDITIONAL
const EBML_ID_CHAPTERFLAGENABLED
const EBML_ID_COLOURSPACE
const EBML_ID_CONTENTENCODINGSCOPE
const EBML_ID_CLUSTERSILENTTRACKS
const EBML_ID_CHAPPROCESSPRIVATE
const EBML_ID_ATTACHEDFILE
const EBML_ID_TRACKOVERLAY
static ParseBITMAPINFOHEADER($BITMAPINFOHEADER, $littleEndian=true)
const EBML_ID_CONTENTENCKEYID
const EBML_ID_EDITIONENTRY
const EBML_ID_CODECPRIVATE
const EBML_ID_CLUSTERSIMPLEBLOCK
const EBML_ID_CONTENTENCODINGORDER
const EBML_ID_SEEKPOSITION
const EBML_ID_CUEREFERENCE
const EBML_ID_CONTENTCOMPALGO
const EBML_ID_TRACKTRANSLATECODEC
const EBML_ID_CHAPLANGUAGE
HandleEMBLClusterBlock($element, $block_type, &$info)
const EBML_ID_CONTENTENCODINGTYPE
const EBML_ID_FILEREFERRAL
const EBML_ID_CLUSTERREFERENCEVIRTUAL
const EBML_ID_CHAPPROCESSCOMMAND
const EBML_ID_CODECDOWNLOADURL
const EBML_ID_PIXELHEIGHT
const EBML_ID_FLAGENABLED
const EBML_ID_CLUSTERENCRYPTEDBLOCK
const EBML_ID_CLUSTERBLOCKADDID
saveAttachment($name, $offset, $length, $image_mime=null)
static parseWAVEFORMATex($WaveFormatExData)
const EBML_ID_CONTENTSIGHASHALGO
const EBML_ID_PIXELCROPRIGHT
const EBML_ID_CLUSTERBLOCK
const EBML_ID_NEXTFILENAME
const EBML_ID_TAGEDITIONUID
static EBMLdate2unix($EBMLdatestamp)
const EBML_ID_CHAPTERTRACKNUMBER
const EBML_ID_CHAPTERPHYSICALEQUIV
const EBML_ID_EDITIONFLAGHIDDEN
$stream
PHP stream implementation.
const EBML_ID_CUETRACKPOSITIONS
const EBML_ID_CUEREFNUMBER
static EBMLidName($value)
static IncludeDependency($filename, $sourcefile, $DieOnFailure=false)
const EBML_ID_DEFAULTDURATION
const EBML_ID_CHAPTERSEGMENTUID
static fourccLookup($fourcc)
getEBMLelement(&$element, $parent_end, $get_data=false)
const EBML_ID_CHAPTERFLAGHIDDEN
const EBML_ID_CHAPTERTIMESTART
const EBML_ID_DISPLAYWIDTH
const EBML_ID_TAGCHAPTERUID
const EBML_ID_CODECSETTINGS
const EBML_ID_CHAPCOUNTRY
static BigEndian2Float($byteword)
const EBML_ID_CHAPTERTIMEEND
const EBML_ID_EDITIONFLAGDEFAULT
const EBML_ID_CLUSTERSLICES
const EBML_ID_CHANNELPOSITIONS
const EBML_ID_EBMLVERSION
const EBML_ID_OUTPUTSAMPLINGFREQUENCY
static EBML2Int($EBMLstring)
const EBML_ID_CLUSTERTIMESLICE
const EBML_ID_CODECINFOURL
const EBML_ID_EDITIONFLAGORDERED
const EBML_ID_CLUSTERFRAMENUMBER
const EBML_ID_CONTENTENCODINGS
const EBML_ID_CLUSTERSILENTTRACKNUMBER
const EBML_ID_ATTACHMENTS
static trimNullByte($string)
const EBML_ID_CLUSTERREFERENCEPRIORITY
const EBML_ID_CONTENTCOMPSETTINGS
const EBML_ID_CHAPPROCESS
EnsureBufferHasEnoughData($min_data=1024)
const EBML_ID_CLUSTERBLOCKGROUP
http://www.matroska.org/technical/specs/index.html
const EBML_ID_PIXELCROPTOP
const EBML_ID_SEGMENTFILENAME
const EBML_ID_TAGTRACKUID
static BlockLacingType($lacingtype)
readEBMLelementData($length, $check_buffer=false)
const EBML_ID_CUEREFCLUSTER
const EBML_ID_TRACKTRANSLATEEDITIONUID
const EBML_ID_CHAPTERTRANSLATE
HandleEMBLSimpleTag($parent_end)
const EBML_ID_TRACKTIMECODESCALE
const EBML_ID_CONTENTCOMPRESSION
const EBML_ID_CHAPTERSEGMENTEDITIONUID
static getDefaultStreamInfo($streams)
const EBML_ID_CHAPPROCESSTIME
const EBML_ID_PIXELCROPBOTTOM
const EBML_ID_CLUSTERLACENUMBER
const EBML_ID_CLUSTERPOSITION
const EBML_ID_EBMLMAXIDLENGTH
static TargetTypeValue($target_type)
static CodecIDtoCommonName($codecid)
const EBML_ID_CHAPTERTRANSLATECODEC
const EBML_ID_TRACKTRANSLATETRACKID
const EBML_ID_TRACKTRANSLATE
const EBML_ID_TAGLANGUAGE
const EBML_ID_CHAPTERTRANSLATEEDITIONUID
const EBML_ID_CONTENTSIGKEYID
const EBML_ID_CODECDECODEALL
const EBML_ID_EBMLMAXSIZELENGTH
const EBML_ID_FLAGINTERLACED
const EBML_ID_DISPLAYHEIGHT
const EBML_ID_CHAPTERATOM
const EBML_ID_FILEDESCRIPTION
const EBML_ID_TAGATTACHMENTUID
const EBML_ID_CHAPPROCESSDATA
const EBML_ID_FLAGDEFAULT
const EBML_ID_CLUSTERBLOCKVIRTUAL
const EBML_ID_CUEBLOCKNUMBER
const EBML_ID_CLUSTERBLOCKADDITIONID
const EBML_ID_EBMLREADVERSION
unhandledElement($type, $line, $element)
const EBML_ID_CLUSTERREFERENCEBLOCK
const EBML_ID_DOCTYPEVERSION
const EBML_ID_PREVFILENAME
const EBML_ID_TIMECODESCALE
fseek($bytes, $whence=SEEK_SET)
const EBML_ID_SEGMENTFAMILY
ExtractCommentsSimpleTag($SimpleTagArray)
const EBML_ID_TRACKOFFSET
const EBML_ID_CLUSTERBLOCKADDITIONS
const EBML_ID_DOCTYPEREADVERSION
const EBML_ID_CUECODECSTATE
const EBML_ID_CUEREFCODECSTATE
const EBML_ID_CHAPTERTRACK
const EBML_ID_PIXELCROPLEFT
const EBML_ID_CONTENTENCRYPTION
const EBML_ID_FILEMIMETYPE
static displayUnit($value)
static BigEndian2Int($byteword, $synchsafe=false, $signed=false)
const EBML_ID_CONTENTENCALGO
const EBML_ID_MAXBLOCKADDITIONID
const EBML_ID_CLUSTERBLOCKDURATION
const EBML_ID_CHAPTERS
getID3() by James Heinrich info@getid3.org //
const EBML_ID_CLUSTERTIMECODE
const EBML_ID_OLDSTEREOMODE
const EBML_ID_CLUSTERDELAY
const EBML_ID_CLUSTERBLOCKMORE