Edit File by line

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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-inclu.../ID3
File: module.audio-video.quicktime.php
$this->fseek($previous_offset);
[2000] Fix | Delete
[2001] Fix | Delete
} else {
[2002] Fix | Delete
$this->warning('QuickTime atom "'.$atomname.'" is not mod-8 bytes long ('.$atomsize.' bytes) at offset '.$baseoffset);
[2003] Fix | Delete
}
[2004] Fix | Delete
} else {
[2005] Fix | Delete
$this->warning('QuickTime atom "'.$atomname.'" is zero bytes long at offset '.$baseoffset);
[2006] Fix | Delete
}
[2007] Fix | Delete
break;
[2008] Fix | Delete
[2009] Fix | Delete
case 'loci':// 3GP location (El Loco)
[2010] Fix | Delete
$loffset = 0;
[2011] Fix | Delete
$info['quicktime']['comments']['gps_flags'] = array( getid3_lib::BigEndian2Int(substr($atom_data, 0, 4)));
[2012] Fix | Delete
$info['quicktime']['comments']['gps_lang'] = array( getid3_lib::BigEndian2Int(substr($atom_data, 4, 2)));
[2013] Fix | Delete
$info['quicktime']['comments']['gps_location'] = array( $this->LociString(substr($atom_data, 6), $loffset));
[2014] Fix | Delete
$loci_data = substr($atom_data, 6 + $loffset);
[2015] Fix | Delete
$info['quicktime']['comments']['gps_role'] = array( getid3_lib::BigEndian2Int(substr($loci_data, 0, 1)));
[2016] Fix | Delete
$info['quicktime']['comments']['gps_longitude'] = array(getid3_lib::FixedPoint16_16(substr($loci_data, 1, 4)));
[2017] Fix | Delete
$info['quicktime']['comments']['gps_latitude'] = array(getid3_lib::FixedPoint16_16(substr($loci_data, 5, 4)));
[2018] Fix | Delete
$info['quicktime']['comments']['gps_altitude'] = array(getid3_lib::FixedPoint16_16(substr($loci_data, 9, 4)));
[2019] Fix | Delete
$info['quicktime']['comments']['gps_body'] = array( $this->LociString(substr($loci_data, 13 ), $loffset));
[2020] Fix | Delete
$info['quicktime']['comments']['gps_notes'] = array( $this->LociString(substr($loci_data, 13 + $loffset), $loffset));
[2021] Fix | Delete
break;
[2022] Fix | Delete
[2023] Fix | Delete
case 'chpl': // CHaPter List
[2024] Fix | Delete
// https://www.adobe.com/content/dam/Adobe/en/devnet/flv/pdfs/video_file_format_spec_v10.pdf
[2025] Fix | Delete
$chpl_version = getid3_lib::BigEndian2Int(substr($atom_data, 4, 1)); // Expected to be 0
[2026] Fix | Delete
$chpl_flags = getid3_lib::BigEndian2Int(substr($atom_data, 5, 3)); // Reserved, set to 0
[2027] Fix | Delete
$chpl_count = getid3_lib::BigEndian2Int(substr($atom_data, 8, 1));
[2028] Fix | Delete
$chpl_offset = 9;
[2029] Fix | Delete
for ($i = 0; $i < $chpl_count; $i++) {
[2030] Fix | Delete
if (($chpl_offset + 9) >= strlen($atom_data)) {
[2031] Fix | Delete
$this->warning('QuickTime chapter '.$i.' extends beyond end of "chpl" atom');
[2032] Fix | Delete
break;
[2033] Fix | Delete
}
[2034] Fix | Delete
$info['quicktime']['chapters'][$i]['timestamp'] = getid3_lib::BigEndian2Int(substr($atom_data, $chpl_offset, 8)) / 10000000; // timestamps are stored as 100-nanosecond units
[2035] Fix | Delete
$chpl_offset += 8;
[2036] Fix | Delete
$chpl_title_size = getid3_lib::BigEndian2Int(substr($atom_data, $chpl_offset, 1));
[2037] Fix | Delete
$chpl_offset += 1;
[2038] Fix | Delete
$info['quicktime']['chapters'][$i]['title'] = substr($atom_data, $chpl_offset, $chpl_title_size);
[2039] Fix | Delete
$chpl_offset += $chpl_title_size;
[2040] Fix | Delete
}
[2041] Fix | Delete
break;
[2042] Fix | Delete
[2043] Fix | Delete
case 'FIRM': // FIRMware version(?), seen on GoPro Hero4
[2044] Fix | Delete
$info['quicktime']['camera']['firmware'] = $atom_data;
[2045] Fix | Delete
break;
[2046] Fix | Delete
[2047] Fix | Delete
case 'CAME': // FIRMware version(?), seen on GoPro Hero4
[2048] Fix | Delete
$info['quicktime']['camera']['serial_hash'] = unpack('H*', $atom_data);
[2049] Fix | Delete
break;
[2050] Fix | Delete
[2051] Fix | Delete
case 'dscp':
[2052] Fix | Delete
case 'rcif':
[2053] Fix | Delete
// https://www.getid3.org/phpBB3/viewtopic.php?t=1908
[2054] Fix | Delete
if (substr($atom_data, 0, 7) == "\x00\x00\x00\x00\x55\xC4".'{') {
[2055] Fix | Delete
if ($json_decoded = @json_decode(rtrim(substr($atom_data, 6), "\x00"), true)) {
[2056] Fix | Delete
$info['quicktime']['camera'][$atomname] = $json_decoded;
[2057] Fix | Delete
if (($atomname == 'rcif') && isset($info['quicktime']['camera']['rcif']['wxcamera']['rotate'])) {
[2058] Fix | Delete
$info['video']['rotate'] = $info['quicktime']['video']['rotate'] = $info['quicktime']['camera']['rcif']['wxcamera']['rotate'];
[2059] Fix | Delete
}
[2060] Fix | Delete
} else {
[2061] Fix | Delete
$this->warning('Failed to JSON decode atom "'.$atomname.'"');
[2062] Fix | Delete
$atom_structure['data'] = $atom_data;
[2063] Fix | Delete
}
[2064] Fix | Delete
unset($json_decoded);
[2065] Fix | Delete
} else {
[2066] Fix | Delete
$this->warning('Expecting 55 C4 7B at start of atom "'.$atomname.'", found '.getid3_lib::PrintHexBytes(substr($atom_data, 4, 3)).' instead');
[2067] Fix | Delete
$atom_structure['data'] = $atom_data;
[2068] Fix | Delete
}
[2069] Fix | Delete
break;
[2070] Fix | Delete
[2071] Fix | Delete
case 'frea':
[2072] Fix | Delete
// https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Kodak.html#frea
[2073] Fix | Delete
// may contain "scra" (PreviewImage) and/or "thma" (ThumbnailImage)
[2074] Fix | Delete
$atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 4, $atomHierarchy, $ParseAllPossibleAtoms);
[2075] Fix | Delete
break;
[2076] Fix | Delete
case 'tima': // subatom to "frea"
[2077] Fix | Delete
// no idea what this does, the one sample file I've seen has a value of 0x00000027
[2078] Fix | Delete
$atom_structure['data'] = $atom_data;
[2079] Fix | Delete
break;
[2080] Fix | Delete
case 'ver ': // subatom to "frea"
[2081] Fix | Delete
// some kind of version number, the one sample file I've seen has a value of "3.00.073"
[2082] Fix | Delete
$atom_structure['data'] = $atom_data;
[2083] Fix | Delete
break;
[2084] Fix | Delete
case 'thma': // subatom to "frea" -- "ThumbnailImage"
[2085] Fix | Delete
// https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Kodak.html#frea
[2086] Fix | Delete
if (strlen($atom_data) > 0) {
[2087] Fix | Delete
$info['quicktime']['comments']['picture'][] = array('data'=>$atom_data, 'image_mime'=>'image/jpeg', 'description'=>'ThumbnailImage');
[2088] Fix | Delete
}
[2089] Fix | Delete
break;
[2090] Fix | Delete
case 'scra': // subatom to "frea" -- "PreviewImage"
[2091] Fix | Delete
// https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Kodak.html#frea
[2092] Fix | Delete
// but the only sample file I've seen has no useful data here
[2093] Fix | Delete
if (strlen($atom_data) > 0) {
[2094] Fix | Delete
$info['quicktime']['comments']['picture'][] = array('data'=>$atom_data, 'image_mime'=>'image/jpeg', 'description'=>'PreviewImage');
[2095] Fix | Delete
}
[2096] Fix | Delete
break;
[2097] Fix | Delete
[2098] Fix | Delete
case 'cdsc': // timed metadata reference
[2099] Fix | Delete
// A QuickTime movie can contain none, one, or several timed metadata tracks. Timed metadata tracks can refer to multiple tracks.
[2100] Fix | Delete
// Metadata tracks are linked to the tracks they describe using a track-reference of type 'cdsc'. The metadata track holds the 'cdsc' track reference.
[2101] Fix | Delete
$atom_structure['track_number'] = getid3_lib::BigEndian2Int($atom_data);
[2102] Fix | Delete
break;
[2103] Fix | Delete
[2104] Fix | Delete
[2105] Fix | Delete
case 'esds': // Elementary Stream DeScriptor
[2106] Fix | Delete
// https://github.com/JamesHeinrich/getID3/issues/414
[2107] Fix | Delete
// https://chromium.googlesource.com/chromium/src/media/+/refs/heads/main/formats/mp4/es_descriptor.cc
[2108] Fix | Delete
// https://chromium.googlesource.com/chromium/src/media/+/refs/heads/main/formats/mp4/es_descriptor.h
[2109] Fix | Delete
$atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); // hardcoded: 0x00
[2110] Fix | Delete
$atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data, 1, 3)); // hardcoded: 0x000000
[2111] Fix | Delete
$esds_offset = 4;
[2112] Fix | Delete
[2113] Fix | Delete
$atom_structure['ES_DescrTag'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 1));
[2114] Fix | Delete
$esds_offset += 1;
[2115] Fix | Delete
if ($atom_structure['ES_DescrTag'] != 0x03) {
[2116] Fix | Delete
$this->warning('expecting esds.ES_DescrTag = 0x03, found 0x'.getid3_lib::PrintHexBytes($atom_structure['ES_DescrTag']).'), at offset '.$atom_structure['offset']);
[2117] Fix | Delete
break;
[2118] Fix | Delete
}
[2119] Fix | Delete
$atom_structure['ES_DescrSize'] = $this->quicktime_read_mp4_descr_length($atom_data, $esds_offset);
[2120] Fix | Delete
[2121] Fix | Delete
$atom_structure['ES_ID'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 2));
[2122] Fix | Delete
$esds_offset += 2;
[2123] Fix | Delete
$atom_structure['ES_flagsraw'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 1));
[2124] Fix | Delete
$esds_offset += 1;
[2125] Fix | Delete
$atom_structure['ES_flags']['stream_dependency'] = (bool) ($atom_structure['ES_flagsraw'] & 0x80);
[2126] Fix | Delete
$atom_structure['ES_flags']['url_flag'] = (bool) ($atom_structure['ES_flagsraw'] & 0x40);
[2127] Fix | Delete
$atom_structure['ES_flags']['ocr_stream'] = (bool) ($atom_structure['ES_flagsraw'] & 0x20);
[2128] Fix | Delete
$atom_structure['ES_stream_priority'] = ($atom_structure['ES_flagsraw'] & 0x1F);
[2129] Fix | Delete
if ($atom_structure['ES_flags']['url_flag']) {
[2130] Fix | Delete
$this->warning('Unsupported esds.url_flag enabled at offset '.$atom_structure['offset']);
[2131] Fix | Delete
break;
[2132] Fix | Delete
}
[2133] Fix | Delete
if ($atom_structure['ES_flags']['stream_dependency']) {
[2134] Fix | Delete
$atom_structure['ES_dependsOn_ES_ID'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 2));
[2135] Fix | Delete
$esds_offset += 2;
[2136] Fix | Delete
}
[2137] Fix | Delete
if ($atom_structure['ES_flags']['ocr_stream']) {
[2138] Fix | Delete
$atom_structure['ES_OCR_ES_Id'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 2));
[2139] Fix | Delete
$esds_offset += 2;
[2140] Fix | Delete
}
[2141] Fix | Delete
[2142] Fix | Delete
$atom_structure['ES_DecoderConfigDescrTag'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 1));
[2143] Fix | Delete
$esds_offset += 1;
[2144] Fix | Delete
if ($atom_structure['ES_DecoderConfigDescrTag'] != 0x04) {
[2145] Fix | Delete
$this->warning('expecting esds.ES_DecoderConfigDescrTag = 0x04, found 0x'.getid3_lib::PrintHexBytes($atom_structure['ES_DecoderConfigDescrTag']).'), at offset '.$atom_structure['offset']);
[2146] Fix | Delete
break;
[2147] Fix | Delete
}
[2148] Fix | Delete
$atom_structure['ES_DecoderConfigDescrTagSize'] = $this->quicktime_read_mp4_descr_length($atom_data, $esds_offset);
[2149] Fix | Delete
[2150] Fix | Delete
$atom_structure['ES_objectTypeIndication'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 1));
[2151] Fix | Delete
$esds_offset += 1;
[2152] Fix | Delete
// https://stackoverflow.com/questions/3987850
[2153] Fix | Delete
// 0x40 = "Audio ISO/IEC 14496-3" = MPEG-4 Audio
[2154] Fix | Delete
// 0x67 = "Audio ISO/IEC 13818-7 LowComplexity Profile" = MPEG-2 AAC LC
[2155] Fix | Delete
// 0x69 = "Audio ISO/IEC 13818-3" = MPEG-2 Backward Compatible Audio (MPEG-2 Layers 1, 2, and 3)
[2156] Fix | Delete
// 0x6B = "Audio ISO/IEC 11172-3" = MPEG-1 Audio (MPEG-1 Layers 1, 2, and 3)
[2157] Fix | Delete
[2158] Fix | Delete
$streamTypePlusFlags = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 1));
[2159] Fix | Delete
$esds_offset += 1;
[2160] Fix | Delete
$atom_structure['ES_streamType'] = ($streamTypePlusFlags & 0xFC) >> 2;
[2161] Fix | Delete
$atom_structure['ES_upStream'] = (bool) ($streamTypePlusFlags & 0x02) >> 1;
[2162] Fix | Delete
$atom_structure['ES_bufferSizeDB'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 3));
[2163] Fix | Delete
$esds_offset += 3;
[2164] Fix | Delete
$atom_structure['ES_maxBitrate'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 4));
[2165] Fix | Delete
$esds_offset += 4;
[2166] Fix | Delete
$atom_structure['ES_avgBitrate'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 4));
[2167] Fix | Delete
$esds_offset += 4;
[2168] Fix | Delete
if ($atom_structure['ES_avgBitrate']) {
[2169] Fix | Delete
$info['quicktime']['audio']['bitrate'] = $atom_structure['ES_avgBitrate'];
[2170] Fix | Delete
$info['audio']['bitrate'] = $atom_structure['ES_avgBitrate'];
[2171] Fix | Delete
}
[2172] Fix | Delete
[2173] Fix | Delete
$atom_structure['ES_DecSpecificInfoTag'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 1));
[2174] Fix | Delete
$esds_offset += 1;
[2175] Fix | Delete
if ($atom_structure['ES_DecSpecificInfoTag'] != 0x05) {
[2176] Fix | Delete
$this->warning('expecting esds.ES_DecSpecificInfoTag = 0x05, found 0x'.getid3_lib::PrintHexBytes($atom_structure['ES_DecSpecificInfoTag']).'), at offset '.$atom_structure['offset']);
[2177] Fix | Delete
break;
[2178] Fix | Delete
}
[2179] Fix | Delete
$atom_structure['ES_DecSpecificInfoTagSize'] = $this->quicktime_read_mp4_descr_length($atom_data, $esds_offset);
[2180] Fix | Delete
[2181] Fix | Delete
$atom_structure['ES_DecSpecificInfo'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, $atom_structure['ES_DecSpecificInfoTagSize']));
[2182] Fix | Delete
$esds_offset += $atom_structure['ES_DecSpecificInfoTagSize'];
[2183] Fix | Delete
[2184] Fix | Delete
$atom_structure['ES_SLConfigDescrTag'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, 1));
[2185] Fix | Delete
$esds_offset += 1;
[2186] Fix | Delete
if ($atom_structure['ES_SLConfigDescrTag'] != 0x06) {
[2187] Fix | Delete
$this->warning('expecting esds.ES_SLConfigDescrTag = 0x05, found 0x'.getid3_lib::PrintHexBytes($atom_structure['ES_SLConfigDescrTag']).'), at offset '.$atom_structure['offset']);
[2188] Fix | Delete
break;
[2189] Fix | Delete
}
[2190] Fix | Delete
$atom_structure['ES_SLConfigDescrTagSize'] = $this->quicktime_read_mp4_descr_length($atom_data, $esds_offset);
[2191] Fix | Delete
[2192] Fix | Delete
$atom_structure['ES_SLConfigDescr'] = getid3_lib::BigEndian2Int(substr($atom_data, $esds_offset, $atom_structure['ES_SLConfigDescrTagSize']));
[2193] Fix | Delete
$esds_offset += $atom_structure['ES_SLConfigDescrTagSize'];
[2194] Fix | Delete
break;
[2195] Fix | Delete
[2196] Fix | Delete
// AVIF-related - https://docs.rs/avif-parse/0.13.2/src/avif_parse/boxes.rs.html
[2197] Fix | Delete
case 'pitm': // Primary ITeM
[2198] Fix | Delete
case 'iloc': // Item LOCation
[2199] Fix | Delete
case 'iinf': // Item INFo
[2200] Fix | Delete
case 'iref': // Image REFerence
[2201] Fix | Delete
case 'iprp': // Image PRoPerties
[2202] Fix | Delete
$this->error('AVIF files not currently supported');
[2203] Fix | Delete
$atom_structure['data'] = $atom_data;
[2204] Fix | Delete
break;
[2205] Fix | Delete
[2206] Fix | Delete
case 'tfdt': // Track Fragment base media Decode Time box
[2207] Fix | Delete
case 'tfhd': // Track Fragment HeaDer box
[2208] Fix | Delete
case 'mfhd': // Movie Fragment HeaDer box
[2209] Fix | Delete
case 'trun': // Track fragment RUN box
[2210] Fix | Delete
$this->error('fragmented mp4 files not currently supported');
[2211] Fix | Delete
$atom_structure['data'] = $atom_data;
[2212] Fix | Delete
break;
[2213] Fix | Delete
[2214] Fix | Delete
case 'mvex': // MoVie EXtends box
[2215] Fix | Delete
case 'pssh': // Protection System Specific Header box
[2216] Fix | Delete
case 'sidx': // Segment InDeX box
[2217] Fix | Delete
default:
[2218] Fix | Delete
$this->warning('Unknown QuickTime atom type: "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $atomname).'" ('.trim(getid3_lib::PrintHexBytes($atomname)).'), '.$atomsize.' bytes at offset '.$baseoffset);
[2219] Fix | Delete
$atom_structure['data'] = $atom_data;
[2220] Fix | Delete
break;
[2221] Fix | Delete
}
[2222] Fix | Delete
}
[2223] Fix | Delete
array_pop($atomHierarchy);
[2224] Fix | Delete
return $atom_structure;
[2225] Fix | Delete
}
[2226] Fix | Delete
[2227] Fix | Delete
/**
[2228] Fix | Delete
* @param string $atom_data
[2229] Fix | Delete
* @param int $baseoffset
[2230] Fix | Delete
* @param array $atomHierarchy
[2231] Fix | Delete
* @param bool $ParseAllPossibleAtoms
[2232] Fix | Delete
*
[2233] Fix | Delete
* @return array|false
[2234] Fix | Delete
*/
[2235] Fix | Delete
public function QuicktimeParseContainerAtom($atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms) {
[2236] Fix | Delete
$atom_structure = array();
[2237] Fix | Delete
$subatomoffset = 0;
[2238] Fix | Delete
$subatomcounter = 0;
[2239] Fix | Delete
if ((strlen($atom_data) == 4) && (getid3_lib::BigEndian2Int($atom_data) == 0x00000000)) {
[2240] Fix | Delete
return false;
[2241] Fix | Delete
}
[2242] Fix | Delete
while ($subatomoffset < strlen($atom_data)) {
[2243] Fix | Delete
$subatomsize = getid3_lib::BigEndian2Int(substr($atom_data, $subatomoffset + 0, 4));
[2244] Fix | Delete
$subatomname = substr($atom_data, $subatomoffset + 4, 4);
[2245] Fix | Delete
$subatomdata = substr($atom_data, $subatomoffset + 8, $subatomsize - 8);
[2246] Fix | Delete
if ($subatomsize == 0) {
[2247] Fix | Delete
// Furthermore, for historical reasons the list of atoms is optionally
[2248] Fix | Delete
// terminated by a 32-bit integer set to 0. If you are writing a program
[2249] Fix | Delete
// to read user data atoms, you should allow for the terminating 0.
[2250] Fix | Delete
if (strlen($atom_data) > 12) {
[2251] Fix | Delete
$subatomoffset += 4;
[2252] Fix | Delete
continue;
[2253] Fix | Delete
}
[2254] Fix | Delete
break;
[2255] Fix | Delete
}
[2256] Fix | Delete
if (strlen($subatomdata) < ($subatomsize - 8)) {
[2257] Fix | Delete
// we don't have enough data to decode the subatom.
[2258] Fix | Delete
// this may be because we are refusing to parse large subatoms, or it may be because this atom had its size set too large
[2259] Fix | Delete
// so we passed in the start of a following atom incorrectly?
[2260] Fix | Delete
break;
[2261] Fix | Delete
}
[2262] Fix | Delete
$atom_structure[$subatomcounter++] = $this->QuicktimeParseAtom($subatomname, $subatomsize, $subatomdata, $baseoffset + $subatomoffset, $atomHierarchy, $ParseAllPossibleAtoms);
[2263] Fix | Delete
$subatomoffset += $subatomsize;
[2264] Fix | Delete
}
[2265] Fix | Delete
[2266] Fix | Delete
if (empty($atom_structure)) {
[2267] Fix | Delete
return false;
[2268] Fix | Delete
}
[2269] Fix | Delete
[2270] Fix | Delete
return $atom_structure;
[2271] Fix | Delete
}
[2272] Fix | Delete
[2273] Fix | Delete
/**
[2274] Fix | Delete
* @param string $data
[2275] Fix | Delete
* @param int $offset
[2276] Fix | Delete
*
[2277] Fix | Delete
* @return int
[2278] Fix | Delete
*/
[2279] Fix | Delete
public function quicktime_read_mp4_descr_length($data, &$offset) {
[2280] Fix | Delete
// http://libquicktime.sourcearchive.com/documentation/2:1.0.2plus-pdebian-2build1/esds_8c-source.html
[2281] Fix | Delete
$num_bytes = 0;
[2282] Fix | Delete
$length = 0;
[2283] Fix | Delete
do {
[2284] Fix | Delete
$b = ord(substr($data, $offset++, 1));
[2285] Fix | Delete
$length = ($length << 7) | ($b & 0x7F);
[2286] Fix | Delete
} while (($b & 0x80) && ($num_bytes++ < 4));
[2287] Fix | Delete
return $length;
[2288] Fix | Delete
}
[2289] Fix | Delete
[2290] Fix | Delete
/**
[2291] Fix | Delete
* @param int $languageid
[2292] Fix | Delete
*
[2293] Fix | Delete
* @return string
[2294] Fix | Delete
*/
[2295] Fix | Delete
public function QuicktimeLanguageLookup($languageid) {
[2296] Fix | Delete
// http://developer.apple.com/library/mac/#documentation/QuickTime/QTFF/QTFFChap4/qtff4.html#//apple_ref/doc/uid/TP40000939-CH206-34353
[2297] Fix | Delete
static $QuicktimeLanguageLookup = array();
[2298] Fix | Delete
if (empty($QuicktimeLanguageLookup)) {
[2299] Fix | Delete
$QuicktimeLanguageLookup[0] = 'English';
[2300] Fix | Delete
$QuicktimeLanguageLookup[1] = 'French';
[2301] Fix | Delete
$QuicktimeLanguageLookup[2] = 'German';
[2302] Fix | Delete
$QuicktimeLanguageLookup[3] = 'Italian';
[2303] Fix | Delete
$QuicktimeLanguageLookup[4] = 'Dutch';
[2304] Fix | Delete
$QuicktimeLanguageLookup[5] = 'Swedish';
[2305] Fix | Delete
$QuicktimeLanguageLookup[6] = 'Spanish';
[2306] Fix | Delete
$QuicktimeLanguageLookup[7] = 'Danish';
[2307] Fix | Delete
$QuicktimeLanguageLookup[8] = 'Portuguese';
[2308] Fix | Delete
$QuicktimeLanguageLookup[9] = 'Norwegian';
[2309] Fix | Delete
$QuicktimeLanguageLookup[10] = 'Hebrew';
[2310] Fix | Delete
$QuicktimeLanguageLookup[11] = 'Japanese';
[2311] Fix | Delete
$QuicktimeLanguageLookup[12] = 'Arabic';
[2312] Fix | Delete
$QuicktimeLanguageLookup[13] = 'Finnish';
[2313] Fix | Delete
$QuicktimeLanguageLookup[14] = 'Greek';
[2314] Fix | Delete
$QuicktimeLanguageLookup[15] = 'Icelandic';
[2315] Fix | Delete
$QuicktimeLanguageLookup[16] = 'Maltese';
[2316] Fix | Delete
$QuicktimeLanguageLookup[17] = 'Turkish';
[2317] Fix | Delete
$QuicktimeLanguageLookup[18] = 'Croatian';
[2318] Fix | Delete
$QuicktimeLanguageLookup[19] = 'Chinese (Traditional)';
[2319] Fix | Delete
$QuicktimeLanguageLookup[20] = 'Urdu';
[2320] Fix | Delete
$QuicktimeLanguageLookup[21] = 'Hindi';
[2321] Fix | Delete
$QuicktimeLanguageLookup[22] = 'Thai';
[2322] Fix | Delete
$QuicktimeLanguageLookup[23] = 'Korean';
[2323] Fix | Delete
$QuicktimeLanguageLookup[24] = 'Lithuanian';
[2324] Fix | Delete
$QuicktimeLanguageLookup[25] = 'Polish';
[2325] Fix | Delete
$QuicktimeLanguageLookup[26] = 'Hungarian';
[2326] Fix | Delete
$QuicktimeLanguageLookup[27] = 'Estonian';
[2327] Fix | Delete
$QuicktimeLanguageLookup[28] = 'Lettish';
[2328] Fix | Delete
$QuicktimeLanguageLookup[28] = 'Latvian';
[2329] Fix | Delete
$QuicktimeLanguageLookup[29] = 'Saamisk';
[2330] Fix | Delete
$QuicktimeLanguageLookup[29] = 'Lappish';
[2331] Fix | Delete
$QuicktimeLanguageLookup[30] = 'Faeroese';
[2332] Fix | Delete
$QuicktimeLanguageLookup[31] = 'Farsi';
[2333] Fix | Delete
$QuicktimeLanguageLookup[31] = 'Persian';
[2334] Fix | Delete
$QuicktimeLanguageLookup[32] = 'Russian';
[2335] Fix | Delete
$QuicktimeLanguageLookup[33] = 'Chinese (Simplified)';
[2336] Fix | Delete
$QuicktimeLanguageLookup[34] = 'Flemish';
[2337] Fix | Delete
$QuicktimeLanguageLookup[35] = 'Irish';
[2338] Fix | Delete
$QuicktimeLanguageLookup[36] = 'Albanian';
[2339] Fix | Delete
$QuicktimeLanguageLookup[37] = 'Romanian';
[2340] Fix | Delete
$QuicktimeLanguageLookup[38] = 'Czech';
[2341] Fix | Delete
$QuicktimeLanguageLookup[39] = 'Slovak';
[2342] Fix | Delete
$QuicktimeLanguageLookup[40] = 'Slovenian';
[2343] Fix | Delete
$QuicktimeLanguageLookup[41] = 'Yiddish';
[2344] Fix | Delete
$QuicktimeLanguageLookup[42] = 'Serbian';
[2345] Fix | Delete
$QuicktimeLanguageLookup[43] = 'Macedonian';
[2346] Fix | Delete
$QuicktimeLanguageLookup[44] = 'Bulgarian';
[2347] Fix | Delete
$QuicktimeLanguageLookup[45] = 'Ukrainian';
[2348] Fix | Delete
$QuicktimeLanguageLookup[46] = 'Byelorussian';
[2349] Fix | Delete
$QuicktimeLanguageLookup[47] = 'Uzbek';
[2350] Fix | Delete
$QuicktimeLanguageLookup[48] = 'Kazakh';
[2351] Fix | Delete
$QuicktimeLanguageLookup[49] = 'Azerbaijani';
[2352] Fix | Delete
$QuicktimeLanguageLookup[50] = 'AzerbaijanAr';
[2353] Fix | Delete
$QuicktimeLanguageLookup[51] = 'Armenian';
[2354] Fix | Delete
$QuicktimeLanguageLookup[52] = 'Georgian';
[2355] Fix | Delete
$QuicktimeLanguageLookup[53] = 'Moldavian';
[2356] Fix | Delete
$QuicktimeLanguageLookup[54] = 'Kirghiz';
[2357] Fix | Delete
$QuicktimeLanguageLookup[55] = 'Tajiki';
[2358] Fix | Delete
$QuicktimeLanguageLookup[56] = 'Turkmen';
[2359] Fix | Delete
$QuicktimeLanguageLookup[57] = 'Mongolian';
[2360] Fix | Delete
$QuicktimeLanguageLookup[58] = 'MongolianCyr';
[2361] Fix | Delete
$QuicktimeLanguageLookup[59] = 'Pashto';
[2362] Fix | Delete
$QuicktimeLanguageLookup[60] = 'Kurdish';
[2363] Fix | Delete
$QuicktimeLanguageLookup[61] = 'Kashmiri';
[2364] Fix | Delete
$QuicktimeLanguageLookup[62] = 'Sindhi';
[2365] Fix | Delete
$QuicktimeLanguageLookup[63] = 'Tibetan';
[2366] Fix | Delete
$QuicktimeLanguageLookup[64] = 'Nepali';
[2367] Fix | Delete
$QuicktimeLanguageLookup[65] = 'Sanskrit';
[2368] Fix | Delete
$QuicktimeLanguageLookup[66] = 'Marathi';
[2369] Fix | Delete
$QuicktimeLanguageLookup[67] = 'Bengali';
[2370] Fix | Delete
$QuicktimeLanguageLookup[68] = 'Assamese';
[2371] Fix | Delete
$QuicktimeLanguageLookup[69] = 'Gujarati';
[2372] Fix | Delete
$QuicktimeLanguageLookup[70] = 'Punjabi';
[2373] Fix | Delete
$QuicktimeLanguageLookup[71] = 'Oriya';
[2374] Fix | Delete
$QuicktimeLanguageLookup[72] = 'Malayalam';
[2375] Fix | Delete
$QuicktimeLanguageLookup[73] = 'Kannada';
[2376] Fix | Delete
$QuicktimeLanguageLookup[74] = 'Tamil';
[2377] Fix | Delete
$QuicktimeLanguageLookup[75] = 'Telugu';
[2378] Fix | Delete
$QuicktimeLanguageLookup[76] = 'Sinhalese';
[2379] Fix | Delete
$QuicktimeLanguageLookup[77] = 'Burmese';
[2380] Fix | Delete
$QuicktimeLanguageLookup[78] = 'Khmer';
[2381] Fix | Delete
$QuicktimeLanguageLookup[79] = 'Lao';
[2382] Fix | Delete
$QuicktimeLanguageLookup[80] = 'Vietnamese';
[2383] Fix | Delete
$QuicktimeLanguageLookup[81] = 'Indonesian';
[2384] Fix | Delete
$QuicktimeLanguageLookup[82] = 'Tagalog';
[2385] Fix | Delete
$QuicktimeLanguageLookup[83] = 'MalayRoman';
[2386] Fix | Delete
$QuicktimeLanguageLookup[84] = 'MalayArabic';
[2387] Fix | Delete
$QuicktimeLanguageLookup[85] = 'Amharic';
[2388] Fix | Delete
$QuicktimeLanguageLookup[86] = 'Tigrinya';
[2389] Fix | Delete
$QuicktimeLanguageLookup[87] = 'Galla';
[2390] Fix | Delete
$QuicktimeLanguageLookup[87] = 'Oromo';
[2391] Fix | Delete
$QuicktimeLanguageLookup[88] = 'Somali';
[2392] Fix | Delete
$QuicktimeLanguageLookup[89] = 'Swahili';
[2393] Fix | Delete
$QuicktimeLanguageLookup[90] = 'Ruanda';
[2394] Fix | Delete
$QuicktimeLanguageLookup[91] = 'Rundi';
[2395] Fix | Delete
$QuicktimeLanguageLookup[92] = 'Chewa';
[2396] Fix | Delete
$QuicktimeLanguageLookup[93] = 'Malagasy';
[2397] Fix | Delete
$QuicktimeLanguageLookup[94] = 'Esperanto';
[2398] Fix | Delete
$QuicktimeLanguageLookup[128] = 'Welsh';
[2399] Fix | Delete
$QuicktimeLanguageLookup[129] = 'Basque';
[2400] Fix | Delete
$QuicktimeLanguageLookup[130] = 'Catalan';
[2401] Fix | Delete
$QuicktimeLanguageLookup[131] = 'Latin';
[2402] Fix | Delete
$QuicktimeLanguageLookup[132] = 'Quechua';
[2403] Fix | Delete
$QuicktimeLanguageLookup[133] = 'Guarani';
[2404] Fix | Delete
$QuicktimeLanguageLookup[134] = 'Aymara';
[2405] Fix | Delete
$QuicktimeLanguageLookup[135] = 'Tatar';
[2406] Fix | Delete
$QuicktimeLanguageLookup[136] = 'Uighur';
[2407] Fix | Delete
$QuicktimeLanguageLookup[137] = 'Dzongkha';
[2408] Fix | Delete
$QuicktimeLanguageLookup[138] = 'JavaneseRom';
[2409] Fix | Delete
$QuicktimeLanguageLookup[32767] = 'Unspecified';
[2410] Fix | Delete
}
[2411] Fix | Delete
if (($languageid > 138) && ($languageid < 32767)) {
[2412] Fix | Delete
/*
[2413] Fix | Delete
ISO Language Codes - http://www.loc.gov/standards/iso639-2/php/code_list.php
[2414] Fix | Delete
Because the language codes specified by ISO 639-2/T are three characters long, they must be packed to fit into a 16-bit field.
[2415] Fix | Delete
The packing algorithm must map each of the three characters, which are always lowercase, into a 5-bit integer and then concatenate
[2416] Fix | Delete
these integers into the least significant 15 bits of a 16-bit integer, leaving the 16-bit integer's most significant bit set to zero.
[2417] Fix | Delete
[2418] Fix | Delete
One algorithm for performing this packing is to treat each ISO character as a 16-bit integer. Subtract 0x60 from the first character
[2419] Fix | Delete
and multiply by 2^10 (0x400), subtract 0x60 from the second character and multiply by 2^5 (0x20), subtract 0x60 from the third character,
[2420] Fix | Delete
and add the three 16-bit values. This will result in a single 16-bit value with the three codes correctly packed into the 15 least
[2421] Fix | Delete
significant bits and the most significant bit set to zero.
[2422] Fix | Delete
*/
[2423] Fix | Delete
$iso_language_id = '';
[2424] Fix | Delete
$iso_language_id .= chr((($languageid & 0x7C00) >> 10) + 0x60);
[2425] Fix | Delete
$iso_language_id .= chr((($languageid & 0x03E0) >> 5) + 0x60);
[2426] Fix | Delete
$iso_language_id .= chr((($languageid & 0x001F) >> 0) + 0x60);
[2427] Fix | Delete
$QuicktimeLanguageLookup[$languageid] = getid3_id3v2::LanguageLookup($iso_language_id);
[2428] Fix | Delete
}
[2429] Fix | Delete
return (isset($QuicktimeLanguageLookup[$languageid]) ? $QuicktimeLanguageLookup[$languageid] : 'invalid');
[2430] Fix | Delete
}
[2431] Fix | Delete
[2432] Fix | Delete
/**
[2433] Fix | Delete
* @param string $codecid
[2434] Fix | Delete
*
[2435] Fix | Delete
* @return string
[2436] Fix | Delete
*/
[2437] Fix | Delete
public function QuicktimeVideoCodecLookup($codecid) {
[2438] Fix | Delete
static $QuicktimeVideoCodecLookup = array();
[2439] Fix | Delete
if (empty($QuicktimeVideoCodecLookup)) {
[2440] Fix | Delete
$QuicktimeVideoCodecLookup['.SGI'] = 'SGI';
[2441] Fix | Delete
$QuicktimeVideoCodecLookup['3IV1'] = '3ivx MPEG-4 v1';
[2442] Fix | Delete
$QuicktimeVideoCodecLookup['3IV2'] = '3ivx MPEG-4 v2';
[2443] Fix | Delete
$QuicktimeVideoCodecLookup['3IVX'] = '3ivx MPEG-4';
[2444] Fix | Delete
$QuicktimeVideoCodecLookup['8BPS'] = 'Planar RGB';
[2445] Fix | Delete
$QuicktimeVideoCodecLookup['avc1'] = 'H.264/MPEG-4 AVC';
[2446] Fix | Delete
$QuicktimeVideoCodecLookup['avr '] = 'AVR-JPEG';
[2447] Fix | Delete
$QuicktimeVideoCodecLookup['b16g'] = '16Gray';
[2448] Fix | Delete
$QuicktimeVideoCodecLookup['b32a'] = '32AlphaGray';
[2449] Fix | Delete
$QuicktimeVideoCodecLookup['b48r'] = '48RGB';
[2450] Fix | Delete
$QuicktimeVideoCodecLookup['b64a'] = '64ARGB';
[2451] Fix | Delete
$QuicktimeVideoCodecLookup['base'] = 'Base';
[2452] Fix | Delete
$QuicktimeVideoCodecLookup['clou'] = 'Cloud';
[2453] Fix | Delete
$QuicktimeVideoCodecLookup['cmyk'] = 'CMYK';
[2454] Fix | Delete
$QuicktimeVideoCodecLookup['cvid'] = 'Cinepak';
[2455] Fix | Delete
$QuicktimeVideoCodecLookup['dmb1'] = 'OpenDML JPEG';
[2456] Fix | Delete
$QuicktimeVideoCodecLookup['dvc '] = 'DVC-NTSC';
[2457] Fix | Delete
$QuicktimeVideoCodecLookup['dvcp'] = 'DVC-PAL';
[2458] Fix | Delete
$QuicktimeVideoCodecLookup['dvpn'] = 'DVCPro-NTSC';
[2459] Fix | Delete
$QuicktimeVideoCodecLookup['dvpp'] = 'DVCPro-PAL';
[2460] Fix | Delete
$QuicktimeVideoCodecLookup['fire'] = 'Fire';
[2461] Fix | Delete
$QuicktimeVideoCodecLookup['flic'] = 'FLC';
[2462] Fix | Delete
$QuicktimeVideoCodecLookup['gif '] = 'GIF';
[2463] Fix | Delete
$QuicktimeVideoCodecLookup['h261'] = 'H261';
[2464] Fix | Delete
$QuicktimeVideoCodecLookup['h263'] = 'H263';
[2465] Fix | Delete
$QuicktimeVideoCodecLookup['hvc1'] = 'H.265/HEVC';
[2466] Fix | Delete
$QuicktimeVideoCodecLookup['IV41'] = 'Indeo4';
[2467] Fix | Delete
$QuicktimeVideoCodecLookup['jpeg'] = 'JPEG';
[2468] Fix | Delete
$QuicktimeVideoCodecLookup['kpcd'] = 'PhotoCD';
[2469] Fix | Delete
$QuicktimeVideoCodecLookup['mjpa'] = 'Motion JPEG-A';
[2470] Fix | Delete
$QuicktimeVideoCodecLookup['mjpb'] = 'Motion JPEG-B';
[2471] Fix | Delete
$QuicktimeVideoCodecLookup['msvc'] = 'Microsoft Video1';
[2472] Fix | Delete
$QuicktimeVideoCodecLookup['myuv'] = 'MPEG YUV420';
[2473] Fix | Delete
$QuicktimeVideoCodecLookup['path'] = 'Vector';
[2474] Fix | Delete
$QuicktimeVideoCodecLookup['png '] = 'PNG';
[2475] Fix | Delete
$QuicktimeVideoCodecLookup['PNTG'] = 'MacPaint';
[2476] Fix | Delete
$QuicktimeVideoCodecLookup['qdgx'] = 'QuickDrawGX';
[2477] Fix | Delete
$QuicktimeVideoCodecLookup['qdrw'] = 'QuickDraw';
[2478] Fix | Delete
$QuicktimeVideoCodecLookup['raw '] = 'RAW';
[2479] Fix | Delete
$QuicktimeVideoCodecLookup['ripl'] = 'WaterRipple';
[2480] Fix | Delete
$QuicktimeVideoCodecLookup['rpza'] = 'Video';
[2481] Fix | Delete
$QuicktimeVideoCodecLookup['smc '] = 'Graphics';
[2482] Fix | Delete
$QuicktimeVideoCodecLookup['SVQ1'] = 'Sorenson Video 1';
[2483] Fix | Delete
$QuicktimeVideoCodecLookup['SVQ1'] = 'Sorenson Video 3';
[2484] Fix | Delete
$QuicktimeVideoCodecLookup['syv9'] = 'Sorenson YUV9';
[2485] Fix | Delete
$QuicktimeVideoCodecLookup['tga '] = 'Targa';
[2486] Fix | Delete
$QuicktimeVideoCodecLookup['tiff'] = 'TIFF';
[2487] Fix | Delete
$QuicktimeVideoCodecLookup['WRAW'] = 'Windows RAW';
[2488] Fix | Delete
$QuicktimeVideoCodecLookup['WRLE'] = 'BMP';
[2489] Fix | Delete
$QuicktimeVideoCodecLookup['y420'] = 'YUV420';
[2490] Fix | Delete
$QuicktimeVideoCodecLookup['yuv2'] = 'ComponentVideo';
[2491] Fix | Delete
$QuicktimeVideoCodecLookup['yuvs'] = 'ComponentVideoUnsigned';
[2492] Fix | Delete
$QuicktimeVideoCodecLookup['yuvu'] = 'ComponentVideoSigned';
[2493] Fix | Delete
}
[2494] Fix | Delete
return (isset($QuicktimeVideoCodecLookup[$codecid]) ? $QuicktimeVideoCodecLookup[$codecid] : '');
[2495] Fix | Delete
}
[2496] Fix | Delete
[2497] Fix | Delete
/**
[2498] Fix | Delete
* @param string $codecid
[2499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function