Page MenuHomePhabricator

TimedMediaHandler is not fully configurable: Class 'WebVideoTranscode' not found
Closed, DeclinedPublic

Description

After upgrading MediaWiki and TimedMediaHandler to 1.31.1 MediaWki won't start if I try to configure TimedMediaHandler.

Settings:

MediaWiki1.31.1 (a013eed) 16:46, 31 октября 2018
PHP7.2.11-3+ubuntu18.04.1+deb.sury.org+1 (fpm-fcgi)
MariaDB10.3.10-MariaDB-1:10.3.10+maria~bionic-log
LilyPond2.18.2
LuaSandbox2.0.13-alpha
Lua5.1.5
TimedMediaHandler0.5.0 (3fc2632) 03:49, 8 августа 2018GPL-2.0-or-laterОбработчик для аудио, видео и субтитров, с поддержкой форматов: WebM, Ogg Theora, Vorbis, srtMichael Dale, Tim Starling, James Heinrich, Jan Gerber, Brion Vibber и Derk-Jan Hartman

LocalSettings.php:

wfLoadExtension ('TimedMediaHandler');
…
$wgEnabledTranscodeSet = array_merge ($wgEnabledTranscodeSet, [
    WebVideoTranscode::ENC_H264_320P
  , WebVideoTranscode::ENC_H264_480P
  , WebVideoTranscode::ENC_H264_720P
]);
…
$wgEnabledAudioTranscodeSet [] = WebVideoTranscode::ENC_MP3;

The error:

2018/11/03 18:52:00 [error] 32644#32644: *227 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Class 'WebVideoTranscode' not found in /var/www/wiki/w/LocalSettings.php:707
Stack trace:
#0 /var/www/wiki/w/includes/Setup.php(94): require_once()
#1 /var/www/wiki/w/includes/WebStart.php(88): require_once('/var/www/wiki/w...')
#2 /var/www/wiki/w/index.php(39): require('/var/www/wiki/w...')
#3 {main}
  thrown in /var/www/wiki/w/LocalSettings.php on line 707" while reading response header from upstream, client: …, server: …, request: "GET … HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "…", referrer: "…"

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 3 2018, 12:10 PM
alex-mashin renamed this task from TimedMediaHandler is not loaded: Class 'WebVideoTranscode' not found to TimedMediaHandler is not fully configurable: Class 'WebVideoTranscode' not found.Nov 3 2018, 12:10 PM

$wgEnabledTranscodeSet = array_merge ($wgEnabledTranscodeSet, [

That line looks a bit too recursive to me?

alex-mashin added a comment.EditedNov 4 2018, 4:28 AM

The idea is to add three items to a array at once. This is not the problem. That the class WebVideoTranscode is not available from LocalSettings.php is.

TheDJ added a subscriber: TheDJ.Nov 5 2018, 9:35 AM

You have to convert the configuration to make use of strings. The PHP constants no longer exist since 1.31. Sorry, we should have made that more explicit in the release notes and the mediaWiki extension page.

The WebVideoTranscode constants no longer exist, and you have to specify their literal string values instead. The list of valid literal string values is listed in extension.json under the 'EnabledTranscodeSet' section.

I also notice that we didn't raise the version number of the extension apparently.. Sort of a shame...

brion added a subscriber: brion.Nov 7 2018, 11:30 PM

Yep, our bad -- we didn't document the breaking changes to config. :( Try this:

wfLoadExtension ('TimedMediaHandler');
...
$wgEnabledTranscodeSet['320p.mp4'] = true;
$wgEnabledTranscodeSet['480p.mp4'] = true;
$wgEnabledTranscodeSet['720p.mp4'] = true;

and this might not be needed since I think we enabled it by default, but if needed for audio:

$wgEnabledAudioTranscodeSet['mp3'] = true;

I used this:

$wgEnabledTranscodeSet = [
    '160p.webm',
    '240p.webm',
    '360p.webm',
    '480p.webm',
    '720p.webm',
    '1080p.webm',
];

I used this:

$wgEnabledTranscodeSet = [
    '160p.webm',
    '240p.webm',
    '360p.webm',
    '480p.webm',
    '720p.webm',
    '1080p.webm',
];

Yeah, that doesn't work any more, sorry. $wgEnabledTranscodeSet is now a map, not an array.

OK, thanks, I changed the configuration accordingly.

alex-mashin closed this task as Resolved.Nov 11 2018, 7:00 AM
Aklapper changed the task status from Resolved to Declined.Nov 11 2018, 12:36 PM

No code change was committed, hence closing as declined.