38 $info = &$this->getid3->info;
40 fseek($this->getid3->fp,
$info[
'avdataoffset'], SEEK_SET);
41 $TSheader =
fread($this->getid3->fp, 19);
43 if (substr($TSheader, 0, 1) != $magic) {
44 $info[
'error'][] =
'Expecting "'.Helper::PrintHexBytes($magic).
'" at '.
$info[
'avdataoffset'].
', found '.
Helper::PrintHexBytes(substr($TSheader, 0, 1)).
' instead.';
48 $info[
'fileformat'] =
'ts';
56 $info[
'ts'][
'packet'][
'flags'][
'transport_error_indicator'] = (bool) ($pid_flags_raw & 0x8000);
57 $info[
'ts'][
'packet'][
'flags'][
'payload_unit_start_indicator'] = (bool) ($pid_flags_raw & 0x4000);
58 $info[
'ts'][
'packet'][
'flags'][
'transport_high_priority'] = (bool) ($pid_flags_raw & 0x2000);
59 $info[
'ts'][
'packet'][
'packet_id'] = ($pid_flags_raw & 0x1FFF) >> 0;
61 $info[
'ts'][
'packet'][
'raw'][
'scrambling_control'] = ($SAC_raw & 0xC0) >> 6;
62 $info[
'ts'][
'packet'][
'flags'][
'adaption_field_exists'] = (bool) ($SAC_raw & 0x20);
63 $info[
'ts'][
'packet'][
'flags'][
'payload_exists'] = (bool) ($SAC_raw & 0x10);
64 $info[
'ts'][
'packet'][
'continuity_counter'] = ($SAC_raw & 0x0F) >> 0;
67 if (
$info[
'ts'][
'packet'][
'flags'][
'adaption_field_exists']) {
69 $info[
'ts'][
'packet'][
'adaption'][
'field_length'] = ($AdaptionField_raw & 0xFF00) >> 8;
70 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'discontinuity'] = (bool) ($AdaptionField_raw & 0x0080);
71 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'random_access'] = (bool) ($AdaptionField_raw & 0x0040);
72 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'high_priority'] = (bool) ($AdaptionField_raw & 0x0020);
73 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'pcr'] = (bool) ($AdaptionField_raw & 0x0010);
74 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'opcr'] = (bool) ($AdaptionField_raw & 0x0008);
75 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'splice_point'] = (bool) ($AdaptionField_raw & 0x0004);
76 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'private_data'] = (bool) ($AdaptionField_raw & 0x0002);
77 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'extension'] = (bool) ($AdaptionField_raw & 0x0001);
78 if (
$info[
'ts'][
'packet'][
'adaption'][
'flags'][
'pcr']) {
81 if (
$info[
'ts'][
'packet'][
'adaption'][
'flags'][
'opcr']) {
86 $info[
'error'][] =
'MPEG Transport Stream (.ts) parsing not enabled in this version of GetId3Core() ['.$this->getid3->version().
']';
99 $TSscramblingControlLookup =
array(0x00=>
'not scrambled', 0x01=>
'reserved', 0x02=>
'scrambled, even key', 0x03=>
'scrambled, odd key');
101 return (isset($TSscramblingControlLookup[$raw]) ? $TSscramblingControlLookup[$raw] :
'invalid');
static PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8')
GetId3() by James Heinrich info@getid3.org //.
GetId3() by James Heinrich info@getid3.org //.
fseek($bytes, $whence=SEEK_SET)
TSscramblingControlLookup($raw)
Create styles array
The data for the language used.
static BigEndian2Int($byteword, $synchsafe=false, $signed=false)