You are here

function zencoder_get_video_info in Video 6.3

Get some informations from the video file

2 calls to zencoder_get_video_info()
zencoder_auto_playtime in plugins/zencoder.inc
Return the playtime seconds of a video
zencoder_auto_resolution in plugins/zencoder.inc
Return the video resolution

File

plugins/zencoder.inc, line 50
Provide a api for video conversion and auto thumbnailing using ffmpeg.

Code

function zencoder_get_video_info($vidfile) {
  static $zencoder_info;
  $fid = $vidfile['fid'];

  //  $command_output = cache_get($fid);
  //  if(empty($command_output)) {
  // escape file name for safety
  $file = escapeshellarg($vidfile['filepath']);

  // create the full command to execute
  $command = variable_get('video_transcoder_path', '/usr/bin/ffmpeg') . ' -i ' . $file;

  //execute the command
  ob_start();
  passthru($command . " 2>&1", $command_return);
  $command_output = ob_get_contents();
  ob_end_clean();

  // cache the result for further calls
  //  $zencoder_info[$vidfile['fid']] = $command_output;
  //    cache_set($vidfile['fid'], $command_output);
  //  }
  return $command_output;
}