<?php $default = izap_is_win_izap_videos() ? elgg_get_plugins_path() . '' . GLOBAL_IZAP_VIDEOS_PLUGIN . '/ffmpeg/bin/ffmpeg.exe' . ' -y -i [inputVideoPath] -vcodec libx264 -vpre ' . elgg_get_plugins_path() . '' . GLOBAL_IZAP_VIDEOS_PLUGIN . '/ffmpeg/presets/libx264-hq.ffpreset' . ' -b 300k -bt 300k -ar 22050 -ab 48k -s 400x400 [outputVideoPath]' : exec("which ffmpeg") . ' -y -i [inputVideoPath] [outputVideoPath]'; $saved_command = elgg_get_plugin_setting('izapVideoCommand', 'izap-videos'); echo elgg_view('input/text', array('name' => 'params[izapVideoCommand]', 'value' => $saved_command ? $saved_command : $default)); ?> </label> </p> <p> <label> <?php echo elgg_echo('izap_videos:adminSettings:izapVideoThumb'); ?> <br /> <?php $default_setting = izap_is_win_izap_videos() ? elgg_get_plugins_path() . '' . GLOBAL_IZAP_VIDEOS_PLUGIN . '/ffmpeg/bin/ffmpeg.exe' . ' -y -i [inputVideoPath] -vframes 1 -ss 00:00:10 -an -vcodec png -f rawvideo -s 320x240 [outputImage]' : exec("which ffmpeg") . ' -y -i [inputVideoPath] -vframes 1 -ss 00:00:10 -an -vcodec png -f rawvideo -s 320x240 [outputImage]'; $thumbnail_cmd = elgg_get_plugin_setting('izapVideoThumb', 'izap-videos'); echo elgg_view('input/text', array('name' => 'params[izapVideoThumb]', 'value' => $thumbnail_cmd ? $thumbnail_cmd : $default_setting)); ?> </label> </p> <!--Onserver and Youtube Settings Start Here--> <div> <label><?php echo elgg_echo('izap_videos:adminSettings:onServerVideos'); ?> </label> <?php echo elgg_view('input/radio', array('name' => 'params[Onserver_enabled_izap_videos]', 'id' => 'onserver', 'value' => izap_plugin_setting(array('name' => 'Onserver_enabled_izap_videos', 'plugin' => GLOBAL_IZAP_VIDEOS_PLUGIN, 'value' => 'no')), 'options' => array(elgg_echo('izap-videos:adminSettings:my-server') => 'yes', elgg_echo('izap-videos:adminSettings:youtube-server') => 'youtube', elgg_echo('izap-videos:adminSettings:disable') => 'no'))); ?>
/** * This function triggers the queue * * @version 5.0 */ function izap_trigger_video_queue() { $PHPpath = izap_get_php_path_izap_videos(); $file_path = elgg_get_plugins_path() . GLOBAL_IZAP_VIDEOS_PLUGIN . '/izap_convert_video.php'; if (!izap_is_queue_running_izap_videos()) { if (izap_is_win_izap_videos()) { pclose(popen("start \"MyProcess\" \"cmd /C " . $PHPpath . " " . $file_path, "r")); } else { exec($PHPpath . ' ' . $file_path . ' izap web > /dev/null 2>&1 &', $output); } } }