Extension talk:TimedMediaHandler

Jump to navigation Jump to search

About this board

Class 'getID3' not found trying to upload a video file

Krusher (talkcontribs)

Hello, when trying to upload a video file (either webm or mp4) I get the following error:

[10f9430f9e6bc3a83ac9f5ad] /wiki/Especial:SubirArchivo Error from line 15 of /home/krusher/www.apocrypha.ovh/extensions/TimedMediaHandler/includes/handlers/ID3Handler/ID3Handler.php: Class 'getID3' not found


#0 /home/krusher/www.apocrypha.ovh/extensions/TimedMediaHandler/includes/handlers/Mp4Handler/Mp4Handler.php(12): ID3Handler->getID3(string)

#1 /home/krusher/www.apocrypha.ovh/extensions/TimedMediaHandler/includes/handlers/ID3Handler/ID3Handler.php(51): Mp4Handler->getID3(string)

#2 /home/krusher/www.apocrypha.ovh/includes/utils/MWFileProps.php(84): ID3Handler->getMetadata(FSFile, string)

#3 /home/krusher/www.apocrypha.ovh/includes/upload/UploadBase.php(506): MWFileProps->getPropsFromPath(string, string)

#4 /home/krusher/www.apocrypha.ovh/includes/upload/UploadBase.php(441): UploadBase->verifyPartialFile()

#5 /home/krusher/www.apocrypha.ovh/includes/upload/UploadBase.php(344): UploadBase->verifyFile()

#6 /home/krusher/www.apocrypha.ovh/includes/upload/UploadFromFile.php(95): UploadBase->verifyUpload()

#7 /home/krusher/www.apocrypha.ovh/includes/specials/SpecialUpload.php(506): UploadFromFile->verifyUpload()

#8 /home/krusher/www.apocrypha.ovh/includes/specials/SpecialUpload.php(204): SpecialUpload->processUpload()

#9 /home/krusher/www.apocrypha.ovh/includes/specialpage/SpecialPage.php(569): SpecialUpload->execute(NULL)

#10 /home/krusher/www.apocrypha.ovh/includes/specialpage/SpecialPageFactory.php(578): SpecialPage->run(NULL)

#11 /home/krusher/www.apocrypha.ovh/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)

#12 /home/krusher/www.apocrypha.ovh/includes/MediaWiki.php(865): MediaWiki->performRequest()

#13 /home/krusher/www.apocrypha.ovh/includes/MediaWiki.php(515): MediaWiki->main()

#14 /home/krusher/www.apocrypha.ovh/index.php(42): MediaWiki->run()

#15 {main}

Am I doing something wrong or do I lack something?


TheDJ (talkcontribs)

Did you install from git ? Because it looks like the composer dependencies of the extension were not installed.

Krusher (talkcontribs)

Correct, after executing composer update it works. Thanks! Maybe it should be noted in the installation process.

Bowdzone (talkcontribs)

I just installed the extension via downloading and extracting the tar and not using git but I received the same error message, had to install composer and run composer update --no-dev to get rid of this. Not sure whether that is intended but at the moment this step should be noted as a general requirement for the installation process

Madewild (talkcontribs)

Is this the intended behaviour and is there a workaround? I have a MW instance on a shared server with no root access so I cannot install composer.

Ciencia Al Poder (talkcontribs)

You can install composer on your local computer, use it on a copy of the extension, and then upload the whole folder to the server

TheDJ (talkcontribs)

i've update the documentation some more. Turns out the tarball versions of the extension also don't include the vendor directory (only the main tarball for core + common extensions does).

Bttfvgo (talkcontribs)

Krusher, this is a somewhat simple error that I ran into also. Just do

$ composer require james-heinrich/getid3

from your Mediawiki root directory. Glad you got it working!

Huwmanbeing (talkcontribs)

In a similar vein: with TimedMediaHandler REL1_33 installed (via the ExtensionDistributor download) I recently ran into an issue where the missing getID3 interfered with the operation of refreshImageMetadata, which in turn prevented PdfHandler from working properly. To follow up on TheDJ's point above, could someone describe what files specifically are missing from the download that are needed for the extension to operate correctly?

Ciencia Al Poder (talkcontribs)

You need to run composer install --no-dev in the extension directory

TheDJ (talkcontribs)

Yeah, it's this huge note in the page:

After downloading this extension, please note that it requires Composer.

So, after installation change to the directory containing the extension e.g. "../extensions/TimedMediaHandler/" and run composer install --no-dev, or when updating: composer update --no-dev.

