/[drupal]/contributions/modules/video/plugins/video_ffmpeg_helper/video_render.php
ViewVC logotype

Diff of /contributions/modules/video/plugins/video_ffmpeg_helper/video_render.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.8.2.1, Wed May 27 01:48:28 2009 UTC revision 1.8.2.2, Mon Jun 1 01:10:32 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  //$Id$  //$Id: video_render.php,v 1.8.2.1 2009/05/27 01:48:28 heshanmw Exp $
3  /**  /**
4   * @file   * @file
5   * Renders a video. This script is called concurrently by video_scheduler.php   * Renders a video. This script is called concurrently by video_scheduler.php
# Line 19  Line 19 
19  /**  /**
20   * video_scheduler.php configuration   * video_scheduler.php configuration
21  */  */
   
22  // set to the ffmpeg executable  // set to the ffmpeg executable
23  define('VIDEO_RENDERING_FFMPEG_PATH', '/usr/bin/ffmpeg');  define('VIDEO_RENDERING_FFMPEG_PATH', '/home2/heidisof/bin/./ffmpeg');
24    
25  // set to the temp file path.  // set to the temp file path.
26  //IMPORTANT: the user who runs this script must have permissions to create files there. If this is not the case the default php temporary folder will be used.  //IMPORTANT: the user who runs this script must have permissions to create files there. If this is not the case the default php temporary folder will be used.
# Line 53  if (isset($_SERVER['argv'][3])) { Line 52  if (isset($_SERVER['argv'][3])) {
52    $_SERVER['HTTP_HOST'] = $url['host'];    $_SERVER['HTTP_HOST'] = $url['host'];
53  }  }
54    
55  module_load_include('/includes/bootstrap.inc', 'video_render', 'includes/bootstrap');  include_once('./includes/bootstrap.inc');
56    //module_load_include('/includes/bootstrap.inc', 'video_render', 'includes/bootstrap');
57  // disable error reporting for bootstrap process  // disable error reporting for bootstrap process
58  error_reporting(E_ERROR);  error_reporting(E_ERROR);
59  // let's bootstrap: we will be able to use drupal apis  // let's bootstrap: we will be able to use drupal apis
# Line 89  function video_render_main() { Line 89  function video_render_main() {
89    _video_render_job_change_status($nid, $vid, VIDEO_RENDERING_ACTIVE);    _video_render_job_change_status($nid, $vid, VIDEO_RENDERING_ACTIVE);
90    // load the job object    // load the job object
91    $job = _video_render_load_job($nid, $vid, VIDEO_RENDERING_ACTIVE);    $job = _video_render_load_job($nid, $vid, VIDEO_RENDERING_ACTIVE);
92    
93    if($job == NULL) {    if($job == NULL) {
94      watchdog('video_render', 'video_render.php has been called with an invalid job resource. exiting.');      watchdog('video_render', 'video_render.php has been called with an invalid job resource. exiting.');
95      die;      die;
# Line 130  function video_render_main() { Line 130  function video_render_main() {
130      $dest_dir = dirname($job->origfile) . '/';      $dest_dir = dirname($job->origfile) . '/';
131    
132      if (file_copy($file, $dest_dir)) {      if (file_copy($file, $dest_dir)) {
133        $file->fid = db_next_id('{files}_fid');        //$file->fid = db_next_id('{files}_fid');
134        //print_r($file);        //print_r($file);
135        db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize) VALUES (%d, %d, '%s', '%s', '%s', %d)", $file->fid, $job->nid, $file->filename, $file->filepath, $file->filemime, $file->filesize);        db_query("INSERT INTO {files} (fid, uid, filename, filepath, filemime, filesize) VALUES (%d, %d, '%s', '%s', '%s', %d)", $file->fid, $job->uid, $file->filename, $file->filepath, $file->filemime, $file->filesize);
136    
137          // to know other modules of fid
138          $file->fid = db_last_insert_id('files', 'fid');
139    
140        db_query("INSERT INTO {upload} (fid, vid, list, description) VALUES (%d, %d, %d, '%s')", $file->fid, $job->vid, $file->list, $file->description);        db_query("INSERT INTO {video_upload} (vid, nid, fid) VALUES (%d, %d, %d)", $job->vid, $job->vid, $file->fid);
141    
142        // update the video table        // update the video table
143        db_query('UPDATE {video} SET vidfile = "%s", videox = %d, videoy = %d WHERE nid=%d AND vid=%d', "", $job->calculatedx, $job->calculatedy, $job->nid, $job->vid);        db_query('UPDATE {video} SET vidfile = "%s", videox = %d, videoy = %d WHERE nid=%d AND vid=%d', "", $job->calculatedx, $job->calculatedy, $job->nid, $job->vid);

Legend:
Removed from v.1.8.2.1  
changed lines
  Added in v.1.8.2.2

  ViewVC Help
Powered by ViewVC 1.1.2