Index: trunk/extensions/TimedMediaHandler/TimedMediaThumbnail.php |
— | — | @@ -20,8 +20,15 @@ |
21 | 21 | |
22 | 22 | $cmd = wfEscapeShellArg( $wgFFmpegLocation ); |
23 | 23 | |
24 | | - $cmd .= ' -ss ' . intval( self::getThumbTime( $options ) ); |
| 24 | + $offset = intval( self::getThumbTime( $options ) ); |
| 25 | + //seek 2 seconds before offset and seek in decoded stream, |
| 26 | + //works around |
| 27 | + if($offset > 2) { |
| 28 | + $cmd .= ' -ss ' . ($offset - 2); |
| 29 | + $offset = 2; |
| 30 | + } |
25 | 31 | $cmd .= ' -i ' . wfEscapeShellArg( $options['file']->getPath() ); |
| 32 | + $cmd .= ' -ss ' . $offset . ' '; |
26 | 33 | // Set the output size if set in options: |
27 | 34 | if( isset( $options['width'] ) && isset( $options['height'] ) ){ |
28 | 35 | $cmd.= ' -s '. intval( $options['width'] ) . 'x' . intval( $options['height'] ); |