function ffmpeg_wrapper_get_video_info in Video 6.3
Get some informations from the video file
1 call to ffmpeg_wrapper_get_video_info()
- ffmpeg_wrapper_auto_playtime in plugins/
ffmpeg_wrapper.inc - Return the playtime seconds of a video
File
- plugins/
ffmpeg_wrapper.inc, line 42 - Provide a api for video conversion and auto thumbnailing using ffmpeg.
Code
function ffmpeg_wrapper_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;
}