Plugin Directory

Changeset 977945


Ignore:
Timestamp:
09/03/2014 02:58:34 PM (12 years ago)
Author:
cmstactics
Message:

Added option for MP4Box path specification. Added extension path to extension check. Added encoding commands output for debug purposes. Updated to version 3.1.6 with these advanced options and debugging checks.

Location:
wp-video-posts/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wp-video-posts/trunk/classes/wpvp-core-class.php

    r920053 r977945  
    223223    */
    224224    protected function wpvp_convert_thumb($source,$target){
     225        $helper = new WPVP_Helper();
     226        $options = $helper->wpvp_get_full_options();
     227        $debug_mode = ($options['debug_mode']=='yes') ? true : false;
    225228        $width = $this->options['thumb_width'];
    226229        $height = $this->options['thumb_height'];
     
    230233        $capture_image = $capture_image ? $capture_image : 5;
    231234        $extra = '-vframes 1 '.$dimensions.' -ss '.$capture_image.' -f image2';
    232         $str = $ffmpeg_path."ffmpeg -y -i ".$source." ". $extra ." ".$target;   
    233         return exec($str);
     235        $str = $ffmpeg_path."ffmpeg -y -i ".$source." ". $extra ." ".$target." 2>&1";
     236        if($debug_mode)
     237            $helper->wpvp_dump('Image conversion command: '.$str);
     238        $output = shell_exec($str);
     239        if($debug_mode){
     240            $helper->wpvp_dump('Image conversion output:');
     241            $helper->wpvp_dump($output);
     242        }
     243        return;
    234244    }
    235245    /**
     
    240250        global $encodeFormat;
    241251        $helper = new WPVP_Helper();
     252        $options = $helper->wpvp_get_full_options();
     253        $debug_mode = ($options['debug_mode']=='yes') ? true : false;
    242254        $helper->wpvp_dump($this->options);
    243255        $width = $this->options['video_width'];
     
    253265        $ffmpeg_vcodec=$this->options['wpvp_ffmpeg_vcodec'];
    254266        $ffmpeg_vpre=$this->options['wpvp_ffmpeg_vpre'];
    255         $ffmpeg_other_flags=$this->options['wpvp_ffmpeg_other_flags'];
     267        $ffmpeg_other_flags=(int)$this->options['wpvp_ffmpeg_other_flags'];
    256268       
    257269        $extra = $dimentions." ";
     
    272284                $extra.=' -vpre '.$ffmpeg_vpre;
    273285        }
    274         if($ffmpeg_other_flags!=0)
     286        if(!$ffmpeg_other_flags)
    275287            $extra.= " -refs 1 -coder 1 -level 31 -threads 8 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -flags +mv4 -trellis 1 -cmp 256 -me_range 16 -sc_threshold 40 -i_qfactor 0.71 -bf 0 -g 250";
    276         $str = $ffmpeg_path."ffmpeg -i ".$source." $extra ".$target;
    277         $helper = new WPVP_Helper();
    278         $helper->wpvp_dump($str);
    279         exec($str);
    280         //check for the file. If not created, attempt to execute a simplier command
     288        $str = $ffmpeg_path."ffmpeg -i ".$source." $extra ".$target." 2>&1";
     289        if($debug_mode)
     290            $helper->wpvp_dump('Video conversion command: '.$str);
     291        $output = shell_exec($str);
     292        if($debug_mode){
     293            $helper->wpvp_dump('Video conversion output:');
     294            $helper->wpvp_dump($output);
     295        }
     296        //check for the file. If not created, attempt to execute a simpler command
    281297        if(!file_exists($target)){
    282             exec($ffmpeg_path."ffmpeg -i ".$source.$dimensions." ".$ffmpeg_acodec." ".$ffmpeg_vcodec." ".$target);
     298            $output = shell_exec($ffmpeg_path."ffmpeg -i ".$source.$dimensions." ".$ffmpeg_acodec." ".$ffmpeg_vcodec." ".$target." 2>&1");
     299            if($debug_mode)
     300                $helper->wpvp_dump($output);
    283301        }
    284302        //in case of MP4Box is installed, execute command to move the video data to the front
    285         $prepare = "MP4Box -inter 100  ".$target;
    286         exec($prepare);
    287         return 1;
     303        $prepare = "MP4Box -inter 100  ".$target." 2>&1";
     304        $output = shell_exec($prepare);
     305        if($debug_mode)
     306            $helper->wpvp_dump($output);
     307        return;
    288308    }
    289309    /**
  • wp-video-posts/trunk/classes/wpvp-helper-class.php

    r901149 r977945  
    5757    */
    5858    public function wpvp_check_extension($ext){
     59        $ffmpeg_path = get_option('wpvp_ffmpeg_path','');
     60        $mp4box_path = get_option('wpvp_mp4box_path','');
    5961        if($this->wpvp_check_function('exec')){
     62            if($ext=='ffmpeg')
     63                $ext = $ffmpeg_path.$ext;
     64            else if($ext=='MP4Box')
     65                $ext = $mp4box_path.$ext;
    6066            exec("which ".$ext,$output);
    6167            return $output;
  • wp-video-posts/trunk/options/wpvp-options.php

    r900625 r977945  
    1414    $wpvp_capture_image = $_POST['wpvp_capture_image'];
    1515    $wpvp_ffmpeg_path = $_POST['wpvp_ffmpeg_path'];
    16     $wpvp_main_loop_alter = $_POST['wpvp_main_loop_alter'];
     16    $wpvp_main_loop_alter = 0;
     17    if(isset($_POST['wpvp_main_loop_alter'])&&$_POST['wpvp_main_loop_alter']=='yes')
     18        $wpvp_main_loop_alter = 1;
    1719    $wpvp_debug_mode = $_POST['wpvp_debug_mode'];
    1820    $wpvp_player = $_POST['wpvp_player'];
    19     $wpvp_autoplay = ($_POST['wpvp_autoplay']=='yes') ? true : false;
    20     $wpvp_splash = ($_POST['wpvp_splash']=='yes') ? true : false;
    21     $wpvp_clean_url = ($_POST['wpvp_clean_url']=='yes') ? true : false;
     21    $wpvp_autoplay= 0;
     22    if(isset($_POST['wpvp_autoplay'])&&$_POST['wpvp_autoplay']=='yes')
     23        $wpvp_autoplay= 1;
     24    $wpvp_splash = 0;
     25    if(isset($_POST['wpvp_splash'])&&$_POST['wpvp_splash']=='yes')
     26        $wpvp_splash = 1;
     27    $wpvp_clean_url = 0;
     28    if(isset($_POST['wpvp_clean_url'])&&$_POST['wpvp_clean_url']=='yes')
     29        $wpvp_clean_url = 1;
    2230    /* FFMPEG options */
    2331    $wpvp_ffmpeg_ar = isset($_POST['wpvp_ffmpeg_ar']) ? $_POST['wpvp_ffmpeg_ar'] : 44100;
     
    2836    $wpvp_ffmpeg_vcodec = isset($_POST['wpvp_ffmpeg_vcodec']) ? $_POST['wpvp_ffmpeg_vcodec'] : 'libx264';
    2937    $wpvp_ffmpeg_vpre = isset($_POST['wpvp_ffmpeg_vpre']) ? $_POST['wpvp_ffmpeg_vpre'] : false;
    30     $wpvp_other_flags = ($_POST['wpvp_other_flags']=='yes') ? true : false;
    31    
     38    $wpvp_other_flags = 0;
     39    if(isset($_POST['wpvp_other_flags'])&&$_POST['wpvp_other_flags']=='yes')
     40        $wpvp_other_flags = 1;
    3241    $wpvp_ffmpeg_options = array(
    3342        'ar'=>$wpvp_ffmpeg_ar,
     
    6473    $wpvp_capture_image = get_option('wpvp_capture_image',5)? get_option('wpvp_capture_image','5') : 5;
    6574    $wpvp_ffmpeg_path = get_option('wpvp_ffmpeg_path');
    66     $wpvp_main_loop_alter = get_option('wpvp_main_loop_alter','yes') ? get_option('wpvp_main_loop_alter','yes') : 'yes';
     75    $wpvp_main_loop_alter = get_option('wpvp_main_loop_alter',1);
    6776    $wpvp_debug_mode = get_option('wpvp_debug_mode');
    6877    $wpvp_player = get_option('wpvp_player','videojs') ? get_option('wpvp_player','videojs') : 'videojs';
    69     $wpvp_autoplay = get_option('wpvp_autoplay',false) ? get_option('wpvp_autoplay',false) : false;
    70     $wpvp_splash = get_option('wpvp_splash',true) ? get_option('wpvp_splash',true) : true;
    71     $wpvp_clean_url = get_option('wpvp_clean_url',false) ? get_option('wpvp_clean_url',false) : false;
     78    $wpvp_autoplay = get_option('wpvp_autoplay',0);
     79    $wpvp_splash = get_option('wpvp_splash',1);
     80    $wpvp_clean_url = get_option('wpvp_clean_url',0);
    7281    /* FFMPEG options */
    7382    $wpvp_ffmpeg_options = array();
     
    7988    $wpvp_ffmpeg_acodec = isset($wpvp_ffmpeg_options['acodec']) ? $wpvp_ffmpeg_options['acodec'] : 'libfdk_aac';
    8089    $wpvp_ffmpeg_vcodec = isset($wpvp_ffmpeg_options['vcodec']) ? $wpvp_ffmpeg_options['vcodec'] : 'libx264';
    81     $wpvp_ffmpeg_vpre = isset($wpvp_ffmpeg_options['vpre']) ? $wpvp_ffmpeg_options['vpre'] : false;
    82     $wpvp_other_flags = isset($wpvp_ffmpeg_options['other_flags']) ? $wpvp_ffmpeg_options['other_flags'] : false;
     90    $wpvp_ffmpeg_vpre = isset($wpvp_ffmpeg_options['vpre']) ? $wpvp_ffmpeg_options['vpre'] : 0;
     91    $wpvp_other_flags = isset($wpvp_ffmpeg_options['other_flags']) ? $wpvp_ffmpeg_options['other_flags'] : 0;
    8392}
    8493?>
     
    169178        <p>
    170179            <strong><?php _e('Video posts within the main loop (e.g. latest posts, tags, categories, etc.)');?></strong>
    171             <p><input type="checkbox" name="wpvp_main_loop_alter" value="yes"<?php if($wpvp_main_loop_alter=='yes'){ echo ' checked="checked"';}?> /> <?php _e('display the video posts');?></p>
     180            <p><input type="checkbox" name="wpvp_main_loop_alter" value="yes"<?php if($wpvp_main_loop_alter){ echo ' checked="checked"';}?> /> <?php _e('display the video posts');?></p>
    172181        </p>
    173182        <p>
  • wp-video-posts/trunk/readme.txt

    r948860 r977945  
    44Tags: video converter, video plugin, ffmpeg, video post
    55Requires at least: 3.2.2
    6 Tested up to: 3.9.1
     6Tested up to: 3.9.2
    77Stable tag: 3.1
    88
     
    134134
    135135== Changelog ==
     136= 3.1.6 =
     137- Added option for MP4Box path specification.
     138- Added extension path to extension check.
     139- Added encoding commands output for debug purposes.
     140
    136141= 3.1.5 =
    137142- Bug fixing for front end uploader.
  • wp-video-posts/trunk/wpvp.php

    r948860 r977945  
    44Plugin URI: http://cmstactics.com
    55Description: WP Video Posts creates a custom post for uploaded videos. You can upload videos of different formats (FLV, F4V, MP4, AVI, MOV, 3GP and WMV) and the plugin will convert it to MP4 and play it using Flowplayer. 
    6 Version: 3.1.5
     6Version: 3.1.6
    77Author: Alex Rayan, cmstactics
    88Author URI: http://cmstactics.com
     
    2424    * @var string WPVPMediaEncoder version
    2525    */
    26     public $version = '3.1.5';
     26    public $version = '3.1.6';
    2727    public static function init(){
    2828        $class = __CLASS__;
     
    6464                add_action('pending_to_publish',array(&$this,'wpvp_draft_to_publish_notification'),20,1);
    6565        }
    66         $wpvp_main_loop_alter = get_option('wpvp_main_loop_alter','yes');
    67         if($wpvp_main_loop_alter == 'yes'){
     66        $wpvp_main_loop_alter = get_option('wpvp_main_loop_alter',1);
     67        if($wpvp_main_loop_alter){
    6868            add_action('pre_get_posts',array(&$this,'wpvp_get_custom_video_posts'),1);
    6969        }
Note: See TracChangeset for help on using the changeset viewer.