Brion VIBBER has uploaded a new change for review.
https://gerrit.wikimedia.org/r/229397
Change subject: Work in progress: WebM VP9/Opus transcodes
......................................................................
Work in progress: WebM VP9/Opus transcodes
Adds transcode definitions for VP9/Opus transcodes at half the
video bitrate of VP8/Vorbis.
Not yet enabled by default. Requires ffmpeg or avconv with vp9
and opus support compiled in.
The player does not yet recognize these as playable, but they
work in latest Firefox and Chrome directly.
Bug: T63805
Change-Id: Idbea47fbde2a8862084a7e77eb1ca928083d5b85
---
M WebVideoTranscode/WebVideoTranscode.php
M WebVideoTranscode/WebVideoTranscodeJob.php
M i18n/en.json
M i18n/qqq.json
4 files changed, 84 insertions(+), 4 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler
refs/changes/97/229397/1
diff --git a/WebVideoTranscode/WebVideoTranscode.php
b/WebVideoTranscode/WebVideoTranscode.php
index 82db8c9..0afc485 100644
--- a/WebVideoTranscode/WebVideoTranscode.php
+++ b/WebVideoTranscode/WebVideoTranscode.php
@@ -33,12 +33,18 @@
const ENC_OGV_720P = '720p.ogv';
const ENC_OGV_1080P = '1080p.ogv';
- // WebM profiles:
+ // WebM VP8/Vorbis profiles:
const ENC_WEBM_160P = '160p.webm';
const ENC_WEBM_360P = '360p.webm';
const ENC_WEBM_480P = '480p.webm';
const ENC_WEBM_720P = '720p.webm';
const ENC_WEBM_1080P = '1080p.webm';
+
+ // WebM VP9/Opus profiles:
+ const ENC_WEBM_VP9_360P = '360p.vp9.webm';
+ const ENC_WEBM_VP9_480P = '480p.vp9.webm';
+ const ENC_WEBM_VP9_720P = '720p.vp9.webm';
+ const ENC_WEBM_VP9_1080P = '1080p.vp9.webm';
// mp4 profiles:
const ENC_H264_320P = '320p.mp4';
@@ -203,6 +209,60 @@
'type' => 'video/webm;
codecs="vp8, vorbis"',
),
+ // WebM VP9 transcode:
+ WebVideoTranscode::ENC_WEBM_VP9_360P =>
+ array(
+ 'maxSize' => '640x360',
+ 'videoBitrate' => '256',
+ 'audioQuality' => '1',
+ 'samplerate' => '48000',
+ 'noUpscaling' => 'true',
+ 'twopass' => 'true',
+ 'keyframeInterval' => '128',
+ 'bufDelay' => '256',
+ 'videoCodec' => 'vp9',
+ 'type' => 'video/webm;
codecs="vp9, opus"',
+ ),
+ WebVideoTranscode::ENC_WEBM_VP9_480P =>
+ array(
+ 'maxSize' => '854x480',
+ 'videoBitrate' => '512',
+ 'audioQuality' => '2',
+ 'samplerate' => '48000',
+ 'noUpscaling' => 'true',
+ 'twopass' => 'true',
+ 'keyframeInterval' => '128',
+ 'bufDelay' => '256',
+ 'videoCodec' => 'vp9',
+ 'type' => 'video/webm;
codecs="vp9, opus"',
+ ),
+ WebVideoTranscode::ENC_WEBM_VP9_720P =>
+ array(
+ 'maxSize' => '1280x720',
+ 'videoBitrate' => '1024',
+ 'audioQuality' => 3,
+ 'samplerate' => '48000',
+ 'noUpscaling' => 'true',
+ 'twopass' => 'true',
+ 'keyframeInterval' => '128',
+ 'bufDelay' => '256',
+ 'videoCodec' => 'vp9',
+ 'type' => 'video/webm;
codecs="vp9, opus"',
+ ),
+ WebVideoTranscode::ENC_WEBM_VP9_1080P =>
+ array(
+ 'maxSize' => '1920x1080',
+ 'videoBitrate' => '2048',
+ 'audioQuality' => 3,
+ 'samplerate' => '48000',
+ 'noUpscaling' => 'true',
+ 'twopass' => 'true',
+ 'keyframeInterval' => '128',
+ 'bufDelay' => '256',
+ 'videoCodec' => 'vp9',
+ 'type' => 'video/webm;
codecs="vp9, opus"',
+ ),
+
// Losly defined per PCF guide to mp4 profiles:
//
https://develop.participatoryculture.org/index.php/ConversionMatrix
// and apple HLS profile guide:
diff --git a/WebVideoTranscode/WebVideoTranscodeJob.php
b/WebVideoTranscode/WebVideoTranscodeJob.php
index 4014673..a5f03e3 100755
--- a/WebVideoTranscode/WebVideoTranscodeJob.php
+++ b/WebVideoTranscode/WebVideoTranscodeJob.php
@@ -186,7 +186,7 @@
$status = $this->ffmpegEncode( $options );
} elseif( $options['videoCodec'] == 'theora' &&
$wgFFmpeg2theoraLocation !== false ){
$status = $this->ffmpeg2TheoraEncode( $options );
- } elseif( $options['videoCodec'] == 'vp8' ||
$options['videoCodec'] == 'h264' || ( $options['videoCodec'] == 'theora' &&
$wgFFmpeg2theoraLocation === false ) ){
+ } elseif( $options['videoCodec'] == 'vp8' ||
$options['videoCodec'] == 'vp9' || $options['videoCodec'] == 'h264' || (
$options['videoCodec'] == 'theora' && $wgFFmpeg2theoraLocation === false ) ){
// Check for twopass:
if( isset( $options['twopass'] ) ){
// ffmpeg requires manual two pass
@@ -339,7 +339,7 @@
if ( isset( $options['novideo'] ) ) {
$cmd.= " -vn ";
- } elseif( $options['videoCodec'] == 'vp8' ){
+ } elseif( $options['videoCodec'] == 'vp8' ||
$options['videoCodec'] == 'vp9' ){
$cmd.= $this->ffmpegAddWebmVideoOptions( $options,
$pass );
} elseif( $options['videoCodec'] == 'h264'){
$cmd.= $this->ffmpegAddH264VideoOptions( $options,
$pass );
@@ -508,7 +508,11 @@
$cmd.= " -vb " . wfEscapeShellArg(
$options['videoBitrate'] * 1000 );
}
// Set the codec:
- $cmd.= " -vcodec libvpx";
+ if ( $options['videoCodec'] === 'vp9' ) {
+ $cmd.= " -vcodec libvpx-vp9";
+ } else {
+ $cmd.= " -vcodec libvpx";
+ }
// Check for keyframeInterval
if( isset( $options['keyframeInterval'] ) ){
diff --git a/i18n/en.json b/i18n/en.json
index 382dfce..9456dac 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -80,6 +80,14 @@
"timedmedia-derivative-desc-720p.webm": "High quality downloadable WebM
(720P)",
"timedmedia-derivative-1080p.webm": "WebM 1080P",
"timedmedia-derivative-desc-1080p.webm": "Full HD downloadable WebM
(1080P)",
+ "timedmedia-derivative-360p.vp9.webm": "WebM VP9 360P",
+ "timedmedia-derivative-desc-360p.vp9.webm": "Web streamable WebM VP9
(360P)",
+ "timedmedia-derivative-480p.vp9.webm": "WebM VP9 480P",
+ "timedmedia-derivative-desc-480p.vp9.webm": "Web streamable WebM VP9
(480P)",
+ "timedmedia-derivative-720p.vp9.webm": "WebM VP9 720P",
+ "timedmedia-derivative-desc-720p.vp9.webm": "HD streamable WebM VP9
(720P)",
+ "timedmedia-derivative-1080p.vp9.webm": "WebM VP9 1080P",
+ "timedmedia-derivative-desc-1080p.vp9.webm": "Full HD streamable WebM
VP9 (1080P)",
"timedmedia-derivative-320p.mp4": "H264 320P",
"timedmedia-derivative-desc-320p.mp4": "Device-friendly MP4 (320P)",
"timedmedia-derivative-480p.mp4": "H264 480P",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index ac38305..ea53e37 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -96,6 +96,14 @@
"timedmedia-derivative-desc-720p.webm": "{{optional}} A type of media
format encoding",
"timedmedia-derivative-1080p.webm": "{{optional}} A type of media
format encoding",
"timedmedia-derivative-desc-1080p.webm": "{{optional}} A type of media
format encoding",
+ "timedmedia-derivative-360p.vp9.webm": "{{optional}} A type of media
format encoding",
+ "timedmedia-derivative-desc-360p.vp9.webm": "{{optional}} A type of
media format encoding",
+ "timedmedia-derivative-480p.vp9.webm": "{{optional}} A type of media
format encoding",
+ "timedmedia-derivative-desc-480p.vp9.webm": "{{optional}} A type of
media format encoding",
+ "timedmedia-derivative-720p.vp9.webm": "{{optional}} A type of media
format encoding",
+ "timedmedia-derivative-desc-720p.vp9.webm": "{{optional}} A type of
media format encoding",
+ "timedmedia-derivative-1080p.vp9.webm": "{{optional}} A type of media
format encoding",
+ "timedmedia-derivative-desc-1080p.vp9.webm": "{{optional}} A type of
media format encoding",
"timedmedia-derivative-320p.mp4": "{{optional}} A type of media format
encoding",
"timedmedia-derivative-desc-320p.mp4": "{{optional}} A type of media
format encoding",
"timedmedia-derivative-480p.mp4": "{{optional}} A type of media format
encoding",
--
To view, visit https://gerrit.wikimedia.org/r/229397
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idbea47fbde2a8862084a7e77eb1ca928083d5b85
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: Brion VIBBER <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits