Index: trunk/extensions/TimedMediaHandler/TimedMediaThumbnail.php |
— | — | @@ -21,14 +21,19 @@ |
22 | 22 | $cmd = wfEscapeShellArg( $wgFFmpegLocation ); |
23 | 23 | |
24 | 24 | $offset = intval( self::getThumbTime( $options ) ); |
25 | | - //seek 2 seconds before offset and seek in decoded stream, |
26 | | - //works around |
| 25 | + /* |
| 26 | + This is a workaround until ffmpegs ogg demuxer properly seeks to keyframes. |
| 27 | + Seek 2 seconds before offset and seek in decoded stream after that. |
| 28 | + -ss before input seeks without decode |
| 29 | + -ss after input seeks in decoded stream |
| 30 | + */ |
27 | 31 | if($offset > 2) { |
28 | 32 | $cmd .= ' -ss ' . ($offset - 2); |
29 | 33 | $offset = 2; |
30 | 34 | } |
31 | 35 | $cmd .= ' -i ' . wfEscapeShellArg( $options['file']->getPath() ); |
32 | 36 | $cmd .= ' -ss ' . $offset . ' '; |
| 37 | + |
33 | 38 | // Set the output size if set in options: |
34 | 39 | if( isset( $options['width'] ) && isset( $options['height'] ) ){ |
35 | 40 | $cmd.= ' -s '. intval( $options['width'] ) . 'x' . intval( $options['height'] ); |