diff options
author | Mohamed Mujahid <muja_dd@494418.no-reply.drupal.org> | 2010-07-06 17:04:02 +0000 |
---|---|---|
committer | Mohamed Mujahid <muja_dd@494418.no-reply.drupal.org> | 2010-07-06 17:04:02 +0000 |
commit | 0c8e7ae689eed6291bb2061c9c75e3057b230339 (patch) | |
tree | f0a8ef699214db00367763ba5f30c748d106fd69 /includes/metadata.inc | |
parent | 8041073c8d74e5d24e3b9f10143f3e4bd04db2de (diff) | |
download | video-0c8e7ae689eed6291bb2061c9c75e3057b230339.tar.gz video-0c8e7ae689eed6291bb2061c9c75e3057b230339.tar.bz2 |
merging changes from DRUPAL-6--4
Diffstat (limited to 'includes/metadata.inc')
-rw-r--r-- | includes/metadata.inc | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/includes/metadata.inc b/includes/metadata.inc new file mode 100644 index 0000000..905a7fa --- /dev/null +++ b/includes/metadata.inc @@ -0,0 +1,57 @@ +<?php +//$Id$ +/* + * @file + * Class file used to store metadata on the video. + * + */ + +class video_metadata { + protected $params = array(); + protected $nice = 'nice -n 19'; + protected $meta_command = '-UP'; + protected $meta_command_path = '/usr/bin/flvtool2'; + + public function __construct() { + $this->params['cmd_path'] = variable_get('video_metadata_path', $this->meta_command_path); + } + + public function run_command($options) { + $command = $this->nice .' '. $this->params['cmd_path'].' '.$options.' 2>&1'; + watchdog('video_metadata', 'Executing command: '. $command, array(), WATCHDOG_DEBUG); + ob_start(); + passthru($command, $command_return); + $output = ob_get_contents(); + ob_end_clean(); + return $output; + } + + public function process($video) { + $command_output = $this->run_command($this->meta_command .' '. $video); + return $command_output; + } + + + public function admin_settings() { + $form = array(); + $form['video_metadata'] = array( + '#type' => 'checkbox', + '#title' => t('Enable Metadata'), + '#default_value' => variable_get('video_metadata', FALSE), + '#description' => t('Enables metadata for videos by using flvtool2. It cuts FLV files and adds cue Points (onCuePoint). If you are converting your files to FLV then this is highly recommended.'), + ); + $form['video_metadata_path'] = array( + '#type' => 'textfield', + '#title' => t('Path to FLVTool2'), + '#description' => t('Absolute path to flvtool2.'), + '#default_value' => variable_get('video_metadata_path', $this->meta_command_path), + ); + $form['video_metadata_dimensions'] = array( + '#type' => 'textarea', + '#title' => t('Selectable Dimensions when uploading videos.'), + '#description' => t('Enter one dimension per line as Video Resolutions. Each resolution must be in the form of WxH where W=Width and H=Height in pixels. Example dimensions are 1280x720.'), + '#default_value' => variable_get("video_metadata_dimensions", video_default_dimensions()), + ); + return $form; + } +}
\ No newline at end of file |