Extension talk:TimedMediaHandler

From MediaWiki.org
Jump to: navigation, search
Start a new discussion


Thread titleRepliesLast modified
Fatal error: Call to undefined method ForeignDBRepo::fetchImageQuery214:33, 12 April 2014
When subtitles are on two lines, the second one is not visible. Why ?010:24, 12 March 2014
Subtitles215:38, 8 February 2014
No error, but now player.119:15, 23 January 2014
SQL is MySQL specific016:37, 21 December 2013
Support for FLAC100:00, 18 December 2013
Where to find mwEmbedSupport extension220:28, 9 December 2013
How to enable transcoding to H.264 ?712:49, 30 November 2013
Popup behaviour018:15, 30 October 2013
OggHandler error010:19, 15 October 2013
Bug: Causes /tmp directory to fill up023:57, 5 October 2013
MP3 patents015:33, 16 June 2013
Bigger subtitles when switching to fullscreen022:12, 13 March 2013
How am I supposed to create the table mywikidb.mywiki_transcode in the first place?321:17, 3 March 2013
Fatal error: Call to undefined method Message::numParams()015:05, 2 January 2013
Seek bar008:59, 11 November 2012
Missing or misplaced files015:31, 21 January 2012

Fatal error: Call to undefined method ForeignDBRepo::fetchImageQuery

Dear Sir,

0) Background

I develop WP-MIRROR which is a utility for building a set of mirrors of WMF wikis. Home: <http://http://www.nongnu.org/wp-mirror/>. For WP-MIRROR 0.7, my objective is this: A wiki page rendered by the mirror site, should look the same as that page rendered by the WMF site. Version 0.6 fell short in this regard because: a) it depends upon the DEB package for MediaWiki 1.19 LTS which is not able to render many features that were introduced in 2013 (e.g. wikidata, scribunto, ...); and b) it depends upon several DEB packages for extensions compatible with 1.19 LTS which do not include many extensions currently used by WMF (e.g. math w/ mathjax, score, timeline, timedmediahandler, etc.)

In support of this objective, I am preparing a DEB package of MediaWiki 1.23alpha, and a DEB package of most of the extensions listed on <http://en.wikipedia.org/wiki/Special:Version>. So far I have packaged a couple dozen extensions with good results, but have hit a snag with TimedMediaHandler.

1) Mirror

1.1) WP-MIRROR builds a mirror of <http://simple.wikipedia.org/> out of the box using dump files from <http://ftpmirror.your.org>.

1.2) For MediaWiki, I am using the latest `git pull' from the GIT repository <https://gerrit.wikimedia.org/r/p/mediawiki/core.git>. For MediaWiki extensions, I am using the latest `git pull' from the GIT repositories under <https://gerrit.wikimedia.org/r/p/mediawiki/extensions/>. MwEmbedSupport and TimedMediaHandler are installed and configured as per the README.

1.3) As Debian dependencies, I have installed: cortado 0.6.0-1, ffmpeg 6:0.8.10-1, fmpeg2theora 0.27-2, imagemagick 8:, libav-tools 6:0.8.10-1, libvpx1 1.1.0-1, oggvideotools 0.8a-1, php5-cli 5.4.4-14+deb7u7, php-getid3 1.9.3-1, php-pear 5.4.4-14+deb7u7.

