22 $info = &$this->getid3->info;
25 $TSheader = $this->
fread(19);
27 if (substr($TSheader, 0, 1) != $magic) {
31 $info[
'fileformat'] =
'ts';
39 $info[
'ts'][
'packet'][
'flags'][
'transport_error_indicator'] = (bool) ($pid_flags_raw & 0x8000);
40 $info[
'ts'][
'packet'][
'flags'][
'payload_unit_start_indicator'] = (bool) ($pid_flags_raw & 0x4000);
41 $info[
'ts'][
'packet'][
'flags'][
'transport_high_priority'] = (bool) ($pid_flags_raw & 0x2000);
42 $info[
'ts'][
'packet'][
'packet_id'] = ($pid_flags_raw & 0x1FFF) >> 0;
44 $info[
'ts'][
'packet'][
'raw'][
'scrambling_control'] = ($SAC_raw & 0xC0) >> 6;
45 $info[
'ts'][
'packet'][
'flags'][
'adaption_field_exists'] = (bool) ($SAC_raw & 0x20);
46 $info[
'ts'][
'packet'][
'flags'][
'payload_exists'] = (bool) ($SAC_raw & 0x10);
47 $info[
'ts'][
'packet'][
'continuity_counter'] = ($SAC_raw & 0x0F) >> 0;
50 if (
$info[
'ts'][
'packet'][
'flags'][
'adaption_field_exists']) {
52 $info[
'ts'][
'packet'][
'adaption'][
'field_length'] = ($AdaptionField_raw & 0xFF00) >> 8;
53 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'discontinuity'] = (bool) ($AdaptionField_raw & 0x0080);
54 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'random_access'] = (bool) ($AdaptionField_raw & 0x0040);
55 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'high_priority'] = (bool) ($AdaptionField_raw & 0x0020);
56 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'pcr'] = (bool) ($AdaptionField_raw & 0x0010);
57 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'opcr'] = (bool) ($AdaptionField_raw & 0x0008);
58 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'splice_point'] = (bool) ($AdaptionField_raw & 0x0004);
59 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'private_data'] = (bool) ($AdaptionField_raw & 0x0002);
60 $info[
'ts'][
'packet'][
'adaption'][
'flags'][
'extension'] = (bool) ($AdaptionField_raw & 0x0001);
61 if (
$info[
'ts'][
'packet'][
'adaption'][
'flags'][
'pcr']) {
64 if (
$info[
'ts'][
'packet'][
'adaption'][
'flags'][
'opcr']) {
69 $this->
error(
'MPEG Transport Stream (.ts) parsing not enabled in this version of getID3() ['.$this->getid3->version().
']');
76 $TSscramblingControlLookup = array(0x00=>
'not scrambled', 0x01=>
'reserved', 0x02=>
'scrambled, even key', 0x03=>
'scrambled, odd key');
77 return (isset($TSscramblingControlLookup[$raw]) ? $TSscramblingControlLookup[$raw] :
'invalid');
static PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8')
getID3() by James Heinrich info@getid3.org //
fseek($bytes, $whence=SEEK_SET)
static BigEndian2Int($byteword, $synchsafe=false, $signed=false)
TSscramblingControlLookup($raw)