jenkins-bot has submitted this change and it was merged.

Change subject: Add a config switch for Theora 2-pass encoding
......................................................................


Add a config switch for Theora 2-pass encoding

Patching back and forth as we find bugs is too painful for testing.
Defaulting to theora 2-pass encoding *off* (the safer option), but
now much easier to turn it on to test.

To enable, add to LocalSettings:

  $wgTmhTheoraTwoPassEncoding = true;

and reset transcodes at will. This will produce better-quality
.ogv transcodes at the cost of additional encoding time and opening
you up to exciting bugs in libtheora.

Bug: T115881
Change-Id: I8165408f6fe96df6e72c6a52f5f410565c28d4bb
---
M TimedMediaHandler.hooks.php
M TimedMediaHandler.php
M WebVideoTranscode/WebVideoTranscode.php
3 files changed, 22 insertions(+), 7 deletions(-)

Approvals:
  TheDJ: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php
index 2f083ef..f345ba9 100644
--- a/TimedMediaHandler.hooks.php
+++ b/TimedMediaHandler.hooks.php
@@ -14,7 +14,7 @@
                $wgMediaHandlers, $wgResourceModules, 
$wgExcludeFromThumbnailPurge, $wgExtraNamespaces,
                $wgParserOutputHooks, $wgTimedTextNS, $wgFileExtensions, 
$wgTmhEnableMp4Uploads,
                $wgExtensionAssetsPath, $wgMwEmbedModuleConfig, $timedMediaDir,
-               $wgEnableLocalTimedText, $wgTmhFileExtensions;
+               $wgEnableLocalTimedText, $wgTmhFileExtensions, 
$wgTmhTheoraTwoPassEncoding;
 
                // Remove mp4 if not enabled:
                if( $wgTmhEnableMp4Uploads === false ){
@@ -24,6 +24,15 @@
                        }
                }
 
+               // Enable experimental 2-pass Theora encoding if enabled:
+               if( $wgTmhTheoraTwoPassEncoding ) {
+                       foreach( WebVideoTranscode::$derivativeSettings as $key 
=> &$settings ) {
+                               if( isset( $settings['videoCodec'] ) && 
$settings['videoCodec'] === 'theora' ) {
+                                       $settings['twopass'] = 'true';
+                               }
+                       }
+               }
+
                if( !class_exists( 'MwEmbedResourceManager' ) ) {
                        echo "TimedMediaHandler requires the MwEmbedSupport 
extension.\n";
                        exit( 1 );
diff --git a/TimedMediaHandler.php b/TimedMediaHandler.php
index 7713c83..040dff0 100644
--- a/TimedMediaHandler.php
+++ b/TimedMediaHandler.php
@@ -201,6 +201,12 @@
 // If mp4 source assets can be ingested:
 $wgTmhEnableMp4Uploads = false;
 
+// Two-pass encoding for .ogv Theora transcodes is flaky as of October 2015.
+// Enable this only if testing with latest theora libraries!
+// See tracking bug: https://phabricator.wikimedia.org/T115883
+//
+$wgTmhTheoraTwoPassEncoding = false;
+
 /******************* CONFIGURATION ENDS HERE **********************/
 
 
diff --git a/WebVideoTranscode/WebVideoTranscode.php 
b/WebVideoTranscode/WebVideoTranscode.php
index 03481ac..e3e4545 100644
--- a/WebVideoTranscode/WebVideoTranscode.php
+++ b/WebVideoTranscode/WebVideoTranscode.php
@@ -81,7 +81,7 @@
                                'samplerate'                 => '44100',
                                'channels'                   => '2',
                                'noUpscaling'                => 'true',
-                               'twopass'                    => 'true',
+                               'twopass'                    => 'false', // 
will be overridden by $wgTmhTheoraTwoPassEncoding
                                'optimize'                   => 'true',
                                'keyframeInterval'           => '128',
                                'bufDelay'                   => '256',
@@ -96,7 +96,7 @@
                                'samplerate'                 => '44100',
                                'channels'                   => '2',
                                'noUpscaling'                => 'true',
-                               'twopass'                    => 'true',
+                               'twopass'                    => 'false', // 
will be overridden by $wgTmhTheoraTwoPassEncoding
                                'optimize'                   => 'true',
                                'keyframeInterval'           => '128',
                                'bufDelay'                   => '256',
@@ -111,7 +111,7 @@
                                'samplerate'                 => '44100',
                                'channels'                   => '2',
                                'noUpscaling'                => 'true',
-                               'twopass'                    => 'true',
+                               'twopass'                    => 'false', // 
will be overridden by $wgTmhTheoraTwoPassEncoding
                                'optimize'                   => 'true',
                                'keyframeInterval'           => '128',
                                'bufDelay'                   => '256',
@@ -126,7 +126,7 @@
                                'samplerate'                 => '44100',
                                'channels'                   => '2',
                                'noUpscaling'                => 'true',
-                               'twopass'                    => 'true',
+                               'twopass'                    => 'false', // 
will be overridden by $wgTmhTheoraTwoPassEncoding
                                'optimize'                   => 'true',
                                'keyframeInterval'           => '128',
                                'bufDelay'                   => '256',
@@ -140,7 +140,7 @@
                                'videoQuality'               => 6,
                                'audioQuality'               => 3,
                                'noUpscaling'                => 'true',
-                               'twopass'                    => 'true',
+                               'twopass'                    => 'false', // 
will be overridden by $wgTmhTheoraTwoPassEncoding
                                'optimize'                   => 'true',
                                'keyframeInterval'           => '128',
                                'videoCodec'                 => 'theora',
@@ -153,7 +153,7 @@
                                'videoQuality'               => 6,
                                'audioQuality'               => 3,
                                'noUpscaling'                => 'true',
-                               'twopass'                    => 'true',
+                               'twopass'                    => 'false', // 
will be overridden by $wgTmhTheoraTwoPassEncoding
                                'optimize'                   => 'true',
                                'keyframeInterval'           => '128',
                                'videoCodec'                 => 'theora',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8165408f6fe96df6e72c6a52f5f410565c28d4bb
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER <[email protected]>
Gerrit-Reviewer: TheDJ <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to