1.4) `LocalSettings.php' contains:

require_once( "$IP/extensions/MwEmbedSupport/MwEmbedSupport.php" );
require_once( "$IP/extensions/TimedMediaHandler/TimedMediaHandler.php" );
ini_set( 'include_path',
	 ".:$IP:$IP/includes:$IP/languages:/usr/share/php" . 
	 ini_get( 'include_path' ) ); 
$wgVideoPlayerSkin      = 'kskin'; 
$wgEnableTranscode      = true; 
$wgEnableNiceBackgroundTranscodeJobs = true; 
$wgFFmpeg2theoraLocation= '/usr/bin/ffmpeg2theora'; 
$wgFFmpegLocation       = '/usr/bin/avconv'; 
$wgOggThumbLocation     = '/usr/bin/oggThumb'; 

2) Testing

Special pages all work: <http://simple.wikipedia.site/wiki/Special:Version>, <http://simple.wikipedia.site/wiki/Special:TimedMediaHandler>, <http://simple.wikipedia.site/wiki/Special:FileList>.

Most ordinary pages display properly: <http://simple.wikipedia.site/wiki/Apple>.

3) Errors

Ordinary pages with OGV files render as blank. Two examples:

3.1) Use Firefox to view: <http://simple.wikipedia.site/wiki/Burnout> Error message in `/var/log/apache2/wp-mirror.site-error.log':
[Wed Feb 26 12:17:30 2014] [error] [client ::1] PHP Fatal error: Call to a member function doTransform() on a non-object in /usr/share/wp-mirror-mediawiki/extensions/TimedMediaHandler/TimedMediaThumbnail.php on line 201

3.2) Use Firefox to view: <http://simple.wikipedia.site/wiki/Sintel> Error message in `/var/log/apache2/wp-mirror.site-error.log':
[Wed Feb 26 11:04:41 2014] [error] [client ::1] PHP Fatal error: Call to undefined method ForeignDBRepo::fetchImageQuery() in /usr/share/wp-mirror-mediawiki/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php on line 396

Under `/tmp/', can be found many files like `/tmp/transform-aaaabbbbcccc-1.jpg', where the string `aaaabbbbcccc' is composed of hexadecimal characters.

4) Request

Any advise would be appreciated. I am now reading the code but do not yet grasp where the problem is; hence this note.

If this is not the right location to write such a note, please let me know if there is an appropriate mailing list.

Sincerely Yours,

Hardware: x86x64, 6G DRAM
OS: Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux
Distribution: Debian 7.4 (wheezy), with back-ports
MediaWiki: most recent version (1.23alpha) obtained from GIT repository
Extensions: most recent versions obtained from GIT repository

Wp mirror (talk)18:24, 26 February 2014

Its a bug in TimedMediaHandler. TimedMediaHandler isn't compatible with ForeignDBRepo based image stores. Try using ForeignDBViaLBRepo instead (They're basically the same, One just uses a $wgLBFactoryConf instead).

Issue filed as bugzilla:61986

Bawolff (talk)05:44, 27 February 2014

Thank you for your advice regarding $wgLBFactorConf. Pages such as <http://simple.wikipedia.site/wiki/Sintel> now render and behave correctly.

WP-MIRROR 0.7 is released. Please give it a try. See the announcement or the home page if interested.

Feedback is welcome.

Wp mirror (talk)14:33, 12 April 2014

When subtitles are on two lines, the second one is not visible. Why ?

When using this extension on a personal server, when subtitles are on two lines, the second one is not visible.

It's not the case on theses pages for example :

Any idea why ?

My configuration is :

MediaWiki 1.22.4
PHP 5.3.10-1ubuntu3.10 (apache2handler)
MySQL 5.5.35-0ubuntu0.12.04.2
TimedMediaHandler (version 0.3)
Dieudo (talk)10:24, 12 March 2014

I installed this extension on my wiki, uploaded an .ogg file and created corresponding TimedText file with subtitles. The media players on the file page in File: namespace and on the subtitles page in TimedText: do display subtitles. However when I embed the player in the main namespace with File:….ogg, no subtitles button appear on the player. Is it how it should be?

Alex Mashin (talk)12:22, 2 February 2014

no. subtitles should work on all pages. (i have no idea whats wrong though. if your wiki is public, do you have a link?)

Bawolff (talk)21:07, 3 February 2014

They work now. Looks like the job had not been run.

Alex Mashin (talk)05:10, 8 February 2014

No error, but now player.

I've uploaded both the TimedMediaHandler and mwEmbedSupport extensions and added them to my LocalSettings.php file. I then ran update.php and both extensions are showing up in my Version page as being installed with the correct versions. However, when I try to place an ogg file in a page, I don't get a player, nor do I get a player in the thumbnail section of the ogg's File page. I'm trying to debug this, but no PHP errors are being generated on my server so I don't know where to go. Any thoughts?

