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

Change subject: Make number of threads a configuration option
......................................................................


Make number of threads a configuration option

Bug: 54060
Change-Id: I609dfc9a00662b14961b3e4bc7ef8b8f01370f88
---
M TimedMediaHandler.php
M WebVideoTranscode/WebVideoTranscodeJob.php
2 files changed, 7 insertions(+), 2 deletions(-)

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



diff --git a/TimedMediaHandler.php b/TimedMediaHandler.php
index a3e93b2..ba8f21a 100644
--- a/TimedMediaHandler.php
+++ b/TimedMediaHandler.php
@@ -91,6 +91,9 @@
 // Maximum file size transcoding processes can create, in KB
 $wgTranscodeBackgroundSizeLimit = 3 * 1024 * 1024; // 3GB
 
+// Number of threads to use in avconv for transcoding
+$wgFFmpegThreads = 1;
+
 // The location of ffmpeg2theora (transcoding)
 $wgFFmpeg2theoraLocation = '/usr/bin/ffmpeg2theora';
 
diff --git a/WebVideoTranscode/WebVideoTranscodeJob.php 
b/WebVideoTranscode/WebVideoTranscodeJob.php
index 62a4078..19e63c4 100644
--- a/WebVideoTranscode/WebVideoTranscodeJob.php
+++ b/WebVideoTranscode/WebVideoTranscodeJob.php
@@ -387,8 +387,9 @@
         * @return string
         */
        function ffmpegAddH264VideoOptions( $options, $pass ){
+               global $wgFFmpegThreads;
                // Set the codec:
-               $cmd= " -threads 1 -vcodec libx264";
+               $cmd= " -threads " . intval( $wgFFmpegThreads ) . " -vcodec 
libx264";
                // Check for presets:
                if( isset( $options['preset'] ) ){
                        // Add the two vpre types:
@@ -460,11 +461,12 @@
         * @return string
         */
        function ffmpegAddWebmVideoOptions( $options, $pass ){
+               global $wgFFmpegThreads;
 
                // Get a local pointer to the file object
                $file = $this->getFile();
 
-               $cmd =' -threads 1';
+               $cmd =' -threads ' . intval( $wgFFmpegThreads );
 
                // check for presets:
                if( isset($options['preset']) ){

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I609dfc9a00662b14961b3e4bc7ef8b8f01370f88
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: J <jger...@wikimedia.org>
Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org>
Gerrit-Reviewer: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to