Changeset 977945
- Timestamp:
- 09/03/2014 02:58:34 PM (12 years ago)
- Location:
- wp-video-posts/trunk
- Files:
-
- 5 edited
-
classes/wpvp-core-class.php (modified) (5 diffs)
-
classes/wpvp-helper-class.php (modified) (1 diff)
-
options/wpvp-options.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
-
wpvp.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-video-posts/trunk/classes/wpvp-core-class.php
r920053 r977945 223 223 */ 224 224 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; 225 228 $width = $this->options['thumb_width']; 226 229 $height = $this->options['thumb_height']; … … 230 233 $capture_image = $capture_image ? $capture_image : 5; 231 234 $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; 234 244 } 235 245 /** … … 240 250 global $encodeFormat; 241 251 $helper = new WPVP_Helper(); 252 $options = $helper->wpvp_get_full_options(); 253 $debug_mode = ($options['debug_mode']=='yes') ? true : false; 242 254 $helper->wpvp_dump($this->options); 243 255 $width = $this->options['video_width']; … … 253 265 $ffmpeg_vcodec=$this->options['wpvp_ffmpeg_vcodec']; 254 266 $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']; 256 268 257 269 $extra = $dimentions." "; … … 272 284 $extra.=' -vpre '.$ffmpeg_vpre; 273 285 } 274 if( $ffmpeg_other_flags!=0)286 if(!$ffmpeg_other_flags) 275 287 $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 281 297 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); 283 301 } 284 302 //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; 288 308 } 289 309 /** -
wp-video-posts/trunk/classes/wpvp-helper-class.php
r901149 r977945 57 57 */ 58 58 public function wpvp_check_extension($ext){ 59 $ffmpeg_path = get_option('wpvp_ffmpeg_path',''); 60 $mp4box_path = get_option('wpvp_mp4box_path',''); 59 61 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; 60 66 exec("which ".$ext,$output); 61 67 return $output; -
wp-video-posts/trunk/options/wpvp-options.php
r900625 r977945 14 14 $wpvp_capture_image = $_POST['wpvp_capture_image']; 15 15 $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; 17 19 $wpvp_debug_mode = $_POST['wpvp_debug_mode']; 18 20 $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; 22 30 /* FFMPEG options */ 23 31 $wpvp_ffmpeg_ar = isset($_POST['wpvp_ffmpeg_ar']) ? $_POST['wpvp_ffmpeg_ar'] : 44100; … … 28 36 $wpvp_ffmpeg_vcodec = isset($_POST['wpvp_ffmpeg_vcodec']) ? $_POST['wpvp_ffmpeg_vcodec'] : 'libx264'; 29 37 $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; 32 41 $wpvp_ffmpeg_options = array( 33 42 'ar'=>$wpvp_ffmpeg_ar, … … 64 73 $wpvp_capture_image = get_option('wpvp_capture_image',5)? get_option('wpvp_capture_image','5') : 5; 65 74 $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); 67 76 $wpvp_debug_mode = get_option('wpvp_debug_mode'); 68 77 $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); 72 81 /* FFMPEG options */ 73 82 $wpvp_ffmpeg_options = array(); … … 79 88 $wpvp_ffmpeg_acodec = isset($wpvp_ffmpeg_options['acodec']) ? $wpvp_ffmpeg_options['acodec'] : 'libfdk_aac'; 80 89 $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; 83 92 } 84 93 ?> … … 169 178 <p> 170 179 <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> 172 181 </p> 173 182 <p> -
wp-video-posts/trunk/readme.txt
r948860 r977945 4 4 Tags: video converter, video plugin, ffmpeg, video post 5 5 Requires at least: 3.2.2 6 Tested up to: 3.9. 16 Tested up to: 3.9.2 7 7 Stable tag: 3.1 8 8 … … 134 134 135 135 == 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 136 141 = 3.1.5 = 137 142 - Bug fixing for front end uploader. -
wp-video-posts/trunk/wpvp.php
r948860 r977945 4 4 Plugin URI: http://cmstactics.com 5 5 Description: 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. 56 Version: 3.1.6 7 7 Author: Alex Rayan, cmstactics 8 8 Author URI: http://cmstactics.com … … 24 24 * @var string WPVPMediaEncoder version 25 25 */ 26 public $version = '3.1. 5';26 public $version = '3.1.6'; 27 27 public static function init(){ 28 28 $class = __CLASS__; … … 64 64 add_action('pending_to_publish',array(&$this,'wpvp_draft_to_publish_notification'),20,1); 65 65 } 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){ 68 68 add_action('pre_get_posts',array(&$this,'wpvp_get_custom_video_posts'),1); 69 69 }
Note: See TracChangeset
for help on using the changeset viewer.