From 22ea3cf474ec42cf6272fb14a8916240295cff1a Mon Sep 17 00:00:00 2001 From: Heshan Date: Tue, 15 Mar 2011 20:08:28 +0530 Subject: Conversion of the videos are in and tested with mp4 and webm presets --- includes/conversion.inc | 18 ++++++------------ includes/preset.inc | 11 +++++++++-- includes/video_helper.inc | 10 ---------- 3 files changed, 15 insertions(+), 24 deletions(-) (limited to 'includes') diff --git a/includes/conversion.inc b/includes/conversion.inc index ae25245..493532e 100644 --- a/includes/conversion.inc +++ b/includes/conversion.inc @@ -5,16 +5,6 @@ * Class file to handle video conversion using ffmpeg and webservices. * */ -defined('VIDEO_RENDERING_PENDING') || - define('VIDEO_RENDERING_PENDING', 1); -defined('VIDEO_RENDERING_INQUEUE') || - define('VIDEO_RENDERING_INQUEUE', 2); -defined('VIDEO_RENDERING_ACTIVE') || - define('VIDEO_RENDERING_ACTIVE', 5); -defined('VIDEO_RENDERING_COMPLETE') || - define('VIDEO_RENDERING_COMPLETE', 10); -defined('VIDEO_RENDERING_FAILED') || - define('VIDEO_RENDERING_FAILED', 20); class video_conversion { @@ -69,14 +59,18 @@ class video_conversion { private function render($video) { if (!is_object($video)) { - watchdog('video_conversion', 'Video object is not present', array(), WATCHDOG_ERROR); + 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_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; } - return NULL; } /** diff --git a/includes/preset.inc b/includes/preset.inc index c2870a5..7709392 100644 --- a/includes/preset.inc +++ b/includes/preset.inc @@ -39,7 +39,12 @@ class video_preset { $preset[$value['name']] = $value['name'] . ' ' . l(t('edit'), ('admin/config/media/video/presets/preset/' . $value['name'])); // $help[] = $value['name'] . ' - ' . $value['description'] . ' ' . l(t('edit'), preset_get_preset_path('video', $value['name'])); } - + $form['video_use_preset_wxh'] = array( + '#type' => 'checkbox', + '#title' => t('Use preset WxH for video conversion.'), + '#default_value' => variable_get('video_use_preset_wxh', FALSE), + '#description' => t('Override the user selected WxH with the preset values. This is recommend.') + ); $form['video_preset'] = array( '#type' => 'checkboxes', '#title' => t('Video transcode presets'), @@ -67,7 +72,9 @@ class video_preset { $presets = array(); $preset = $this->preset; foreach ($preset as $preset_name) { - $presets[$preset_name] = video_get_preset($preset_name); + // skip selecting disabled presets 0=>0 + if (!empty($preset_name)) + $presets[$preset_name] = video_get_preset($preset_name); } return $presets; } diff --git a/includes/video_helper.inc b/includes/video_helper.inc index cd743c7..63d6f61 100644 --- a/includes/video_helper.inc +++ b/includes/video_helper.inc @@ -65,16 +65,6 @@ class video_helper { } } // Let othere module to load the video files by referance - // Lets find out if we have pushed this file to the cdn if enabled. - // @TODO : add correct filesystem load to this - $filesystem = variable_get('video_filesystem', 'drupal'); - if ($filesystem != 'drupal' && !module_exists('video_zencoder')) { - module_load_include('inc', 'video', '/includes/filesystem'); - $filesystem = new video_filesystem(); - $filesystem->load_file($video); - } - - // Moved to last to recheck incase we changed our extension above. $video->flash_player = variable_get('video_extension_' . $video->player . '_flash_player', ''); // Return our object -- cgit v1.2.3