TheAlmightyGuru (talk)19:12, 23 January 2014

Oh yes, I'm running MediaWiki version 1.22.1, TimedMediaHandler version 0.3, and MwEmbedSupport version 0.2.

TheAlmightyGuru (talk)19:15, 23 January 2014

SQL is MySQL specific

transcode_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT in the file TimedMediaHandler.sql is not standard SQL. I use postgres and had to change it to transcode_id SERIAL PRIMARY KEY.

Further, transcode_error longtext NOT NULL must be changed to transcode_error TEXT NOT NULL for postgres.

It would be nice if this extension could be made to also support postgres, as this only needs the above changes. Thanks., 21 December 2013

Support for FLAC

I have this extension enabled and working for Ogg files but I can't get it to work for FLAC files. As per the documentation, I added $wgMediaAudioTypes = array( 'Vorbis', 'Speex', 'FLAC' ); to my LocalSettings.php file and ran update.php. Still, no FLAC. To double check that what I'm trying to accomplish is possible, I embedded a FLAC file in a sandbox article on WP and it worked as expected. I'm running the same version of the extension as WP and version 1.21.3 of MW. So, I realized that I must not have something enabled/configured correctly but now I'm at a loss for what to do next. Here's an example of an attempt to embed a FLAC file on my wiki: http://preservapedia.org/Bruce_Sharky_discusses_the_use_of_wikis_in_graduate_level_coursework

Any advice would be appreciated.

Fitzed (talk)22:25, 17 December 2013

Problem solved. I noticed I was missing the FLAC handler in ..extensions/TimedMediaHandler/handlers/ After updating to the TMH release for MW 1.22, everything is working properly.

Fitzed (talk)00:00, 18 December 2013

Where to find mwEmbedSupport extension

Edited by another user.
Last edit: 15:52, 13 October 2011

I'm trying to install your extension but i'm stuck at first step. How/where cna i find the mwembedsupport extension that needs to be installed. Furthermore, the firefogg files are available for all major platforms. So once i download the one from the source, where do i place it in relation to my server, within the extensions or anywhere in my server. Similarly it also says I need a copy of ffmpeg2theor in my server and I'm not clear for that too. I'm guessing the suggested configuration lines is for comman line instructions for the settings and do we run that from root or from specific folder. Obviously I'm a bit of a starter so my question may sound very simple or studid but I apologize if it comes off like that. I've always had a difficulty of how we can install programs made for linux, windows, mac being 'installed' on my server. Thanks MW1.17, apache server, php 5.3, shared host.

User:Wikimanz15:48, 13 October 2011

You can get mwEmbedSupport from the same parent directory as TimedMediaHandler: http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/MwEmbedSupport/

You need to setup the paths in the local settings for your encoder binaries see the README for more info

You may have some challenges running this off of a shared host because it includes transcoding support dependent on shell scripts / cron jobs.

Mdale09:45, 17 October 2011

Is there any way to get an easier download of MwEmbedSupport rather than downloading all those files and creating the folders manually?

Alternately, is MwEmbedSupport necessary if I'm not using the transcoding features of TimeMediaHandler? I run a audio-themed Wiki, and I'm looking into updating from the old OggHandler extension to this one, but I don't need any video features.

TheAlmightyGuru (talk)20:20, 9 December 2013

How to enable transcoding to H.264 ?

