You are here

private function video_conversion::render in Video 7

Same name and namespace in other branches
  1. 6.4 includes/conversion.inc \video_conversion::render()
1 call to video_conversion::render()
video_conversion::process in includes/conversion.inc
Process the video through ffmpeg.

File

includes/conversion.inc, line 61

Class

video_conversion

Code

private function render($video) {
  if (!is_object($video)) {
    watchdog('transcoder', 'Video object is not present', array(), WATCHDOG_ERROR);
    return FALSE;
  }

  // Make sure this video is pending or do nothing.
  if ($video->video_status == VIDEO_RENDERING_PENDING) {
    return $this->transcoder
      ->convert_video($video);
  }
  else {
    $status = array(
      VIDEO_RENDERING_INQUEUE => 'in queue',
      VIDEO_RENDERING_COMPLETE => 'completed',
      VIDEO_RENDERING_FAILED => 'failed',
    );
    watchdog('transcoder', 'Video conversion has been !status. You should add video to the queue. Please check the re-queue to enable the video conversion.', array(
      '!status' => $status[$video->video_status],
    ), WATCHDOG_WARNING);
    return FALSE;
  }
}