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/clone/wp-inclu.../ID3
File: module.audio-video.riff.php
case 'Filter HP': // High-pass filter frequency in kHz
[500] Fix | Delete
case 'Filter LP': // Low-pass filter frequency in kHz
[501] Fix | Delete
case 'Humidity': // Relative humidity as a percentage
[502] Fix | Delete
case 'Length': // Recording length in seconds
[503] Fix | Delete
case 'Loc Accuracy': // Estimated Position Error in meters
[504] Fix | Delete
case 'Temperature Ext': // External temperature in degrees Celsius outside the recorder's housing
[505] Fix | Delete
case 'Temperature Int': // Internal temperature in degrees Celsius inside the recorder's housing
[506] Fix | Delete
$thisfile_riff['guano'][$key] = (float) $value;
[507] Fix | Delete
break;
[508] Fix | Delete
case 'Samplerate': // Recording sample rate, Hz
[509] Fix | Delete
case 'TE': // Time-expansion factor. If not specified, then 1 (no time-expansion a.k.a. direct-recording) is assumed.
[510] Fix | Delete
$thisfile_riff['guano'][$key] = (int) $value;
[511] Fix | Delete
break;
[512] Fix | Delete
}
[513] Fix | Delete
}
[514] Fix | Delete
[515] Fix | Delete
} else {
[516] Fix | Delete
$this->warning('RIFF.guan data not in expected format');
[517] Fix | Delete
}
[518] Fix | Delete
}
[519] Fix | Delete
[520] Fix | Delete
if (!isset($thisfile_audio['bitrate']) && isset($thisfile_riff_audio[$streamindex]['bitrate'])) {
[521] Fix | Delete
$thisfile_audio['bitrate'] = $thisfile_riff_audio[$streamindex]['bitrate'];
[522] Fix | Delete
$info['playtime_seconds'] = (float)getid3_lib::SafeDiv((($info['avdataend'] - $info['avdataoffset']) * 8), $thisfile_audio['bitrate']);
[523] Fix | Delete
}
[524] Fix | Delete
[525] Fix | Delete
if (!empty($info['wavpack'])) {
[526] Fix | Delete
$thisfile_audio_dataformat = 'wavpack';
[527] Fix | Delete
$thisfile_audio['bitrate_mode'] = 'vbr';
[528] Fix | Delete
$thisfile_audio['encoder'] = 'WavPack v'.$info['wavpack']['version'];
[529] Fix | Delete
[530] Fix | Delete
// Reset to the way it was - RIFF parsing will have messed this up
[531] Fix | Delete
$info['avdataend'] = $Original['avdataend'];
[532] Fix | Delete
$thisfile_audio['bitrate'] = getid3_lib::SafeDiv(($info['avdataend'] - $info['avdataoffset']) * 8, $info['playtime_seconds']);
[533] Fix | Delete
[534] Fix | Delete
$this->fseek($info['avdataoffset'] - 44);
[535] Fix | Delete
$RIFFdata = $this->fread(44);
[536] Fix | Delete
$OrignalRIFFheaderSize = getid3_lib::LittleEndian2Int(substr($RIFFdata, 4, 4)) + 8;
[537] Fix | Delete
$OrignalRIFFdataSize = getid3_lib::LittleEndian2Int(substr($RIFFdata, 40, 4)) + 44;
[538] Fix | Delete
[539] Fix | Delete
if ($OrignalRIFFheaderSize > $OrignalRIFFdataSize) {
[540] Fix | Delete
$info['avdataend'] -= ($OrignalRIFFheaderSize - $OrignalRIFFdataSize);
[541] Fix | Delete
$this->fseek($info['avdataend']);
[542] Fix | Delete
$RIFFdata .= $this->fread($OrignalRIFFheaderSize - $OrignalRIFFdataSize);
[543] Fix | Delete
}
[544] Fix | Delete
[545] Fix | Delete
// move the data chunk after all other chunks (if any)
[546] Fix | Delete
// so that the RIFF parser doesn't see EOF when trying
[547] Fix | Delete
// to skip over the data chunk
[548] Fix | Delete
$RIFFdata = substr($RIFFdata, 0, 36).substr($RIFFdata, 44).substr($RIFFdata, 36, 8);
[549] Fix | Delete
$getid3_riff = new getid3_riff($this->getid3);
[550] Fix | Delete
$getid3_riff->ParseRIFFdata($RIFFdata);
[551] Fix | Delete
unset($getid3_riff);
[552] Fix | Delete
}
[553] Fix | Delete
[554] Fix | Delete
if (isset($thisfile_riff_raw['fmt ']['wFormatTag'])) {
[555] Fix | Delete
switch ($thisfile_riff_raw['fmt ']['wFormatTag']) {
[556] Fix | Delete
case 0x0001: // PCM
[557] Fix | Delete
if (!empty($info['ac3'])) {
[558] Fix | Delete
// Dolby Digital WAV files masquerade as PCM-WAV, but they're not
[559] Fix | Delete
$thisfile_audio['wformattag'] = 0x2000;
[560] Fix | Delete
$thisfile_audio['codec'] = self::wFormatTagLookup($thisfile_audio['wformattag']);
[561] Fix | Delete
$thisfile_audio['lossless'] = false;
[562] Fix | Delete
$thisfile_audio['bitrate'] = $info['ac3']['bitrate'];
[563] Fix | Delete
$thisfile_audio['sample_rate'] = $info['ac3']['sample_rate'];
[564] Fix | Delete
}
[565] Fix | Delete
if (!empty($info['dts'])) {
[566] Fix | Delete
// Dolby DTS files masquerade as PCM-WAV, but they're not
[567] Fix | Delete
$thisfile_audio['wformattag'] = 0x2001;
[568] Fix | Delete
$thisfile_audio['codec'] = self::wFormatTagLookup($thisfile_audio['wformattag']);
[569] Fix | Delete
$thisfile_audio['lossless'] = false;
[570] Fix | Delete
$thisfile_audio['bitrate'] = $info['dts']['bitrate'];
[571] Fix | Delete
$thisfile_audio['sample_rate'] = $info['dts']['sample_rate'];
[572] Fix | Delete
}
[573] Fix | Delete
break;
[574] Fix | Delete
case 0x08AE: // ClearJump LiteWave
[575] Fix | Delete
$thisfile_audio['bitrate_mode'] = 'vbr';
[576] Fix | Delete
$thisfile_audio_dataformat = 'litewave';
[577] Fix | Delete
[578] Fix | Delete
//typedef struct tagSLwFormat {
[579] Fix | Delete
// WORD m_wCompFormat; // low byte defines compression method, high byte is compression flags
[580] Fix | Delete
// DWORD m_dwScale; // scale factor for lossy compression
[581] Fix | Delete
// DWORD m_dwBlockSize; // number of samples in encoded blocks
[582] Fix | Delete
// WORD m_wQuality; // alias for the scale factor
[583] Fix | Delete
// WORD m_wMarkDistance; // distance between marks in bytes
[584] Fix | Delete
// WORD m_wReserved;
[585] Fix | Delete
//
[586] Fix | Delete
// //following paramters are ignored if CF_FILESRC is not set
[587] Fix | Delete
// DWORD m_dwOrgSize; // original file size in bytes
[588] Fix | Delete
// WORD m_bFactExists; // indicates if 'fact' chunk exists in the original file
[589] Fix | Delete
// DWORD m_dwRiffChunkSize; // riff chunk size in the original file
[590] Fix | Delete
//
[591] Fix | Delete
// PCMWAVEFORMAT m_OrgWf; // original wave format
[592] Fix | Delete
// }SLwFormat, *PSLwFormat;
[593] Fix | Delete
[594] Fix | Delete
// shortcut
[595] Fix | Delete
$thisfile_riff['litewave']['raw'] = array();
[596] Fix | Delete
$riff_litewave = &$thisfile_riff['litewave'];
[597] Fix | Delete
$riff_litewave_raw = &$riff_litewave['raw'];
[598] Fix | Delete
[599] Fix | Delete
$flags = array(
[600] Fix | Delete
'compression_method' => 1,
[601] Fix | Delete
'compression_flags' => 1,
[602] Fix | Delete
'm_dwScale' => 4,
[603] Fix | Delete
'm_dwBlockSize' => 4,
[604] Fix | Delete
'm_wQuality' => 2,
[605] Fix | Delete
'm_wMarkDistance' => 2,
[606] Fix | Delete
'm_wReserved' => 2,
[607] Fix | Delete
'm_dwOrgSize' => 4,
[608] Fix | Delete
'm_bFactExists' => 2,
[609] Fix | Delete
'm_dwRiffChunkSize' => 4,
[610] Fix | Delete
);
[611] Fix | Delete
$litewave_offset = 18;
[612] Fix | Delete
foreach ($flags as $flag => $length) {
[613] Fix | Delete
$riff_litewave_raw[$flag] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE['fmt '][0]['data'], $litewave_offset, $length));
[614] Fix | Delete
$litewave_offset += $length;
[615] Fix | Delete
}
[616] Fix | Delete
[617] Fix | Delete
//$riff_litewave['quality_factor'] = intval(round((2000 - $riff_litewave_raw['m_dwScale']) / 20));
[618] Fix | Delete
$riff_litewave['quality_factor'] = $riff_litewave_raw['m_wQuality'];
[619] Fix | Delete
[620] Fix | Delete
$riff_litewave['flags']['raw_source'] = ($riff_litewave_raw['compression_flags'] & 0x01) ? false : true;
[621] Fix | Delete
$riff_litewave['flags']['vbr_blocksize'] = ($riff_litewave_raw['compression_flags'] & 0x02) ? false : true;
[622] Fix | Delete
$riff_litewave['flags']['seekpoints'] = (bool) ($riff_litewave_raw['compression_flags'] & 0x04);
[623] Fix | Delete
[624] Fix | Delete
$thisfile_audio['lossless'] = (($riff_litewave_raw['m_wQuality'] == 100) ? true : false);
[625] Fix | Delete
$thisfile_audio['encoder_options'] = '-q'.$riff_litewave['quality_factor'];
[626] Fix | Delete
break;
[627] Fix | Delete
[628] Fix | Delete
default:
[629] Fix | Delete
break;
[630] Fix | Delete
}
[631] Fix | Delete
}
[632] Fix | Delete
if ($info['avdataend'] > $info['filesize']) {
[633] Fix | Delete
switch ($thisfile_audio_dataformat) {
[634] Fix | Delete
case 'wavpack': // WavPack
[635] Fix | Delete
case 'lpac': // LPAC
[636] Fix | Delete
case 'ofr': // OptimFROG
[637] Fix | Delete
case 'ofs': // OptimFROG DualStream
[638] Fix | Delete
// lossless compressed audio formats that keep original RIFF headers - skip warning
[639] Fix | Delete
break;
[640] Fix | Delete
[641] Fix | Delete
case 'litewave':
[642] Fix | Delete
if (($info['avdataend'] - $info['filesize']) == 1) {
[643] Fix | Delete
// LiteWave appears to incorrectly *not* pad actual output file
[644] Fix | Delete
// to nearest WORD boundary so may appear to be short by one
[645] Fix | Delete
// byte, in which case - skip warning
[646] Fix | Delete
} else {
[647] Fix | Delete
// Short by more than one byte, throw warning
[648] Fix | Delete
$this->warning('Probably truncated file - expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)');
[649] Fix | Delete
$info['avdataend'] = $info['filesize'];
[650] Fix | Delete
}
[651] Fix | Delete
break;
[652] Fix | Delete
[653] Fix | Delete
default:
[654] Fix | Delete
if ((($info['avdataend'] - $info['filesize']) == 1) && (($thisfile_riff[$RIFFsubtype]['data'][0]['size'] % 2) == 0) && ((($info['filesize'] - $info['avdataoffset']) % 2) == 1)) {
[655] Fix | Delete
// output file appears to be incorrectly *not* padded to nearest WORD boundary
[656] Fix | Delete
// Output less severe warning
[657] Fix | Delete
$this->warning('File should probably be padded to nearest WORD boundary, but it is not (expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' therefore short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)');
[658] Fix | Delete
$info['avdataend'] = $info['filesize'];
[659] Fix | Delete
} else {
[660] Fix | Delete
// Short by more than one byte, throw warning
[661] Fix | Delete
$this->warning('Probably truncated file - expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)');
[662] Fix | Delete
$info['avdataend'] = $info['filesize'];
[663] Fix | Delete
}
[664] Fix | Delete
break;
[665] Fix | Delete
}
[666] Fix | Delete
}
[667] Fix | Delete
if (!empty($info['mpeg']['audio']['LAME']['audio_bytes'])) {
[668] Fix | Delete
if ((($info['avdataend'] - $info['avdataoffset']) - $info['mpeg']['audio']['LAME']['audio_bytes']) == 1) {
[669] Fix | Delete
$info['avdataend']--;
[670] Fix | Delete
$this->warning('Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored');
[671] Fix | Delete
}
[672] Fix | Delete
}
[673] Fix | Delete
if ($thisfile_audio_dataformat == 'ac3') {
[674] Fix | Delete
unset($thisfile_audio['bits_per_sample']);
[675] Fix | Delete
if (!empty($info['ac3']['bitrate']) && ($info['ac3']['bitrate'] != $thisfile_audio['bitrate'])) {
[676] Fix | Delete
$thisfile_audio['bitrate'] = $info['ac3']['bitrate'];
[677] Fix | Delete
}
[678] Fix | Delete
}
[679] Fix | Delete
break;
[680] Fix | Delete
[681] Fix | Delete
// http://en.wikipedia.org/wiki/Audio_Video_Interleave
[682] Fix | Delete
case 'AVI ':
[683] Fix | Delete
$info['fileformat'] = 'avi';
[684] Fix | Delete
$info['mime_type'] = 'video/avi';
[685] Fix | Delete
[686] Fix | Delete
$thisfile_video['bitrate_mode'] = 'vbr'; // maybe not, but probably
[687] Fix | Delete
$thisfile_video['dataformat'] = 'avi';
[688] Fix | Delete
[689] Fix | Delete
$thisfile_riff_video_current = array();
[690] Fix | Delete
[691] Fix | Delete
if (isset($thisfile_riff[$RIFFsubtype]['movi']['offset'])) {
[692] Fix | Delete
$info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['movi']['offset'] + 8;
[693] Fix | Delete
if (isset($thisfile_riff['AVIX'])) {
[694] Fix | Delete
$info['avdataend'] = $thisfile_riff['AVIX'][(count($thisfile_riff['AVIX']) - 1)]['chunks']['movi']['offset'] + $thisfile_riff['AVIX'][(count($thisfile_riff['AVIX']) - 1)]['chunks']['movi']['size'];
[695] Fix | Delete
} else {
[696] Fix | Delete
$info['avdataend'] = $thisfile_riff['AVI ']['movi']['offset'] + $thisfile_riff['AVI ']['movi']['size'];
[697] Fix | Delete
}
[698] Fix | Delete
if ($info['avdataend'] > $info['filesize']) {
[699] Fix | Delete
$this->warning('Probably truncated file - expecting '.($info['avdataend'] - $info['avdataoffset']).' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($info['avdataend'] - $info['filesize']).' bytes)');
[700] Fix | Delete
$info['avdataend'] = $info['filesize'];
[701] Fix | Delete
}
[702] Fix | Delete
}
[703] Fix | Delete
[704] Fix | Delete
if (isset($thisfile_riff['AVI ']['hdrl']['strl']['indx'])) {
[705] Fix | Delete
//$bIndexType = array(
[706] Fix | Delete
// 0x00 => 'AVI_INDEX_OF_INDEXES',
[707] Fix | Delete
// 0x01 => 'AVI_INDEX_OF_CHUNKS',
[708] Fix | Delete
// 0x80 => 'AVI_INDEX_IS_DATA',
[709] Fix | Delete
//);
[710] Fix | Delete
//$bIndexSubtype = array(
[711] Fix | Delete
// 0x01 => array(
[712] Fix | Delete
// 0x01 => 'AVI_INDEX_2FIELD',
[713] Fix | Delete
// ),
[714] Fix | Delete
//);
[715] Fix | Delete
foreach ($thisfile_riff['AVI ']['hdrl']['strl']['indx'] as $streamnumber => $steamdataarray) {
[716] Fix | Delete
$ahsisd = &$thisfile_riff['AVI ']['hdrl']['strl']['indx'][$streamnumber]['data'];
[717] Fix | Delete
[718] Fix | Delete
$thisfile_riff_raw['indx'][$streamnumber]['wLongsPerEntry'] = $this->EitherEndian2Int(substr($ahsisd, 0, 2));
[719] Fix | Delete
$thisfile_riff_raw['indx'][$streamnumber]['bIndexSubType'] = $this->EitherEndian2Int(substr($ahsisd, 2, 1));
[720] Fix | Delete
$thisfile_riff_raw['indx'][$streamnumber]['bIndexType'] = $this->EitherEndian2Int(substr($ahsisd, 3, 1));
[721] Fix | Delete
$thisfile_riff_raw['indx'][$streamnumber]['nEntriesInUse'] = $this->EitherEndian2Int(substr($ahsisd, 4, 4));
[722] Fix | Delete
$thisfile_riff_raw['indx'][$streamnumber]['dwChunkId'] = substr($ahsisd, 8, 4);
[723] Fix | Delete
$thisfile_riff_raw['indx'][$streamnumber]['dwReserved'] = $this->EitherEndian2Int(substr($ahsisd, 12, 4));
[724] Fix | Delete
[725] Fix | Delete
//$thisfile_riff_raw['indx'][$streamnumber]['bIndexType_name'] = $bIndexType[$thisfile_riff_raw['indx'][$streamnumber]['bIndexType']];
[726] Fix | Delete
//$thisfile_riff_raw['indx'][$streamnumber]['bIndexSubType_name'] = $bIndexSubtype[$thisfile_riff_raw['indx'][$streamnumber]['bIndexType']][$thisfile_riff_raw['indx'][$streamnumber]['bIndexSubType']];
[727] Fix | Delete
[728] Fix | Delete
unset($ahsisd);
[729] Fix | Delete
}
[730] Fix | Delete
}
[731] Fix | Delete
if (isset($thisfile_riff['AVI ']['hdrl']['avih'][$streamindex]['data'])) {
[732] Fix | Delete
$avihData = $thisfile_riff['AVI ']['hdrl']['avih'][$streamindex]['data'];
[733] Fix | Delete
[734] Fix | Delete
// shortcut
[735] Fix | Delete
$thisfile_riff_raw['avih'] = array();
[736] Fix | Delete
$thisfile_riff_raw_avih = &$thisfile_riff_raw['avih'];
[737] Fix | Delete
[738] Fix | Delete
$thisfile_riff_raw_avih['dwMicroSecPerFrame'] = $this->EitherEndian2Int(substr($avihData, 0, 4)); // frame display rate (or 0L)
[739] Fix | Delete
if ($thisfile_riff_raw_avih['dwMicroSecPerFrame'] == 0) {
[740] Fix | Delete
$this->error('Corrupt RIFF file: avih.dwMicroSecPerFrame == zero');
[741] Fix | Delete
return false;
[742] Fix | Delete
}
[743] Fix | Delete
[744] Fix | Delete
$flags = array(
[745] Fix | Delete
'dwMaxBytesPerSec', // max. transfer rate
[746] Fix | Delete
'dwPaddingGranularity', // pad to multiples of this size; normally 2K.
[747] Fix | Delete
'dwFlags', // the ever-present flags
[748] Fix | Delete
'dwTotalFrames', // # frames in file
[749] Fix | Delete
'dwInitialFrames', //
[750] Fix | Delete
'dwStreams', //
[751] Fix | Delete
'dwSuggestedBufferSize', //
[752] Fix | Delete
'dwWidth', //
[753] Fix | Delete
'dwHeight', //
[754] Fix | Delete
'dwScale', //
[755] Fix | Delete
'dwRate', //
[756] Fix | Delete
'dwStart', //
[757] Fix | Delete
'dwLength', //
[758] Fix | Delete
);
[759] Fix | Delete
$avih_offset = 4;
[760] Fix | Delete
foreach ($flags as $flag) {
[761] Fix | Delete
$thisfile_riff_raw_avih[$flag] = $this->EitherEndian2Int(substr($avihData, $avih_offset, 4));
[762] Fix | Delete
$avih_offset += 4;
[763] Fix | Delete
}
[764] Fix | Delete
[765] Fix | Delete
$flags = array(
[766] Fix | Delete
'hasindex' => 0x00000010,
[767] Fix | Delete
'mustuseindex' => 0x00000020,
[768] Fix | Delete
'interleaved' => 0x00000100,
[769] Fix | Delete
'trustcktype' => 0x00000800,
[770] Fix | Delete
'capturedfile' => 0x00010000,
[771] Fix | Delete
'copyrighted' => 0x00020010,
[772] Fix | Delete
);
[773] Fix | Delete
foreach ($flags as $flag => $value) {
[774] Fix | Delete
$thisfile_riff_raw_avih['flags'][$flag] = (bool) ($thisfile_riff_raw_avih['dwFlags'] & $value);
[775] Fix | Delete
}
[776] Fix | Delete
[777] Fix | Delete
// shortcut
[778] Fix | Delete
$thisfile_riff_video[$streamindex] = array();
[779] Fix | Delete
/** @var array $thisfile_riff_video_current */
[780] Fix | Delete
$thisfile_riff_video_current = &$thisfile_riff_video[$streamindex];
[781] Fix | Delete
[782] Fix | Delete
if ($thisfile_riff_raw_avih['dwWidth'] > 0) { // @phpstan-ignore-line
[783] Fix | Delete
$thisfile_riff_video_current['frame_width'] = $thisfile_riff_raw_avih['dwWidth'];
[784] Fix | Delete
$thisfile_video['resolution_x'] = $thisfile_riff_video_current['frame_width'];
[785] Fix | Delete
}
[786] Fix | Delete
if ($thisfile_riff_raw_avih['dwHeight'] > 0) { // @phpstan-ignore-line
[787] Fix | Delete
$thisfile_riff_video_current['frame_height'] = $thisfile_riff_raw_avih['dwHeight'];
[788] Fix | Delete
$thisfile_video['resolution_y'] = $thisfile_riff_video_current['frame_height'];
[789] Fix | Delete
}
[790] Fix | Delete
if ($thisfile_riff_raw_avih['dwTotalFrames'] > 0) { // @phpstan-ignore-line
[791] Fix | Delete
$thisfile_riff_video_current['total_frames'] = $thisfile_riff_raw_avih['dwTotalFrames'];
[792] Fix | Delete
$thisfile_video['total_frames'] = $thisfile_riff_video_current['total_frames'];
[793] Fix | Delete
}
[794] Fix | Delete
[795] Fix | Delete
$thisfile_riff_video_current['frame_rate'] = round(1000000 / $thisfile_riff_raw_avih['dwMicroSecPerFrame'], 3);
[796] Fix | Delete
$thisfile_video['frame_rate'] = $thisfile_riff_video_current['frame_rate'];
[797] Fix | Delete
}
[798] Fix | Delete
if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strh'][0]['data'])) {
[799] Fix | Delete
if (is_array($thisfile_riff['AVI ']['hdrl']['strl']['strh'])) {
[800] Fix | Delete
$thisfile_riff_raw_strf_strhfccType_streamindex = null;
[801] Fix | Delete
for ($i = 0; $i < count($thisfile_riff['AVI ']['hdrl']['strl']['strh']); $i++) {
[802] Fix | Delete
if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strh'][$i]['data'])) {
[803] Fix | Delete
$strhData = $thisfile_riff['AVI ']['hdrl']['strl']['strh'][$i]['data'];
[804] Fix | Delete
$strhfccType = substr($strhData, 0, 4);
[805] Fix | Delete
[806] Fix | Delete
if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strf'][$i]['data'])) {
[807] Fix | Delete
$strfData = $thisfile_riff['AVI ']['hdrl']['strl']['strf'][$i]['data'];
[808] Fix | Delete
[809] Fix | Delete
if (!isset($thisfile_riff_raw['strf'][$strhfccType][$streamindex])) {
[810] Fix | Delete
$thisfile_riff_raw['strf'][$strhfccType][$streamindex] = null;
[811] Fix | Delete
}
[812] Fix | Delete
// shortcut
[813] Fix | Delete
$thisfile_riff_raw_strf_strhfccType_streamindex = &$thisfile_riff_raw['strf'][$strhfccType][$streamindex];
[814] Fix | Delete
[815] Fix | Delete
switch ($strhfccType) {
[816] Fix | Delete
case 'auds':
[817] Fix | Delete
$thisfile_audio['bitrate_mode'] = 'cbr';
[818] Fix | Delete
$thisfile_audio_dataformat = 'wav';
[819] Fix | Delete
if (isset($thisfile_riff_audio) && is_array($thisfile_riff_audio)) {
[820] Fix | Delete
$streamindex = count($thisfile_riff_audio);
[821] Fix | Delete
}
[822] Fix | Delete
[823] Fix | Delete
$thisfile_riff_audio[$streamindex] = self::parseWAVEFORMATex($strfData);
[824] Fix | Delete
$thisfile_audio['wformattag'] = $thisfile_riff_audio[$streamindex]['raw']['wFormatTag'];
[825] Fix | Delete
[826] Fix | Delete
// shortcut
[827] Fix | Delete
$thisfile_audio['streams'][$streamindex] = $thisfile_riff_audio[$streamindex];
[828] Fix | Delete
$thisfile_audio_streams_currentstream = &$thisfile_audio['streams'][$streamindex];
[829] Fix | Delete
[830] Fix | Delete
if ($thisfile_audio_streams_currentstream['bits_per_sample'] == 0) {
[831] Fix | Delete
unset($thisfile_audio_streams_currentstream['bits_per_sample']);
[832] Fix | Delete
}
[833] Fix | Delete
$thisfile_audio_streams_currentstream['wformattag'] = $thisfile_audio_streams_currentstream['raw']['wFormatTag'];
[834] Fix | Delete
unset($thisfile_audio_streams_currentstream['raw']);
[835] Fix | Delete
[836] Fix | Delete
// shortcut
[837] Fix | Delete
$thisfile_riff_raw['strf'][$strhfccType][$streamindex] = $thisfile_riff_audio[$streamindex]['raw'];
[838] Fix | Delete
[839] Fix | Delete
unset($thisfile_riff_audio[$streamindex]['raw']);
[840] Fix | Delete
$thisfile_audio = getid3_lib::array_merge_noclobber($thisfile_audio, $thisfile_riff_audio[$streamindex]);
[841] Fix | Delete
[842] Fix | Delete
$thisfile_audio['lossless'] = false;
[843] Fix | Delete
switch ($thisfile_riff_raw_strf_strhfccType_streamindex['wFormatTag']) {
[844] Fix | Delete
case 0x0001: // PCM
[845] Fix | Delete
$thisfile_audio_dataformat = 'wav';
[846] Fix | Delete
$thisfile_audio['lossless'] = true;
[847] Fix | Delete
break;
[848] Fix | Delete
[849] Fix | Delete
case 0x0050: // MPEG Layer 2 or Layer 1
[850] Fix | Delete
$thisfile_audio_dataformat = 'mp2'; // Assume Layer-2
[851] Fix | Delete
break;
[852] Fix | Delete
[853] Fix | Delete
case 0x0055: // MPEG Layer 3
[854] Fix | Delete
$thisfile_audio_dataformat = 'mp3';
[855] Fix | Delete
break;
[856] Fix | Delete
[857] Fix | Delete
case 0x00FF: // AAC
[858] Fix | Delete
$thisfile_audio_dataformat = 'aac';
[859] Fix | Delete
break;
[860] Fix | Delete
[861] Fix | Delete
case 0x0161: // Windows Media v7 / v8 / v9
[862] Fix | Delete
case 0x0162: // Windows Media Professional v9
[863] Fix | Delete
case 0x0163: // Windows Media Lossess v9
[864] Fix | Delete
$thisfile_audio_dataformat = 'wma';
[865] Fix | Delete
break;
[866] Fix | Delete
[867] Fix | Delete
case 0x2000: // AC-3
[868] Fix | Delete
$thisfile_audio_dataformat = 'ac3';
[869] Fix | Delete
break;
[870] Fix | Delete
[871] Fix | Delete
case 0x2001: // DTS
[872] Fix | Delete
$thisfile_audio_dataformat = 'dts';
[873] Fix | Delete
break;
[874] Fix | Delete
[875] Fix | Delete
default:
[876] Fix | Delete
$thisfile_audio_dataformat = 'wav';
[877] Fix | Delete
break;
[878] Fix | Delete
}
[879] Fix | Delete
$thisfile_audio_streams_currentstream['dataformat'] = $thisfile_audio_dataformat;
[880] Fix | Delete
$thisfile_audio_streams_currentstream['lossless'] = $thisfile_audio['lossless'];
[881] Fix | Delete
$thisfile_audio_streams_currentstream['bitrate_mode'] = $thisfile_audio['bitrate_mode'];
[882] Fix | Delete
break;
[883] Fix | Delete
[884] Fix | Delete
[885] Fix | Delete
case 'iavs':
[886] Fix | Delete
case 'vids':
[887] Fix | Delete
// shortcut
[888] Fix | Delete
$thisfile_riff_raw['strh'][$i] = array();
[889] Fix | Delete
$thisfile_riff_raw_strh_current = &$thisfile_riff_raw['strh'][$i];
[890] Fix | Delete
[891] Fix | Delete
$thisfile_riff_raw_strh_current['fccType'] = substr($strhData, 0, 4); // same as $strhfccType;
[892] Fix | Delete
$thisfile_riff_raw_strh_current['fccHandler'] = substr($strhData, 4, 4);
[893] Fix | Delete
$thisfile_riff_raw_strh_current['dwFlags'] = $this->EitherEndian2Int(substr($strhData, 8, 4)); // Contains AVITF_* flags
[894] Fix | Delete
$thisfile_riff_raw_strh_current['wPriority'] = $this->EitherEndian2Int(substr($strhData, 12, 2));
[895] Fix | Delete
$thisfile_riff_raw_strh_current['wLanguage'] = $this->EitherEndian2Int(substr($strhData, 14, 2));
[896] Fix | Delete
$thisfile_riff_raw_strh_current['dwInitialFrames'] = $this->EitherEndian2Int(substr($strhData, 16, 4));
[897] Fix | Delete
$thisfile_riff_raw_strh_current['dwScale'] = $this->EitherEndian2Int(substr($strhData, 20, 4));
[898] Fix | Delete
$thisfile_riff_raw_strh_current['dwRate'] = $this->EitherEndian2Int(substr($strhData, 24, 4));
[899] Fix | Delete
$thisfile_riff_raw_strh_current['dwStart'] = $this->EitherEndian2Int(substr($strhData, 28, 4));
[900] Fix | Delete
$thisfile_riff_raw_strh_current['dwLength'] = $this->EitherEndian2Int(substr($strhData, 32, 4));
[901] Fix | Delete
$thisfile_riff_raw_strh_current['dwSuggestedBufferSize'] = $this->EitherEndian2Int(substr($strhData, 36, 4));
[902] Fix | Delete
$thisfile_riff_raw_strh_current['dwQuality'] = $this->EitherEndian2Int(substr($strhData, 40, 4));
[903] Fix | Delete
$thisfile_riff_raw_strh_current['dwSampleSize'] = $this->EitherEndian2Int(substr($strhData, 44, 4));
[904] Fix | Delete
$thisfile_riff_raw_strh_current['rcFrame'] = $this->EitherEndian2Int(substr($strhData, 48, 4));
[905] Fix | Delete
[906] Fix | Delete
$thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_riff_raw_strh_current['fccHandler']);
[907] Fix | Delete
$thisfile_video['fourcc'] = $thisfile_riff_raw_strh_current['fccHandler'];
[908] Fix | Delete
if (!$thisfile_riff_video_current['codec'] && isset($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']) && self::fourccLookup($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'])) {
[909] Fix | Delete
$thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']);
[910] Fix | Delete
$thisfile_video['fourcc'] = $thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'];
[911] Fix | Delete
}
[912] Fix | Delete
$thisfile_video['codec'] = $thisfile_riff_video_current['codec'];
[913] Fix | Delete
$thisfile_video['pixel_aspect_ratio'] = (float) 1;
[914] Fix | Delete
switch ($thisfile_riff_raw_strh_current['fccHandler']) {
[915] Fix | Delete
case 'HFYU': // Huffman Lossless Codec
[916] Fix | Delete
case 'IRAW': // Intel YUV Uncompressed
[917] Fix | Delete
case 'YUY2': // Uncompressed YUV 4:2:2
[918] Fix | Delete
$thisfile_video['lossless'] = true;
[919] Fix | Delete
break;
[920] Fix | Delete
[921] Fix | Delete
default:
[922] Fix | Delete
$thisfile_video['lossless'] = false;
[923] Fix | Delete
break;
[924] Fix | Delete
}
[925] Fix | Delete
[926] Fix | Delete
switch ($strhfccType) {
[927] Fix | Delete
case 'vids':
[928] Fix | Delete
$thisfile_riff_raw_strf_strhfccType_streamindex = self::ParseBITMAPINFOHEADER(substr($strfData, 0, 40), ($this->container == 'riff'));
[929] Fix | Delete
$thisfile_video['bits_per_sample'] = $thisfile_riff_raw_strf_strhfccType_streamindex['biBitCount'];
[930] Fix | Delete
[931] Fix | Delete
if ($thisfile_riff_video_current['codec'] == 'DV') {
[932] Fix | Delete
$thisfile_riff_video_current['dv_type'] = 2;
[933] Fix | Delete
}
[934] Fix | Delete
break;
[935] Fix | Delete
[936] Fix | Delete
case 'iavs':
[937] Fix | Delete
$thisfile_riff_video_current['dv_type'] = 1;
[938] Fix | Delete
break;
[939] Fix | Delete
}
[940] Fix | Delete
break;
[941] Fix | Delete
[942] Fix | Delete
default:
[943] Fix | Delete
$this->warning('Unhandled fccType for stream ('.$i.'): "'.$strhfccType.'"');
[944] Fix | Delete
break;
[945] Fix | Delete
[946] Fix | Delete
}
[947] Fix | Delete
}
[948] Fix | Delete
}
[949] Fix | Delete
[950] Fix | Delete
if (isset($thisfile_riff_raw_strf_strhfccType_streamindex) && isset($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'])) {
[951] Fix | Delete
[952] Fix | Delete
$thisfile_video['fourcc'] = $thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'];
[953] Fix | Delete
if (self::fourccLookup($thisfile_video['fourcc'])) {
[954] Fix | Delete
$thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_video['fourcc']);
[955] Fix | Delete
$thisfile_video['codec'] = $thisfile_riff_video_current['codec'];
[956] Fix | Delete
}
[957] Fix | Delete
[958] Fix | Delete
switch ($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']) {
[959] Fix | Delete
case 'HFYU': // Huffman Lossless Codec
[960] Fix | Delete
case 'IRAW': // Intel YUV Uncompressed
[961] Fix | Delete
case 'YUY2': // Uncompressed YUV 4:2:2
[962] Fix | Delete
$thisfile_video['lossless'] = true;
[963] Fix | Delete
//$thisfile_video['bits_per_sample'] = 24;
[964] Fix | Delete
break;
[965] Fix | Delete
[966] Fix | Delete
default:
[967] Fix | Delete
$thisfile_video['lossless'] = false;
[968] Fix | Delete
//$thisfile_video['bits_per_sample'] = 24;
[969] Fix | Delete
break;
[970] Fix | Delete
}
[971] Fix | Delete
[972] Fix | Delete
}
[973] Fix | Delete
}
[974] Fix | Delete
}
[975] Fix | Delete
}
[976] Fix | Delete
break;
[977] Fix | Delete
[978] Fix | Delete
[979] Fix | Delete
case 'AMV ':
[980] Fix | Delete
$info['fileformat'] = 'amv';
[981] Fix | Delete
$info['mime_type'] = 'video/amv';
[982] Fix | Delete
[983] Fix | Delete
$thisfile_video['bitrate_mode'] = 'vbr'; // it's MJPEG, presumably contant-quality encoding, thereby VBR
[984] Fix | Delete
$thisfile_video['dataformat'] = 'mjpeg';
[985] Fix | Delete
$thisfile_video['codec'] = 'mjpeg';
[986] Fix | Delete
$thisfile_video['lossless'] = false;
[987] Fix | Delete
$thisfile_video['bits_per_sample'] = 24;
[988] Fix | Delete
[989] Fix | Delete
$thisfile_audio['dataformat'] = 'adpcm';
[990] Fix | Delete
$thisfile_audio['lossless'] = false;
[991] Fix | Delete
break;
[992] Fix | Delete
[993] Fix | Delete
[994] Fix | Delete
// http://en.wikipedia.org/wiki/CD-DA
[995] Fix | Delete
case 'CDDA':
[996] Fix | Delete
$info['fileformat'] = 'cda';
[997] Fix | Delete
unset($info['mime_type']);
[998] Fix | Delete
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function