You are here

function ffmpeg_get_video_info in Video 6.3

Get some informations from the video file

2 calls to ffmpeg_get_video_info()
ffmpeg_auto_playtime in plugins/ffmpeg.inc
Return the playtime seconds of a video
ffmpeg_auto_resolution in plugins/ffmpeg.inc
Return the video resolution

File

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

Code

function ffmpeg_get_video_info($vidfile) {
  static $ffmpeg_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
  //  $ffmpeg_info[$vidfile['fid']] = $command_output;
  //    cache_set($vidfile['fid'], $command_output);
  //  }
  return $command_output;
}