Index: trunk/extensions/TimedMediaHandler/TimedMediaTransformOutput.php |
— | — | @@ -83,27 +83,28 @@ |
84 | 84 | |
85 | 85 | function getImagePopUp(){ |
86 | 86 | return Xml::tags( 'div' , array( |
87 | | - 'id' => "ogg_thumbplayer_" . TimedMediaTransformOutput::$serial++, |
88 | | - 'class' => 'PopUpMediaTransform', |
89 | | - 'style' => "width:" . intval( $this->width ) . "px;height:" . |
90 | | - intval( $this->getPlayerHeight() ) . "px", |
91 | | - 'data-videopayload' => $this->getXmlMediaTagOutput( $this->getPopupPlayerSize() ), |
| 87 | + 'id' => "ogg_thumbplayer_" . TimedMediaTransformOutput::$serial++, |
| 88 | + 'class' => 'PopUpMediaTransform', |
| 89 | + 'style' => "width:" . intval( $this->width ) . "px;height:" . |
| 90 | + intval( $this->getPlayerHeight() ) . "px", |
| 91 | + 'data-videopayload' => $this->getXmlMediaTagOutput( $this->getPopupPlayerSize() ), |
92 | 92 | ), |
93 | | - Xml::tags( 'img', array( |
94 | | - 'style' => 'width:100%;height:100%;', |
95 | | - 'src' => $this->getUrl(), |
96 | | - ),'') |
97 | | - . |
98 | | - // For javascript disabled browsers provide a link to the asset: |
99 | | - Xml::tags( 'a', array( |
| 93 | + Xml::tags( 'img', array( |
| 94 | + 'style' => 'width:100%;height:100%;', |
| 95 | + 'src' => $this->getUrl(), |
| 96 | + ),'') |
| 97 | + . |
| 98 | + // For javascript disabled browsers provide a link to the asset: |
| 99 | + Xml::tags( 'a', array( |
100 | 100 | 'href'=> $this->file->getUrl(), |
101 | 101 | 'title' => wfMsg( 'timedmedia-play-media' ) |
102 | 102 | ), '<b></b>'. // why is the a child tag escaped unless there is an html string prefix? |
103 | | - Xml::tags( 'div', array( |
| 103 | + Xml::tags( 'div', array( |
104 | 104 | 'target' => '_new', |
105 | 105 | 'class' => 'play-btn-large' |
106 | | - ), '') |
| 106 | + ), '' |
107 | 107 | ) |
| 108 | + ) |
108 | 109 | ); |
109 | 110 | } |
110 | 111 | |
Index: trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscodeJob.php |
— | — | @@ -152,24 +152,24 @@ |
153 | 153 | $cmd.= $this->ffmpegAddVideoOptions( $file, $target, $options, $pass ); |
154 | 154 | } |
155 | 155 | |
156 | | - // Check for start time |
| 156 | + // Check for start time |
157 | 157 | if( isset( $options['starttime'] ) ){ |
158 | 158 | $cmd.= ' -ss ' . wfEscapeShellArg( $options['starttime'] ); |
159 | 159 | } else { |
160 | 160 | $options['starttime'] = 0; |
161 | 161 | } |
162 | | - // Check for end time: |
163 | | - if( isset( $options['endtime'] ) ){ |
164 | | - $cmd.= ' -t ' . intval( $options['endtime'] ) - intval($options['starttime'] ) ; |
165 | | - } |
166 | | - |
167 | | - if ( $pass == 1 || isset( $options['noaudio'] ) ) { |
168 | | - $cmd.= ' -an'; |
169 | | - } else { |
170 | | - $cmd.= $this->ffmpegAddAudioOptions( $file, $target, $options, $pass ); |
171 | | - } |
| 162 | + // Check for end time: |
| 163 | + if( isset( $options['endtime'] ) ){ |
| 164 | + $cmd.= ' -t ' . intval( $options['endtime'] ) - intval($options['starttime'] ) ; |
| 165 | + } |
172 | 166 | |
173 | | - // Output WebM |
| 167 | + if ( $pass == 1 || isset( $options['noaudio'] ) ) { |
| 168 | + $cmd.= ' -an'; |
| 169 | + } else { |
| 170 | + $cmd.= $this->ffmpegAddAudioOptions( $file, $target, $options, $pass ); |
| 171 | + } |
| 172 | + |
| 173 | + // Output WebM |
174 | 174 | $cmd.=" -f webm"; |
175 | 175 | |
176 | 176 | if ( $pass != 0 ) { |
— | — | @@ -230,56 +230,56 @@ |
231 | 231 | // Get size transform ( if maxSize is > file, file size is used: |
232 | 232 | list( $width, $height ) = WebVideoTranscode::getMaxSizeTransform( $file, $options['maxSize'] ); |
233 | 233 | $cmd.= ' -s ' . intval( $width ) . 'x' . intval( $height ); |
234 | | - } else if ( |
235 | | - (isset( $options['width'] ) && $options['width'] > 0 ) |
| 234 | + } else if ( |
| 235 | + (isset( $options['width'] ) && $options['width'] > 0 ) |
236 | 236 | && |
237 | 237 | (isset( $options['height'] ) && $options['height'] > 0 ) |
238 | | - ){ |
| 238 | + ){ |
239 | 239 | $cmd.= ' -s ' . intval( $options['width'] ) . 'x' . intval( $options['height'] ); |
240 | | - } |
241 | | - |
| 240 | + } |
| 241 | + |
242 | 242 | // Handle crop: |
243 | | - $optionMap = array( |
244 | | - 'cropTop' => '-croptop', |
245 | | - 'cropBottom' => '-cropbottom', |
246 | | - 'cropLeft' => '-cropleft', |
247 | | - 'cropRight' => '-cropright' |
248 | | - ); |
249 | | - foreach( $optionMap as $name => $cmdArg ){ |
250 | | - if( isset($options[$name]) ){ |
251 | | - $cmd.= " $cmdArg " . wfEscapeShellArg( $options[$name] ); |
252 | | - } |
253 | | - } |
254 | | - |
255 | | - // Check for keyframeInterval |
256 | | - if( isset( $options['keyframeInterval'] ) ){ |
257 | | - $cmd.= ' -g ' . wfEscapeShellArg( $options['keyframeInterval'] ); |
258 | | - $cmd.= ' -keyint_min ' . wfEscapeShellArg( $options['keyframeInterval'] ); |
259 | | - } |
260 | | - if( isset( $options['deinterlace'] ) ){ |
261 | | - $cmd.= ' -deinterlace'; |
262 | | - } |
263 | | - |
264 | | - return $cmd; |
| 243 | + $optionMap = array( |
| 244 | + 'cropTop' => '-croptop', |
| 245 | + 'cropBottom' => '-cropbottom', |
| 246 | + 'cropLeft' => '-cropleft', |
| 247 | + 'cropRight' => '-cropright' |
| 248 | + ); |
| 249 | + foreach( $optionMap as $name => $cmdArg ){ |
| 250 | + if( isset($options[$name]) ){ |
| 251 | + $cmd.= " $cmdArg " . wfEscapeShellArg( $options[$name] ); |
| 252 | + } |
| 253 | + } |
| 254 | + |
| 255 | + // Check for keyframeInterval |
| 256 | + if( isset( $options['keyframeInterval'] ) ){ |
| 257 | + $cmd.= ' -g ' . wfEscapeShellArg( $options['keyframeInterval'] ); |
| 258 | + $cmd.= ' -keyint_min ' . wfEscapeShellArg( $options['keyframeInterval'] ); |
| 259 | + } |
| 260 | + if( isset( $options['deinterlace'] ) ){ |
| 261 | + $cmd.= ' -deinterlace'; |
| 262 | + } |
| 263 | + |
| 264 | + return $cmd; |
265 | 265 | } |
266 | | - |
| 266 | + |
267 | 267 | function ffmpegAddAudioOptions( $file, $target, $options, $pass){ |
268 | 268 | $cmd =''; |
269 | 269 | if( isset( $options['audioQuality'] ) ){ |
270 | 270 | $cmd.= " -aq " . wfEscapeShellArg( $options['audioQuality'] ); |
271 | 271 | } |
272 | 272 | if( isset( $options['audioBitrate'] )){ |
273 | | - $cmd.= ' -ab ' . intval( $options['audioBitrate'] ) * 1000; |
274 | | - } |
275 | | - if( isset( $options['samplerate'] ) ){ |
276 | | - $cmd.= " -ar " . wfEscapeShellArg( $options['samplerate'] ); |
277 | | - } |
278 | | - if( isset( $options['channels'] )){ |
279 | | - $cmd.= " -ac " . wfEscapeShellArg( $options['channels'] ); |
280 | | - } |
281 | | - // Always use vorbis for audio: |
282 | | - $cmd.= " -acodec libvorbis "; |
283 | | - return $cmd; |
| 273 | + $cmd.= ' -ab ' . intval( $options['audioBitrate'] ) * 1000; |
| 274 | + } |
| 275 | + if( isset( $options['samplerate'] ) ){ |
| 276 | + $cmd.= " -ar " . wfEscapeShellArg( $options['samplerate'] ); |
| 277 | + } |
| 278 | + if( isset( $options['channels'] )){ |
| 279 | + $cmd.= " -ac " . wfEscapeShellArg( $options['channels'] ); |
| 280 | + } |
| 281 | + // Always use vorbis for audio: |
| 282 | + $cmd.= " -acodec libvorbis "; |
| 283 | + return $cmd; |
284 | 284 | } |
285 | 285 | |
286 | 286 | |
Index: trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | 'bufDelay' => '128', |
63 | 63 | 'videoCodec' => 'theora', |
64 | 64 | ), |
65 | | - WebVideoTranscode::ENC_OGV_4MBS => |
| 65 | + WebVideoTranscode::ENC_OGV_4MBS => |
66 | 66 | array( |
67 | 67 | 'maxSize' => '360', |
68 | 68 | 'videoBitrate' => '368', |