You are here

public function PHPVideoToolkit::getAvailableFormats in Video 7.2

Same name and namespace in other branches
  1. 7 libraries/phpvideotoolkit/phpvideotoolkit.php5.php \PHPVideoToolkit::getAvailableFormats()

Returns the available formats. @access public

Parameters

mixed $method The mux method to check for, either 'muxing', 'demuxing' or 'both' (formats that can both mux and demux), otherwise FALSE will return a complete list.:

Return value

array An array of formats available to ffmpeg.

File

libraries/phpvideotoolkit/phpvideotoolkit.php5.php, line 2668
Libary to access FFmpeg

Class

PHPVideoToolkit

Code

public function getAvailableFormats($method = FALSE) {
  $info = $this
    ->getFFmpegInfo();
  $return_vals = array();
  switch ($method) {
    case FALSE:
      return array_keys($info['formats']);
    case 'both':
      foreach ($info['formats'] as $id => $data) {
        if ($data['mux'] === TRUE && $data['demux'] === TRUE) {
          array_push($return_vals, $id);
        }
      }
      break;
    case 'muxing':
      foreach ($info['formats'] as $id => $data) {
        if ($data['mux'] === TRUE) {
          array_push($return_vals, $id);
        }
      }
      break;
    case 'demuxing':
      foreach ($info['formats'] as $id => $data) {
        if ($data['demux'] === TRUE) {
          array_push($return_vals, $id);
        }
      }
      break;
  }
  return $return_vals;
}