You are here

public function video_ffmpeg::admin_settings in Video 6.4

Same name and namespace in other branches
  1. 7 transcoders/video_ffmpeg.inc \video_ffmpeg::admin_settings()

Interface Implementations

Overrides transcoder_interface::admin_settings

See also

sites/all/modules/video/includes/transcoder_interface#admin_settings()

File

transcoders/video_ffmpeg.inc, line 348

Class

video_ffmpeg

Code

public function admin_settings() {
  $form = array();
  $form['video_ffmpeg_start'] = array(
    '#type' => 'markup',
    '#value' => '<div id="video_ffmpeg">',
  );
  $form['video_transcoder_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Path to Video Transcoder'),
    '#description' => t('Absolute path to ffmpeg.'),
    '#default_value' => $this->cmdpath,
  );
  $form['video_thumbs'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of thumbnails'),
    '#description' => t('Number of thumbnails to display from video.'),
    '#default_value' => variable_get('video_thumbs', 5),
  );
  $form['video_ffmpeg_nice_enable'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable the use of nice when calling the ffmpeg command.'),
    '#default_value' => variable_get('video_ffmpeg_nice_enable', TRUE),
    '#description' => t('The nice command Invokes a command with an altered scheduling priority.  This option may not be available on windows machines, so disable it.'),
  );
  $form['video_ffmpeg_log_commands'] = array(
    '#type' => 'checkbox',
    '#title' => t('Log all executed commands to the Drupal log.'),
    '#default_value' => $this->logcommands,
    '#description' => t('Enable this option when debugging ffmpeg encoding to log all commands to the <a href="@dblog-page">Drupal log</a>. This may help with debugging ffmpeg problems. When this option is disabled, only errors will be logged.', array(
      '@dblog-page' => url('admin/reports/dblog'),
    )),
  );

  // Thumbnail Videos We need to put this stuff last.
  $form['autothumb'] = array(
    '#type' => 'fieldset',
    '#title' => t('Video Thumbnails'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['autothumb']['video_thumb_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Path to save thumbnails'),
    '#description' => t('Path to save video thumbnails extracted from the videos.'),
    '#default_value' => variable_get('video_thumb_path', 'video_thumbs'),
  );
  $form['autothumb']['advanced'] = array(
    '#type' => 'fieldset',
    '#title' => t('Advanced Settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['autothumb']['advanced']['video_ffmpeg_thumbnailer_options'] = array(
    '#type' => 'textarea',
    '#title' => t('Video thumbnailer options'),
    '#description' => t('Provide the options for the thumbnailer.  Available argument values are: ') . '<ol><li>' . t('!videofile (the video file to thumbnail)') . '<li>' . t('!thumbfile (a newly created temporary file to overwrite with the thumbnail)</ol>'),
    '#default_value' => $this->thumbcmdoptions,
    '#wysiwyg' => FALSE,
  );

  // Video conversion settings.
  $form['autoconv'] = array(
    '#type' => 'fieldset',
    '#title' => t('Video Conversion'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['autoconv']['video_ffmpeg_enable_faststart'] = array(
    '#type' => 'checkbox',
    '#title' => t('Process mov/mp4 videos with qt-faststart'),
    '#default_value' => $this->enablefaststart,
  );
  $form['autoconv']['video_ffmpeg_faststart_cmd'] = array(
    '#type' => 'textfield',
    '#title' => t('Path to qt-faststart'),
    '#default_value' => $this->faststartcmd,
  );
  $form['autoconv']['video_ffmpeg_pad_method'] = array(
    '#type' => 'radios',
    '#title' => t('FFmpeg Padding method'),
    '#default_value' => variable_get('video_ffmpeg_pad_method', 0),
    '#options' => array(
      0 => t('Use -padtop, -padbottom, -padleft, -padright for padding'),
      1 => t('Use -vf "pad=w:h:x:y:c" for padding'),
    ),
  );
  $form['video_ffmpeg_end'] = array(
    '#type' => 'markup',
    '#value' => '</div>',
  );
  return $form;
}