function zencoder_auto_resolution in Video 6.3
Return the video resolution
File
- plugins/
zencoder.inc, line 78  - Provide a api for video conversion and auto thumbnailing using ffmpeg.
 
Code
function zencoder_auto_resolution(&$node) {
  if (!variable_get('video_zencoder_helper_auto_resolution', false)) {
    // call ffmpeg -i
    $zencoder_output = zencoder_get_video_info($node);
    // get resolution
    $pattern = '/Video: .*, ([0-9]{2,4}x[0-9]{2,4})/';
    preg_match_all($pattern, $zencoder_output, $matches, PREG_PATTERN_ORDER);
    $resolution = $matches[1][0];
    return explode("x", $resolution);
  }
  return null;
}