You are here

public function video_localcommand::get_dimensions in Video 6.5

Return the dimensions of a video

Overrides video_transcoder::get_dimensions

1 call to video_localcommand::get_dimensions()
video_localcommand::convert_video in transcoders/video_localcommand.inc
Convert the given video.

File

transcoders/video_localcommand.inc, line 318

Class

video_localcommand

Code

public function get_dimensions($filepath) {
  $output = $this
    ->get_video_info($filepath);
  $match = array();
  if (preg_match('#(\\d{2,4})x(\\d{2,4})#', $output, $match)) {
    return array(
      'width' => intval($match[1]),
      'height' => intval($match[2]),
    );
  }
  return NULL;
}