public function TranscoderAbstractionFactoryFfmpeg::adminSettings in Video 7.2
Admin settings form for the transcoder
Overrides TranscoderFactoryInterface::adminSettings
File
- transcoders/
TranscoderAbstractionFactoryFfmpeg.inc, line 487 - File containing class TranscoderAbstractionFactoryFfmpeg
Class
- TranscoderAbstractionFactoryFfmpeg
- Class that handles FFmpeg transcoding.
Code
public function adminSettings() {
$form = array();
$form['ffmpeg'] = array(
'#type' => 'fieldset',
'#title' => $this
->getName(),
'#collapsible' => FALSE,
'#collapsed' => FALSE,
'#states' => array(
'visible' => array(
':input[name=video_convertor]' => array(
'value' => 'TranscoderAbstractionFactoryFfmpeg',
),
),
),
);
$form['ffmpeg']['video_ffmpeg_path'] = array(
'#type' => 'textfield',
'#title' => t('Path to FFmpeg or avconv executable'),
'#description' => t('Absolute path to the FFmpeg or avconv executable.') . ' ' . t('When you install a new FFmpeg version, please <a href="@performance-page">clear the caches</a> to let Drupal detect the updated codec support.', array(
'@performance-page' => url('admin/config/development/performance'),
)),
'#default_value' => variable_get('video_ffmpeg_path', '/usr/bin/ffmpeg'),
);
// Video thumbnails
$form['ffmpeg']['video_thumbnail_path'] = array(
'#type' => 'textfield',
'#title' => t('Path to save thumbnails'),
'#description' => t('Path to save video thumbnails extracted from videos.'),
'#default_value' => variable_get('video_thumbnail_path', 'videos/thumbnails'),
);
$form['ffmpeg']['video_thumbnail_count'] = array(
'#type' => 'textfield',
'#title' => t('Number of thumbnails'),
'#description' => t('Number of thumbnails to extract from video.'),
'#default_value' => variable_get('video_thumbnail_count', 5),
'#size' => 5,
);
// Video conversion settings.
$form['ffmpeg']['helpers'] = array(
'#type' => 'fieldset',
'#title' => t('Helper programs'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['ffmpeg']['helpers']['video_ffmpeg_qtfaststart_path'] = array(
'#type' => 'textfield',
'#title' => t('Path to qt-faststart'),
'#default_value' => variable_get('video_ffmpeg_qtfaststart_path'),
'#description' => t('When you enter the path to @toolname here, it will be run after any @filetype files are transcoded. It improves the loading time of @filetype videos. On Linux, the default for this field is %default_value.', array(
'@toolname' => 'qt-faststart',
'@filetype' => 'MP4',
'%default_value' => '/usr/bin/qt-faststart',
)),
);
$form['ffmpeg']['helpers']['video_ffmpeg_flvtool2_path'] = array(
'#type' => 'textfield',
'#title' => t('Path to flvtool2'),
'#default_value' => variable_get('video_ffmpeg_flvtool2_path'),
'#description' => t('When you enter the path to @toolname here, it will be run after any @filetype files are transcoded. It improves the loading time of @filetype videos. On Linux, the default for this field is %default_value.', array(
'@toolname' => 'flvtool2',
'@filetype' => 'FLV',
'%default_value' => '/usr/bin/flvtool2',
)),
);
return $form;
}