Brion VIBBER has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/344887 )

Change subject: Apply '-slices' param to ffmpeg for VP8 output
......................................................................

Apply '-slices' param to ffmpeg for VP8 output

Creates multiple 'token partitions' in the bitstream allowing
decoders that support multithreaded decoding to do so more
efficiently.

Uses 2 partitions for low resolutions, 4 for HD, 8 for >HD.

Also cleaned up some definitions that were erroneously left
with old configs.

Change-Id: Ib2805e2e2bdd33c73cc25059b3e2d585db68c7e7
---
M WebVideoTranscode/WebVideoTranscode.php
M WebVideoTranscode/WebVideoTranscodeJob.php
2 files changed, 13 insertions(+), 19 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/87/344887/1

diff --git a/WebVideoTranscode/WebVideoTranscode.php 
b/WebVideoTranscode/WebVideoTranscode.php
index e34d22e..43cb37e 100644
--- a/WebVideoTranscode/WebVideoTranscode.php
+++ b/WebVideoTranscode/WebVideoTranscode.php
@@ -176,27 +176,12 @@
                                'maxSize'                    => '288x160',
                                'videoBitrate'               => '128',
                                'audioQuality'               => '-1',
-                               'samplerate'                 => '44100',
-                               'channels'                   => '2',
                                'noUpscaling'                => 'true',
                                'twopass'                    => 'true',
                                'keyframeInterval'           => '128',
                                'bufDelay'                   => '256',
                                'videoCodec'                 => 'vp8',
-                               'type'                       => 'video/webm; 
codecs="vp8, vorbis"',
-                       ],
-               WebVideoTranscode::ENC_WEBM_240P =>
-                       [
-                               'maxSize'                    => '426x240',
-                               'videoBitrate'               => '256',
-                               'audioQuality'               => '-1',
-                               'samplerate'                 => '44100',
-                               'channels'                   => '2',
-                               'noUpscaling'                => 'true',
-                               'twopass'                    => 'true',
-                               'keyframeInterval'           => '128',
-                               'bufDelay'                   => '256',
-                               'videoCodec'                 => 'vp8',
+                               'slices'                     => '2',
                                'type'                       => 'video/webm; 
codecs="vp8, vorbis"',
                        ],
                WebVideoTranscode::ENC_WEBM_240P =>
@@ -204,12 +189,12 @@
                                'maxSize'                    => '426x240',
                                'videoBitrate'               => '256',
                                'audioQuality'               => '1',
-                               'samplerate'                 => '44100',
                                'noUpscaling'                => 'true',
                                'twopass'                    => 'true',
                                'keyframeInterval'           => '128',
                                'bufDelay'                   => '256',
                                'videoCodec'                 => 'vp8',
+                               'slices'                     => '2',
                                'type'                       => 'video/webm; 
codecs="vp8, vorbis"',
                        ],
                WebVideoTranscode::ENC_WEBM_360P =>
@@ -217,12 +202,12 @@
                                'maxSize'                    => '640x360',
                                'videoBitrate'               => '512',
                                'audioQuality'               => '1',
-                               'samplerate'                 => '44100',
                                'noUpscaling'                => 'true',
                                'twopass'                    => 'true',
                                'keyframeInterval'           => '128',
                                'bufDelay'                   => '256',
                                'videoCodec'                 => 'vp8',
+                               'slices'                     => '2',
                                'type'                       => 'video/webm; 
codecs="vp8, vorbis"',
                        ],
                WebVideoTranscode::ENC_WEBM_480P =>
@@ -230,12 +215,12 @@
                                'maxSize'                    => '854x480',
                                'videoBitrate'               => '1024',
                                'audioQuality'               => '2',
-                               'samplerate'                 => '44100',
                                'noUpscaling'                => 'true',
                                'twopass'                    => 'true',
                                'keyframeInterval'           => '128',
                                'bufDelay'                   => '256',
                                'videoCodec'                 => 'vp8',
+                               'slices'                     => '4',
                                'type'                       => 'video/webm; 
codecs="vp8, vorbis"',
                        ],
                WebVideoTranscode::ENC_WEBM_720P =>
@@ -245,6 +230,7 @@
                                'audioQuality'               => 3,
                                'noUpscaling'                => 'true',
                                'videoCodec'                 => 'vp8',
+                               'slices'                     => '4',
                                'type'                       => 'video/webm; 
codecs="vp8, vorbis"',
                        ],
                WebVideoTranscode::ENC_WEBM_1080P =>
@@ -254,6 +240,7 @@
                                'audioQuality'               => 3,
                                'noUpscaling'                => 'true',
                                'videoCodec'                 => 'vp8',
+                               'slices'                     => '4',
                                'type'                       => 'video/webm; 
codecs="vp8, vorbis"',
                        ],
                WebVideoTranscode::ENC_WEBM_1440P =>
@@ -263,6 +250,7 @@
                                'audioQuality'               => 3,
                                'noUpscaling'                => 'true',
                                'videoCodec'                 => 'vp8',
+                               'slices'                     => '8',
                                'type'                       => 'video/webm; 
codecs="vp8, vorbis"',
                        ],
                WebVideoTranscode::ENC_WEBM_2160P =>
@@ -272,6 +260,7 @@
                                'audioQuality'               => 3,
                                'noUpscaling'                => 'true',
                                'videoCodec'                 => 'vp8',
+                               'slices'                     => '8',
                                'type'                       => 'video/webm; 
codecs="vp8, vorbis"',
                        ],
 
@@ -313,6 +302,7 @@
                                'bufDelay'                   => '256',
                                'videoCodec'                 => 'vp9',
                                'audioCodec'                 => 'opus',
+                               'tileColumns'                => '1',
                                'type'                       => 'video/webm; 
codecs="vp9, opus"',
                        ],
                WebVideoTranscode::ENC_VP9_480P =>
@@ -326,6 +316,7 @@
                                'bufDelay'                   => '256',
                                'videoCodec'                 => 'vp9',
                                'audioCodec'                 => 'opus',
+                               'tileColumns'                => '1',
                                'type'                       => 'video/webm; 
codecs="vp9, opus"',
                        ],
                WebVideoTranscode::ENC_VP9_720P =>
diff --git a/WebVideoTranscode/WebVideoTranscodeJob.php 
b/WebVideoTranscode/WebVideoTranscodeJob.php
index 8256d41..daeec79 100644
--- a/WebVideoTranscode/WebVideoTranscodeJob.php
+++ b/WebVideoTranscode/WebVideoTranscodeJob.php
@@ -558,6 +558,9 @@
                        }
                } else {
                        $cmd .= " -vcodec libvpx";
+                       if ( isset( $options['slices'] ) ) {
+                               $cmd .= ' -slices ' . wfEscapeShellArg( 
$options['slices'] );
+                       }
                }
 
                // Check for keyframeInterval

-- 
To view, visit https://gerrit.wikimedia.org/r/344887
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2805e2e2bdd33c73cc25059b3e2d585db68c7e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER <br...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to