. $file_name . '" 2> /dev/null', 'r');
$tag = NULL;
+ $codec_type = NULL;
while ( ($r = fgets($h, 512)) !== FALSE)
{
if ($tag == 'FORMAT')
{
- // Duration
- if (preg_match('/^duration=/', $r))
- $duration = format_duration(floatval(_parse_value($r)));
-
// Size
if (preg_match('/^size=/', $r))
$size = intval(_parse_value ($r));
// DAR
if (preg_match('/^display_aspect_ratio=/', $r))
$dar = _parse_value($r);
+
+ // Codec Type
+ if (preg_match('/^codec_type=/', $r))
+ $codec_type = _parse_value($r);
+
+ // Duration
+ if (preg_match('/^duration=/', $r)
+ && strcmp($codec_type, 'video') == 0)
+ $duration = format_duration(floatval(_parse_value($r)));
}
}
}
// Eliminate formats with duplicate resolutions.
- if ($elim_dupl_res)
- {
- for ($i = 1; $i < count($transcode_configs); $i++)
- {
- if ($transcode_configs[$i]['v_resolution']
- === $transcode_configs[$i - 1]['v_resolution'])
- {
- unset($transcode_configs[$i - 1]);
- unset($db_formats[$i - 1]);
- $i--;
- }
- }
- }
+// if ($elim_dupl_res)
+// {
+// for ($i = 1; $i < count($transcode_configs); $i++)
+// {
+// if ($transcode_configs[$i]['v_resolution']
+// === $transcode_configs[$i - 1]['v_resolution'])
+// {
+// unset($transcode_configs[$i - 1]);
+// unset($db_formats[$i - 1]);
+// $i--;
+// }
+// }
+// }
return array('transcode_configs'=>$transcode_configs,
'db_formats'=>$db_formats);