Alternatively as well as preferably add the line "extensions/TimedMediaHandler/composer.json" to the "composer.local.json" file in the root directory of your wiki like e.g.

	"extra": {
		"merge-plugin": {
			"include": [
Goodman Andrew (talkcontribs)

If you are on shared hosting, follow the following steps:

1. Download James-heinrich/getid3 from [php-download.com/package/james-heinrich/getid3]

2. Go to your file manager and on the extension/TimedMediaHandler folder, upload James-...

3. Extract James

4. Go back to your wiki and run the upload again.

Goodman Andrew (talk) 14:33, 28 December 2019 (UTC)
Reply to "Class 'getID3' not found trying to upload a video file"

Transcode key [resolution].ogv not found, skipping

Scarred Sun (talkcontribs)

I'm running into an issue where upon running webVideoTranscode jobs, I wind up getting skipping and errors over any OGV files (and potentially OGG/MP3 files, though it's hard to tell with video backlogs). For what it's worth, I have all the requisite codecs (libtheora, lame, etc.) on the server. Any idea why this may be happening?

Brion VIBBER (talkcontribs)

I believe this message will come up when there's a job to run a transcode, but there's no entry in the data loaded from the transcode table that matches that id. One possibility is that the configured transcode settings are messed up... we did an incompatible config change last year or so which might be tripping up some configs that recently updated. If you're manually altering or setting $wgEnabledTranscodeSet make sure you're using the current format -- instead of a list of constants, it's an associative array of the actual string keys to a boolean which indicates whether they're on or off. If the config is damaged, it might be causing some trouble there.

If that doesn't seem to be the problem, we may need to check logs or double-check that the database table is ok. (And confirm what version you're running etc before we try debugging!)

Reply to "Transcode key [resolution].ogv not found, skipping"

HOWTO LOOP video. +Opus 44.1k failure & Same-size re-encodes

2001:2002:51ED:CEE0:DC5D:AE01:E6DE:3306 (talkcontribs)

1) Most importantly I would like TimedMediaHandler to have a "loop" video option for making short video clips (say it's just 15-20 seconds) loop automatically when they are played.

2) It would be nice to be able to set a video size of 100% instead of pixels and have it resize to whatever size the screen/browser is using. Should of course also work if the browser is resized after playbacks begun.

3) Unrelated, uploading a MP3 with 44.1k audio makes TimedMediaHandler specify 44.1k when converting to Opus which fails since it's a 48k format. That's a bug.

4) I also find it very annoying that if I upload a 1080p VP9/Opus webm TimedMediaHandler will convert the file to that same format in addition the other formats. A check to see if the file's already in the target format would be preferable and reduce server load. (talkcontribs)


for 1) as a dirty hack, to get a button below the player to replay the video sequence, one may edit the extension as shown below. This solution is just a first approach an need to be further improved regarding stability, readability etc. but its a starting point.

This adds an individual javascript function under each videoplayer tag in the document, using the specific id of the video tag. the javascript function is started by clicking the button and will restart and play the video sequence.

edit the file [PathToYourMediawiki]/extensions/TimedMediaHandler/includes/TimesMediaTransformOutput.php

search for function 'getHtmlMediaTagOutput(...'

specifically search for the following code lines:

// Build the video tag output:

$s = Html::rawElement( $this->getTagName(), $this->getMediaAttr( $sizeOverride, $autoPlay ),

        // The set of media sources:

        self::htmlTagSet( 'source', $mediaSources ) .

        // Timed text:

        self::htmlTagSet( 'track', $mediaTracks )


add the following lines below:

$s .= '<script type="text/javascript">';

$s .= 'function replayVideo'.self::$serial.'() {';

$s .= "var el = document.getElementById('";

$s .= "mwe_player_";

$s .= self::$serial-1;

$s .= "'); ";

$s .= "el.muted = 'true'; el.load(); el.play(); }</script>";

$s .= '<form><input type="button" onclick="replayVideo';

$s .= self::$serial.'()" value="(re)play"</form>';

Note: i'm sure this can be written in a nicer way, it's decades since i used php ;) (talkcontribs)

some additional notes:

1) correct filename is TimedMediaTransformOutput.php (not TimesMedia...)

2) dont use the <form> and </form> tag from the source above, it will result in errors with input button afterwards (like formlink etc.)

3) el.muted = 'true' has no effect for most browsers and is not wanted for most users (mute video)

Reply to "HOWTO LOOP video. +Opus 44.1k failure & Same-size re-encodes"

Not Working - uploaded files not found

3 (talkcontribs)

Once I activate TimedMediaHandler (and MwEmbedSupport), "[[File:XXXX]]" links simply change to red as if the file wouldn't exist (previously they were ok).

Files have been uploaded correctly.

Tested on a vanilla MW 1.27.3 (LTS) with TMH 1.27 and 1.28. (talkcontribs)

Same with MW 1.29.0

Ivan Mudrik (talkcontribs)

Same with MW 1.33

Reply to "Not Working - uploaded files not found"

extension.json not included in download file

4 (talkcontribs)

Does anyone know if this will stream a video when importing a page from wikipedia or will it download the video to my server first?

Also I am getting this error PHP Fatal error:  Uncaught Exception: xxxx/TimedMediaHandler/extension.json does not exist! in xxxx/includes/registration/ExtensionRegistry.php:117

I have checked the paths and it does not seem to be in the download file. I assume that we could add this file in there from github /wikimedia/mediawiki-extensions-TimedMediaHandler/blob/master/extension.json?

