Changeset 1000707
- Timestamp:
- 10/02/2014 03:21:39 PM (12 years ago)
- Location:
- wp-video-posts/trunk
- Files:
-
- 4 edited
-
classes/wpvp-core-class.php (modified) (5 diffs)
-
options/wpvp-options.php (modified) (7 diffs)
-
readme.txt (modified) (1 diff)
-
wpvp.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-video-posts/trunk/classes/wpvp-core-class.php
r977945 r1000707 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;228 225 $width = $this->options['thumb_width']; 229 226 $height = $this->options['thumb_height']; … … 233 230 $capture_image = $capture_image ? $capture_image : 5; 234 231 $extra = '-vframes 1 '.$dimensions.' -ss '.$capture_image.' -f image2'; 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; 232 $str = $ffmpeg_path."ffmpeg -y -i ".$source." ". $extra ." ".$target; 233 return exec($str); 244 234 } 245 235 /** … … 250 240 global $encodeFormat; 251 241 $helper = new WPVP_Helper(); 252 $options = $helper->wpvp_get_full_options();253 $debug_mode = ($options['debug_mode']=='yes') ? true : false;254 242 $helper->wpvp_dump($this->options); 255 243 $width = $this->options['video_width']; … … 265 253 $ffmpeg_vcodec=$this->options['wpvp_ffmpeg_vcodec']; 266 254 $ffmpeg_vpre=$this->options['wpvp_ffmpeg_vpre']; 267 $ffmpeg_other_flags= (int)$this->options['wpvp_ffmpeg_other_flags'];255 $ffmpeg_other_flags=$this->options['wpvp_ffmpeg_other_flags']; 268 256 269 257 $extra = $dimentions." "; … … 284 272 $extra.=' -vpre '.$ffmpeg_vpre; 285 273 } 286 if( !$ffmpeg_other_flags)274 if($ffmpeg_other_flags!=0) 287 275 $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"; 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 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 297 281 if(!file_exists($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); 282 exec($ffmpeg_path."ffmpeg -i ".$source.$dimensions." ".$ffmpeg_acodec." ".$ffmpeg_vcodec." ".$target); 301 283 } 302 284 //in case of MP4Box is installed, execute command to move the video data to the front 303 $prepare = "MP4Box -inter 100 ".$target." 2>&1"; 304 $output = shell_exec($prepare); 305 if($debug_mode) 306 $helper->wpvp_dump($output); 307 return; 285 $prepare = "MP4Box -inter 100 ".$target; 286 exec($prepare); 287 return 1; 308 288 } 309 289 /** -
wp-video-posts/trunk/options/wpvp-options.php
r977945 r1000707 14 14 $wpvp_capture_image = $_POST['wpvp_capture_image']; 15 15 $wpvp_ffmpeg_path = $_POST['wpvp_ffmpeg_path']; 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; 16 $wpvp_mp4box_path = $_POST['wpvp_mp4box_path']; 17 $wpvp_main_loop_alter = $_POST['wpvp_main_loop_alter']; 19 18 $wpvp_debug_mode = $_POST['wpvp_debug_mode']; 20 19 $wpvp_player = $_POST['wpvp_player']; 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; 20 $wpvp_autoplay = ($_POST['wpvp_autoplay']=='yes') ? true : false; 21 $wpvp_splash = ($_POST['wpvp_splash']=='yes') ? true : false; 22 $wpvp_clean_url = ($_POST['wpvp_clean_url']=='yes') ? true : false; 30 23 /* FFMPEG options */ 31 24 $wpvp_ffmpeg_ar = isset($_POST['wpvp_ffmpeg_ar']) ? $_POST['wpvp_ffmpeg_ar'] : 44100; … … 36 29 $wpvp_ffmpeg_vcodec = isset($_POST['wpvp_ffmpeg_vcodec']) ? $_POST['wpvp_ffmpeg_vcodec'] : 'libx264'; 37 30 $wpvp_ffmpeg_vpre = isset($_POST['wpvp_ffmpeg_vpre']) ? $_POST['wpvp_ffmpeg_vpre'] : false; 38 $wpvp_other_flags = 0; 39 if(isset($_POST['wpvp_other_flags'])&&$_POST['wpvp_other_flags']=='yes') 40 $wpvp_other_flags = 1; 31 $wpvp_other_flags = ($_POST['wpvp_other_flags']=='yes') ? true : false; 32 41 33 $wpvp_ffmpeg_options = array( 42 34 'ar'=>$wpvp_ffmpeg_ar, … … 57 49 update_option('wpvp_capture_image', $wpvp_capture_image); 58 50 update_option('wpvp_ffmpeg_path', $wpvp_ffmpeg_path); 51 update_option('wpvp_mp4box_path', $wpvp_mp4box_path); 59 52 update_option('wpvp_main_loop_alter', $wpvp_main_loop_alter); 60 53 update_option('wpvp_debug_mode', $wpvp_debug_mode); … … 73 66 $wpvp_capture_image = get_option('wpvp_capture_image',5)? get_option('wpvp_capture_image','5') : 5; 74 67 $wpvp_ffmpeg_path = get_option('wpvp_ffmpeg_path'); 75 $wpvp_main_loop_alter = get_option('wpvp_main_loop_alter',1); 68 $wpvp_mp4box_path = get_option('wpvp_mp4box_path'); 69 $wpvp_main_loop_alter = get_option('wpvp_main_loop_alter','yes') ? get_option('wpvp_main_loop_alter','yes') : 'yes'; 76 70 $wpvp_debug_mode = get_option('wpvp_debug_mode'); 77 71 $wpvp_player = get_option('wpvp_player','videojs') ? get_option('wpvp_player','videojs') : 'videojs'; 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 $wpvp_autoplay = get_option('wpvp_autoplay',false) ? get_option('wpvp_autoplay',false) : false; 73 $wpvp_splash = get_option('wpvp_splash',true) ? get_option('wpvp_splash',true) : true; 74 $wpvp_clean_url = get_option('wpvp_clean_url',false) ? get_option('wpvp_clean_url',false) : false; 81 75 /* FFMPEG options */ 82 76 $wpvp_ffmpeg_options = array(); … … 88 82 $wpvp_ffmpeg_acodec = isset($wpvp_ffmpeg_options['acodec']) ? $wpvp_ffmpeg_options['acodec'] : 'libfdk_aac'; 89 83 $wpvp_ffmpeg_vcodec = isset($wpvp_ffmpeg_options['vcodec']) ? $wpvp_ffmpeg_options['vcodec'] : 'libx264'; 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;84 $wpvp_ffmpeg_vpre = isset($wpvp_ffmpeg_options['vpre']) ? $wpvp_ffmpeg_options['vpre'] : false; 85 $wpvp_other_flags = isset($wpvp_ffmpeg_options['other_flags']) ? $wpvp_ffmpeg_options['other_flags'] : false; 92 86 } 93 87 ?> … … 147 141 </p> 148 142 <p> 143 <strong><?php _e("Path to MP4Box installation (optional): " ); ?></strong> 144 <input type="text" name="wpvp_mp4box_path" value="<?php echo $wpvp_mp4box_path; ?>" size="25" /> <?php _e("(example: /usr/local/bin/)"); ?> 145 </p> 146 <p> 149 147 <strong><?php _e("Converted video width: " ); ?></strong> 150 148 <input type="text" class="wpvp_input_short" name="wpvp_video_width" value="<?php echo $wpvp_width; ?>" size="5" /> <?php _e("(in pixels) Default 640px"); ?> … … 178 176 <p> 179 177 <strong><?php _e('Video posts within the main loop (e.g. latest posts, tags, categories, etc.)');?></strong> 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>178 <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> 181 179 </p> 182 180 <p> -
wp-video-posts/trunk/readme.txt
r977945 r1000707 134 134 135 135 == Changelog == 136 = 3.1.7 = 137 - Incorrect update for 3.1.6 fix. 138 136 139 = 3.1.6 = 137 140 - Added option for MP4Box path specification. 138 141 - Added extension path to extension check. 139 - Added encoding commands output for debug purposes.140 142 141 143 = 3.1.5 = -
wp-video-posts/trunk/wpvp.php
r977945 r1000707 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. 66 Version: 3.1.7 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. 6';26 public $version = '3.1.7'; 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', 1);67 if($wpvp_main_loop_alter ){66 $wpvp_main_loop_alter = get_option('wpvp_main_loop_alter','yes'); 67 if($wpvp_main_loop_alter == 'yes'){ 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.