Default enabled transcodes :

 $wgEnabledTranscodeSet = array(
        // A high end web streamable ogg video 
        // A web low bandwidth streamable WebM video    
        // A web streamable WebM video  
        // A high quality WebM stream 

How do we specify enabling transcoding to H.264 in order to have this format available as seen in Extension:TimedMediaHandler/Platform testing ?

Dieudo (talk)22:10, 3 March 2013

The beginning of a solution in the file TimedMediaHandler.php :

Extract :

 * Default enabled transcodes
 * -If set to empty array, no derivatives will be created
 * -Derivative keys encode settings are defined in WebVideoTranscode.php
 * -These transcodes are *in addition to* the source file.
 * -Only derivatives with smaller width than the source asset size will be created
 * -Regardless of source size at least one WebM and Ogg source will be created from the $wgEnabledTranscodeSet
 * -Derivative jobs are added to the MediaWiki JobQueue the first time the asset is displayed
 * -Derivative should be listed min to max
$wgEnabledTranscodeSet = array(
        // Small WebM version for default small embed size thumbs

        // Ogg fallback for IE/cortado

        // A web streamable WebM video

        // A high quality WebM stream

        // A least common denominator h.264 stream; first gen iPhone, iPods, early android etc.

        // A mid range h.264 stream; mid range phones and low end tables
        // An high quality HD stream; higher end phones, tablets, smart tvs

$wgEnabledAudioTranscodeSet = array(

        //opus support must be available in avconv

        //avconv needs libmp3lame support

        //avconv needs libvo_aacenc support

// If mp4 source assets can be ingested:
$wgTmhEnableMp4Uploads = true;

But even set as above the h.264 and transcoded, this format remains not visible in the choices offered.

Below a copy of what it looks like :

Statut de transcodage.png
Available formats.png

Any idea where is the bug ?

Dieudo (talk)10:51, 8 March 2013

Once you change any transcode setting you should clear out all your transcodes. ( see maintenance/cleanupTranscodes.php )

Also you should check that the commands being run will work to generate your mp4 files. i.e run the maintenance/WebVideoJobRunner.php job on the command line and observer the ffmpeg commands being called and confirm they are are successfully being executed.

Mdale (talk)19:44, 8 March 2013

Thank you Mdale for theses informations.

I'll try them.

But even before that isn't there another problem shown by the fact that when I upload an mp4 file it's not readable by TMH : it only gives this message :

For best viewing, using an HTML 5 broswer is recommanded.

even though it is viewed with Firefox.

And I confirm the commands were successfully being executed :

2013-03-08 09:34:12 webVideoTranscode Fichier:Patrick_Viveret-Oct_2010.webm transcodeMode=derivative transcodeKey=320p.mp4 STARTING
Encoding to codec: h264
Running cmd: 

'/usr/bin/avconv' -y -i '/var/www/rc/images/Patrick_Viveret-Oct_2010.webm' -threads 1 -vcodec libx264 -profile:v baseline -preset slow -coder 0 -bf 0 -flags2 -wpred-dct8x8 -level 13 -maxrate 768k -bufsize 3M -b '400k' -f mp4 -s 426x320 -ab 40000 -ac '2' -acodec 'libvo_aacenc' /tmp/transcode_320p.mp422999f1774bc-1.mp4

2013-03-08 09:39:15 webVideoTranscode Fichier:Patrick_Viveret-Oct_2010.webm transcodeMode=derivative transcodeKey=320p.mp4 t=302868 good

Do theses informations help ?

Would you agree to copy here the different from default settings necessary and sufficient to read mp4 files within TMH ?

Dieudo (talk)23:12, 8 March 2013

if you click on the direct link in the transcode table to the mp4 can you play that in your browser? mp4 might only show up if you dont support any of the other encodings. i.e. in Safari.

JanGerber (talk)17:28, 12 March 2013

reply to self: looks like h264 support was not working anymore since source elements have a type now, https://gerrit.wikimedia.org/r/#/c/53392/ fixes this.

JanGerber (talk)17:55, 12 March 2013

Popup behaviour

When playing a video, it causes it to pop up and cover up the entire screen. Unless you're actually wanting to watch something in fullscreen mode, this is incredibly jarring, especially with small videos. What is the reason for this behaviour?

-— Isarra 18:15, 30 October 2013

OggHandler error

I am getting the error:

OggHandler requires oggThumb version $1 or later.

I have the latest version of oggvideotools from Debian, it would seem that the latest version available from SF is 0.8a. Any ideas?, 15 October 2013

Bug: Causes /tmp directory to fill up

After installing this extension on Zelda Wiki, I noticed that our /tmp directory was filling up. I didn't quite make the connection that it could be this extension, however, until one of our affiliate sites had the same problem right after installing it. This extension seems to have messed with the image conversion process somehow, to the point where /tmp will be filled with files like magick-3904813098028394298347289.png or something. This is a pretty nasty bug that needs fixing. To anyone encountering this problem, a temporary fix is to make a cron. For linux, that would be rm -f /tmp/magick*, 5 October 2013

MP3 patents

What's the source for MP3 patents expiring in 2012? A Big List of MP3 Patents (and supposed expiration dates) has some lasting to 2017. It is possible A Big List is wrong. Nevertheless, a source for 2012 would be useful.

Superm401 - Talk15:33, 16 June 2013

Bigger subtitles when switching to fullscreen

How to have bigger subtitles when switching to fullscreen ?

Any idea ?

Dieudo (talk)22:12, 13 March 2013

How am I supposed to create the table mywikidb.mywiki_transcode in the first place?


MediaWiki 1.20.0 TimedMediaHandler (Version 0.3)

I get this error: Une erreur de syntaxe de la requête dans la base de données est survenue. Ceci peut indiquer un bogue dans le logiciel. La dernière requête traitée par la base de données était :

   (Requête SQL cachée)

depuis la fonction « WebVideoTranscode::getTranscodeState ». La base de données a renvoyé l’erreur « 1146 : Table 'wikimassiliadb.massilia_transcode' doesn't exist (localhost) ».

I've read your doc many times and nowhere is said how we create the new tables during install...

Help appreciated. Google didn't work at all.


Arkanoid2 (talk)05:46, 28 November 2012

Same problem, same question.

With this configuration :

  • MediaWiki 1.20.2
  • MwEmbedSupport (Version 0.2)
  • TimedMediaHandler (Version 0.3)

Thanks for any help ;-)

Dieudo (talk)22:19, 12 February 2013

A temporary solution to this problem, is to set this in the file LocalSettings.php :

$wgEnableTranscode = false;
Dieudo (talk)10:01, 13 February 2013

Thank you to user:Parent5446 for the solution given with this line :

This extension also requires schema changes, so run update.php after installing.

; )

Dieudo (talk)21:17, 3 March 2013

Fatal error: Call to undefined method Message::numParams()


I just installed the extension TimedmediaHandler on my wiki. When I try to disaply a ogg file I receive this error: Fatal error: Call to undefined method Message::numParams() in C:\inetpub\wwwroot\Mediawiki\extensions\TimedMediaHandler\handlers\OggHandler\OggHandler.php on line 246

Here my installation: Windows server 2008 IIS 7 MediaWiki 1.17.0 PHP 5.3.5 (cgi-fcgi) MySQL 5.5.9

PEAR installation PACKAGE VERSION STATE Archive_Tar 1.3.3 stable Console_Getopt 1.2.3 stable PEAR 1.9.0 stable Structures_Graph 1.0.2 stable XML_Util 1.2.1 stable

TimedMediaHandler-master-84fa501 Any idea ?

Thanks for your help Roberto

IT90061 (talk)15:05, 2 January 2013

Hi all, thank you for hacking such a good extension.

Now, installed this extension on Wikipedias, some problems occurred, so I need your help. See en:template:listen, the seek bars are not shown, because the seek bar is not shown when the width is more than 180 px and less than 240 px (see en:template talk:listen). It may be more important to show seek bar than the time. Could you change the setting to show the seek bar only not the time when the width is less than 240 px?

Akaniji (talk)08:54, 11 November 2012

Missing or misplaced files

I'm getting the following error: Failed opening required 'File/Ogg.php' being thrown from extensions/TimedMediaHandler/handlers/OggHandler/OggHandler.php on line 12.

There's a folder called File in the PEAR subfolder, which contains the Ogg.php. However, changing the line of code to that (or copying the File directory and placing it in the OggHandler folder) will then get a new error thrown:

Failed opening required 'PEAR.php' from extensions/TimedMediaHandler/handlers/OggHandler/File/Ogg.php on line 114.

Any ideas?

Thannks. Peter., 21 January 2012