TheDJ (talkcontribs)

This extension supports local files and files hosted on 'foreign repos', like Wikimedia Commons via InstantCommons. It does not handle anything like Youtube etc.

TheDJ (talkcontribs)

Your error likely means you are using an old version/download of the extension, in combination with the newer wfLoadExtension method of loading the extension. wfLoadExtension depends on extension.json being present. If extension.json is not present you have an old version of it.

I always advise to download the branch version (REL_***) of an extension that matches the version of MediaWiki core that you are running.

Tacsipacsi (talkcontribs)

It depends. If you import the file while importing the page, it will be on your server. If you don’t import the file, it has to be on Wikimedia Commons and you need to have InstantCommons to be able to use the file directly from Commons (otherwise the file will be marked as missing, i.e. a red link will appear instead of the file). This applies to all kinds of files, with videos being no exception. If a video is displayed from Commons, it’s played from Commons entirely (you can confirm this by playing a video on MediaWiki.org, and check your browser console to see it’s played from https://upload.wikimedia.org/wikipedia/commons/*).

Where did you download the extension from? I checked the four versions available at Special:ExtensionDistributor/TimedMediaHandler, and all of them had extension.json.

(N.B. I started writing this answer before the above ones arrived, and this *** haven’t warned me of them.)

Reply to "extension.json not included in download file"

MwEmbedSupport needed for MW 1.31+ or not?

Summary by Kghbln


Kghbln (talkcontribs)

It is still unclear to me if the MwEmbedSupport extension is needed for REL1_31. The instructions here at TimedMediaHandler clearly state it is not needed, the instructions on MwEmbedSupport clearly state that it is needed. I'd really appreciate if somebody could look into this. Thanks.

Kghbln (talkcontribs)

Trying to self answer. It is not needed for a fresh install on MW 1.31 and later.

Perhaps you still need to have it on MW 1.31 to gracefully upgrade and migrate from earlier versions. Cannot tell since I have not used this one before.

Ciencia Al Poder (talkcontribs)

It's not needed even for an upgrade

Kghbln (talkcontribs)

Thanks for clarifying. I removed the contradictory information from the MwEmbedSupport page.

Elbiztec (talkcontribs)

Hello, I installed the extension TimedMediaHandler and run good in sounds, but in video it appears with this error, i created temp folder and put the code $wgTempDirectory but not work, any help would be greatly appreciated

Brion VIBBER (talkcontribs)

Assuming ffmpeg is installed correctly, it's common to get thumbnailing errors due to the low default memory limit.

Try adding to LocalSettings.php: $wgMaxShellMemory *= 4;

Silkwood (talkcontribs)

Assuming ffmpeg is installed....add

$wgFFmpegLocation = '/path/to/ffmpeg';

after wfLoadExtension( 'TimedMediaHandler' );

Kghbln (talkcontribs)

Indeed, this is the error message I got:

Error generating thumbnail

Error creating thumbnail: File::transform() returned false

This requires you to do the following configuration, at least on a Ubuntu 18.04:

wfLoadExtension( 'TimedMediaHandler' );
$wgFFmpegLocation = '/usr/bin/ffmpeg';

The default setting that comes with the extension points to a "avconv" binary which is not present in Ubuntu 18.04. Silkwood's recommendation is a time saver.

Reply to "Error creating thumbnail"

Commons Creator template doesnt work well with TimedMediaHandler's menu display

Roy17 (talkcontribs)
Reply to "Commons Creator template doesnt work well with TimedMediaHandler's menu display"

Error loading shared libraries and Undefined index: vorbis

Bttfvgo (talkcontribs)

I cannot generate thumbnails in MW1.33. I couldn't in 1.32, either, but at least the video player displayed. This time it doesn't show (but if you go to "original file", the video still plays), but instead displays an error:

/usr/bin/ffmpeg: error while loading shared libraries: libgobject-2.0.so.0: failed to map segment from shared object

I can't figure it out. I also can't figure out the "Undefined index: vorbis" error I keep receiving. Everything worked so good for me through MW1.30... Sigh, I've been having nothing but errors since the upgrade, lol!

Bttfvgo (talkcontribs)

Well I solved the ffmpeg error. Apparently, I had definied $wgMaxShellMemory twice in my LocalSettings.php, and the second value, which was much lower than the first, was overwriting the first value. Changing it gave it more than enough memory to do what it needed to do. I'm still getting the "Undefinied index: vorbis" error, however!

Reply to "Error loading shared libraries and Undefined index: vorbis"
Bowdzone (talkcontribs)

Currently, this extension does not appear to be supporting PostgreSQL natively, which is also discussed here. What happend for me was, that the update script did nothing to update my database and the upload afterwards complained about missing tables, guessing the update script had not been executed. Creating the transcode table and sequence manually with the correct permissions seems to have fixed the issue.

Imho this general issue is worth noting on the installation section for other users to at least know what they are getting into.

Reply to "PostgreSQL not supported"