Extension talk:TimedMediaHandler

About this board

Alex Mashin (talkcontribs)
Reply to "Shellbox"

OGG file won't play in mobile devices, but works fine for desktop

3
Boxiao (talkcontribs)

I am creating a wiki for people to learn how to pronounce some difficult names in my language. I have recorded audio in OGG files and uploaded to the wiki, and they play fine in desktop browsers like Chrome and Microsoft Edge. Here is an example: https://chinesenamesinenglish.com/wiki/A

However, in mobile devices (both Safari and Chrome in iphone X), if I use MobileFrontend (I tried different skins), the audio is not played after I click the play button but the player is displayed. If I use desktop view in mobile devices, the player is not even displayed. In contrast, Wikipedia's audio plays fine in mobile devices. For example, https://en.wikipedia.org/wiki/The_Star-Spangled_Banner

Can anyone help? Thank you! I am using MediaWiki v1.33.1 and the extensions and skins are latest compatible versions.

Boxiao (talkcontribs)

For now, I bypassed this issue by replacing OGG files with mp3 files. However, I still hope to know how to solve this problem. Your help will be greatly appreciated!

Chuck.Kahn (talkcontribs)

I’m noticing the same issue with the ogg media on the Audio Samples provided on Fandom’s Soundeffects Wiki. I would really like to use this resource on Apple mobile devices. Is there a workaround?

Reply to "OGG file won't play in mobile devices, but works fine for desktop"

Download From Extension Distributor not working

4
5.193.68.230 (talkcontribs)

The download link from Extension Distributor is not found.

TheDJ (talkcontribs)

Not working in what way ? As in the download doesn't start, it doesn't finish, what you downloaded is not working ? Which version did you try to download ? Please be comprehensive when making reports about problems.

2001:8F8:1E6D:C2FB:1894:CC1D:9EE7:6A9D (talkcontribs)

Click on the download link, then version 1.39 to reproduce the same error.

last checked, 20221213065710

Jdforrester (WMF) (talkcontribs)
Reply to "Download From Extension Distributor not working"
112.209.61.222 (talkcontribs)

if i installed this extension i got database error

Bawolff (talkcontribs)

Did you run update.php ?

112.209.61.222 (talkcontribs)

yes

Bawolff (talkcontribs)

Can you set $wgShowExceptionDetails=true; and then copy and paste the full error message.

112.209.61.222 (talkcontribs)

its already update but it wont show the video player (thumbnail)

Reply to "Database error"

How to make .mov files appear on their file pages

1
Guillaume Taillefer (talkcontribs)

Hello, I'm trying to know how I would be able to make uploaded .mov files able to be played on the TimedMediaHandler player? I know mine works as it plays mp4 and webm files, but for some weird reason, despite .mov files making up a portion of the types of video files now, they are unable to be played. Is it possible to add new types of video files like .mov and .wmv files to be able to be played by the videojs player? And if so how? Thanks

Reply to "How to make .mov files appear on their file pages"

Thumbnail creation error

3
Asterton (talkcontribs)

Hi, i have some problem with an thumbnail creation.

I have two wikis - prod and test.

OS - Debian 11 bullseye

Wiki - 1.35

On the test, the extension works without problems, on prod, when loading some videos, an error thubnail creation. The problem is not observed with all video files. However, problematic videos load fine on the test wiki.

I can't figure out where to look for the problem.

Reinstalled the extension. LocalSettings compared. ffmpeg reinstalled. ImageMagick installed

Error creating thumbnail: '/usr/bin/ffmpeg' -nostdin -threads 1 -ss 102 -y -i '/usr/share/mediawiki/images/8/81/Vіdeo_іnstruction_configurator_of_gearboxes15.mp4' -ss 1 -s 1280x720 -f mjpeg -an -vframes 1 '/tmp/transform_75cc2215ccd5.jpg' 2>&1 wgMaxShellMemory: 307200 ffmpeg version 4.3.4-0+deb11u1 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 10 (Debian 10.2.1-6) configuration: --prefix=/usr --extra-version=0+deb11u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/usr/share/mediawiki/images/8/81/Vіdeo_іnstruction_configurator_of_gearboxes15.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf58.12.100 Duration: 00:03:27.01, start: 0.000000, bitrate: 1367 kb/s Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1169 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 193 kb/s (default) Metadata: handler_name : SoundHandler Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native)) [swscaler @ 0x5643c4470f40] deprecated pixel format used, make sure you did set range correctly Output #0, mjpeg, to '/tmp/transform_75cc2215ccd5.jpg': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf58.45.100 Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default) Metadata: handler_name : VideoHandler encoder : Lavc58.91.100 mjpeg Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A [h264 @ 0x5643c4115ec0] get_buffer() failed [h264 @ 0x5643c4115ec0] thread_get_buffer() failed [h264 @ 0x5643c4115ec0] decode_slice_header error [h264 @ 0x5643c4115ec0] no frame!

And this message repeating many times:

Error while decoding stream #0:0: Invalid data found when processing input [h264 @ 0x5643c4115ec0] get_buffer() failed [h264 @ 0x5643c4115ec0] thread_get_buffer() failed [h264 @ 0x5643c4115ec0] decode_slice_header error [h264 @ 0x5643c4115ec0] no frame!

And then

Cannot allocate memory frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=00:00:00.00 bitrate=N/A speed= 0x video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used) Conversion failed!


If i run in console:

'/usr/bin/ffmpeg' -nostdin -threads 1 -ss 102 -y -i '/usr/share/mediawiki/images/8/81/Vіdeo_іnstruction_configurator_of_gearboxes15.mp4' -ss 1 -s 1280x720 -f mjpeg -an -vframes 1 '/tmp/transform_75cc2215ccd5.jpg' 2>&1

