You are here

function video_admin_ffmpeg_info in Video 7.2

Page callback that displays FFmpeg information.

1 string reference to 'video_admin_ffmpeg_info'
video_ui_menu in modules/video_ui/video_ui.module
Implements hook_menu().

File

modules/video_ui/video.admin.inc, line 453
Provides the administration settings for the Video Drupal module.

Code

function video_admin_ffmpeg_info($form, $form_state) {
  $ffmpegpath = variable_get('video_ffmpeg_path', '/usr/bin/ffmpeg');
  if (isset($form_state['values']['ffmpegpath'])) {
    $ffmpegpath = $form_state['values']['ffmpegpath'];
  }
  $form['ffmpegpath'] = array(
    '#type' => 'textfield',
    '#title' => t('Path to FFmpeg or avconv executable'),
    '#default_value' => variable_get('video_ffmpeg_path', '/usr/bin/ffmpeg'),
    '#required' => TRUE,
  );
  $form['actions']['#type'] = 'actions';
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Show information'),
  );
  if (file_exists($ffmpegpath) && is_executable($ffmpegpath)) {
    $transcoder = new PHPVideoToolkit($ffmpegpath, realpath(file_directory_temp()) . '/');
    $info = $transcoder
      ->getFFmpegInfo(FALSE);
    $infotxt = var_export($info, TRUE);
    $form['info'] = array(
      '#type' => 'textarea',
      '#title' => t('Debug information'),
      '#value' => $infotxt,
      '#weight' => 1000,
      '#rows' => min(20, substr_count($infotxt, "\n")),
    );
  }
  return $form;
}