You are here

function _video_render_get_command in Video 6

Same name and namespace in other branches
  1. 5 plugins/video_ffmpeg_helper/video_render.php \_video_render_get_command()
  2. 6.2 plugins/video_ffmpeg_helper/video_render.php \_video_render_get_command()

Get a string cointaining the command to be executed including options

1 call to _video_render_get_command()
video_render_main in plugins/video_ffmpeg_helper/video_render.php

File

plugins/video_ffmpeg_helper/video_render.php, line 188
Renders a video. This script is called concurrently by video_scheduler.php This script has to be launched with "php video_render.php nid vid" If you are not using sites/default/settings.php as your settings file, add an optional parameter…

Code

function _video_render_get_command(&$job) {
  $videofile = escapeshellarg($job->origfile);

  // escape file name for safety
  $convfile = tempnam(VIDEO_RENDERING_TEMP_PATH, 'video-rendering');
  $audiobitrate = variable_get('video_ffmpeg_helper_auto_cvr_audio_bitrate', 64);
  $videobitrate = variable_get('video_ffmpeg_helper_auto_cvr_video_bitrate', 200);
  $size = _video_render_get_size($job);
  $converter = VIDEO_RENDERING_FFMPEG_PATH;
  $options = preg_replace(array(
    '/%videofile/',
    '/%convertfile/',
    '/%audiobitrate/',
    '/%size/',
    '/%videobitrate/',
  ), array(
    $videofile,
    $convfile,
    $audiobitrate,
    $size,
    $videobitrate,
  ), variable_get('video_ffmpeg_helper_auto_cvr_options', '-y -i %videofile -f flv -ar 22050 -ab %audiobitrate -s %size -b %videobitrate -qscale 1 %convertfile'));

  // set to the converted file output
  $job->convfile = $convfile;
  return VIDEO_RENDERING_NICE . " {$converter} {$options}";
}