jpeg alrady created.


What else needs to be checked? I have no idea...

Tacsipacsi (talkcontribs)

The error message states that it exceeded the $wgMaxShellMemory limit—this is a MediaWiki configuration, so it of course doesn’t apply if you run ffmpeg directly from the command line, and it may be configured differently for the two wikis (although it’d be weird to do so). In any case, you’ll need to increase the limit.

Asterton (talkcontribs)

Thanks a lot!

I tried to set this parameter, but left the value 307200 and, of course, did not get a result.

Reply to "Thumbnail creation error"

Question about a placeholder

4
Pacha Tchernof (talkcontribs)
Bawolff (talkcontribs)
Pacha Tchernof (talkcontribs)

I'm not sure that I completely understood what you wrote, but thanks a lot for a try!

Just in case: in Russian language, words could have different forms - cases. And I would like to know if I add a GRAMMAR with prepositional case before mysterious "$1", would the language name change depending on the provided case?

For example, in Russian, the word "English" have seven forms (even if two forms are equal, they are used in the different places): английский, английского, английскому, английский, английским, английском.

You see? Most of them have different endings and to make smooth and good translation (instead of weird construction I build there) I just need to know, may I use GRAMMAR: to use cases, proper word order and syntax to contribute better translations. Dixi.

Bawolff (talkcontribs)

So the thing is, GRAMMAR is implemented differently in different languages. Some languages have a complete implementation, where it works with any word. In Other languages it doesn't work very well and only works for select words. I am not sure what the case is for russian (which is why i suggested asking at translatewiki support as they are more familiar). You could test GRAMMAR at ru:Special:expandTemplates .

If i had to guess though, i would guess the answer is yes, but i'm not 100% sure.

Reply to "Question about a placeholder"
Carloposo (talkcontribs)

Hello,

I am trying to disable all the transcoding jobs as I don't need to provide different versions of the video.

I have included $wgEnableTranscode = false; in my Localsettings.php. Unfotunately it keeps on converting every time I upload an mp4.

I have also added $wgEnabledTranscodeSet = [] but didn't change much.

Thank you.

Misdre (talkcontribs)

Just edit extension.json in the extension files. This is not ideal, a bit hackish and thus not recommended but TimedMediaHandler never handled variables from LocalSettings properly - at least not this one anyway.


You may want to try setting $wgEnabledTranscodeSet = []; which might work for you - it didn't for me.

Reply to "Disable transcoding"

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

6
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.

78.54.53.70 (talkcontribs)

Hi,

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 ;)

77.11.15.116 (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)


Sm8ps (talkcontribs)

I would like to chime in on issue nr. 4. I use SimpleScreenRecorder to produce a VP8-720p video file. When uploaded, it is unnecessarily transcoded to another VP8-720p video file.

For instance, I have Video.webm of 51.3 MB with VP8-720p-15fps-398kbps and Vorbis-48kHz-112kbps. The transcoding produces Video.720p.webm with almost exactly the same specs, the only difference lying in the bitrate (581kbps) and thus an increased file size of 74.9 MB. This does not make sense as the video quality of the transcoded copy cannot get any better with an increased bitrate.

I think the extension should only mark the WEBM-video file for transcoding if any of the basic settings (frame size, fps, video/audio bit rate) of the original are (strictly) greater than the standard settings. Does that make sens? I am no expert at all with video encoding.

TheDJ (talkcontribs)

So the problem is that there can be a LOT of settings and knowing which combination works in all browsers is actually pretty hard. This is why it will always transcode, to ensure that it has a known usable version to present to browsers. (FYI: Youtube does this as well, you never see your original again after uploading it there).

Sm8ps (talkcontribs)

Thanks for your response, @TheDJ (and sorry for my late reaction)! Your explanations do make perfect sense to me.

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

TimeMediaHandler and EmbedVideo comparison

3
Summary by Omotecho

mp4 included as type of video to upload via any method for uploading files (Special:Upload, UploadWizard etc) : details are referred at Extension:TimedMediaHandler#Client support.

Carloposo (talkcontribs)

Hello,

I am using EmbedVideo at the moment. It fits my needs 80%. I think it's an amazing extension. I am not interested in embedding videos from external sources but to upload and stream my own on a local server.

I have few questions for those of you using TMH:

- is it possible to use mp4?

- is the process of uploading and embedding the video in a page flawless?

- can I upload a video as I would upload a picture, using the VisualEditor?

- does TMH perform an encoding for every uploaded video?

- is TMH stable/future proof? (sorry for this question, I know it might sound a bit silly but I am working on a corporate wiki and need to comply to a long-term strategy)

Thank you.

Tacsipacsi (talkcontribs)

- is it possible to use mp4?

According to § Client support, yes. Support for formats not used on Wikimedia wikis can be a bit more spotty (e.g. thumbnails may not be supported), though.

- is the process of uploading and embedding the video in a page flawless?

- can I upload a video as I would upload a picture, using the VisualEditor?

TimedMediaHandler plays videos and sound files uploaded in the File namespace, so any method for uploading files (Special:Upload, UploadWizard…) should work. I don’t have experience with VisualEditor, but I don’t see any reason for it not to work.

- does TMH perform an encoding for every uploaded video?

Yes, as far as I know, for every video. See c:File:Videoonwikipedia.ogv#transcodestatus for an example.

- is TMH stable/future proof?

It’s used on public Wikimedia wikis, so probably yes. Unless something catastrophic happens, it should be supported “forever” (or if goes unsupported, there will be a proper replacement).

Carloposo (talkcontribs)

Thank you @Tacsipacsi I am testing it as we speak.

Return to "TimedMediaHandler" page.