You are here

function _video_render_get_size in Video 6

Same name and namespace in other branches
  1. 5 plugins/video_ffmpeg_helper/video_render.php \_video_render_get_size()
  2. 6.2 plugins/video_ffmpeg_helper/video_render.php \_video_render_get_size()
  3. 6.3 plugins/ffmpeg.inc \_video_render_get_size()

Calculate the converted video size basing on the width set on administration. Aspect ration is maintained.

1 call to _video_render_get_size()
_video_render_get_command in plugins/video_ffmpeg_helper/video_render.php
Get a string cointaining the command to be executed including options

File

plugins/video_ffmpeg_helper/video_render.php, line 212
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_size(&$job) {
  $def_width = variable_get('video_ffmpeg_helper_auto_cvr_width', 400);
  $height = $def_width * ($job->videoy / $job->videox);

  // do you remember proportions?? :-)
  $height = round($height);

  // add one if odd
  if ($height % 2) {
    $height++;
  }
  $job->calculatedx = $def_width;
  $job->calculatedy = $height;
  return $def_width . 'x' . $height;
}