Extension talk:TimedMediaHandler

About this board

128.183.226.220 (talkcontribs)

I've gotten this extension installed and working, but I am very confused with (local) MP4 video handling. Please give me a clue.

1) Is it possible to upload an MP4 (HTML5, right?) video that can be played without transcoding it to some other (OGV?) format?

2) Is it possible to have the video (auto)play inside the page without the "lightbox" player popping up?


Thanks in advance.

Ciencia Al Poder (talkcontribs)

Autoplay is currently being worked on phab:T116501, but non-autoplay videos will get the lightbox player regardless.

Maybe Extension:EmbedVideo (fork) will serve you better than TimedMediaHandler, though. It appears it allows autoplay and embed the inline player, without generating derivative transcodings.

TheDJ (talkcontribs)

And mp4 handling by TMH isn't really well tested/validated, because mp4 is not in use by Wikimedia.

Reply to "MP4 handling"
Kimmywingz (talkcontribs)

Hello,

I am trying to get TimedMediaHandler enabled and the TimedText feature working. The client ask is to have a video transcript available for uploaded videos - I am assuming this is the purpose of the TimedText? The TMH is an extension bundled in our MW image and I cannot edit the files directly.

Here are the versions:

MediaWiki 1.39.1
PHP 7.4.33
TimedMediaHandler 0.6.0

Here is what's in LS.p:

wfLoadExtension('TimedMediaHandler');

$wgFFmpegLocation = '/usr/bin/ffmpeg';

$wgTimedTextNS = 710;

$wgTmhEnableMp4Uploads = true;

The TMH is showing up under Special:Version. Videos can be successfully uploaded and embedded with EmbedVideo.

However, with embedVideo disabled, the following happens with TMH videos

  1. It either links to the video file rather then embedding it
  2. It shows a gray bar with play button, but no video (audio works) (this only works if the file was previously embedded with EmbedVideo)
  3. It shows a message "Error creating thumbnail:"

When trying to create a new TimedText page, it has me select the language and takes me to the edit screen. When attempting to save the timedText page the following error displays:

[6d77ab5662cf7a241109a524] /wiki/TimedText:ExampleVideoAudio.mp4.en.srt Error: Call to a member function toHtml() on bool

Backtrace:

from /var/www/mediawiki/w/canasta-extensions/TimedMediaHandler/includes/TimedTextPage.php(243)

#0 /var/www/mediawiki/w/canasta-extensions/TimedMediaHandler/includes/TimedTextPage.php(142): MediaWiki\TimedMediaHandler\TimedTextPage->getVideoHTML(Title)

#1 /var/www/mediawiki/w/canasta-extensions/TimedMediaHandler/includes/TimedTextPage.php(69): MediaWiki\TimedMediaHandler\TimedTextPage->renderOutput(OutputPage)

#2 /var/www/mediawiki/w/includes/actions/ViewAction.php(78): MediaWiki\TimedMediaHandler\TimedTextPage->view()

#3 /var/www/mediawiki/w/includes/MediaWiki.php(542): ViewAction->show()

#4 /var/www/mediawiki/w/includes/MediaWiki.php(322): MediaWiki->performAction(MediaWiki\TimedMediaHandler\TimedTextPage, Title)

#5 /var/www/mediawiki/w/includes/MediaWiki.php(904): MediaWiki->performRequest()

#6 /var/www/mediawiki/w/includes/MediaWiki.php(562): MediaWiki->main()

#7 /var/www/mediawiki/w/index.php(50): MediaWiki->run()

#8 /var/www/mediawiki/w/index.php(46): wfIndexMain()

#9 {main}


Any help is greatly appreciated, thank you for your time and expertise.

TheDJ (talkcontribs)

EmbedVideo and TimedMediahandler are not really compatible and probably shouldn't both be installed at the same time.

wrt to the error. I think that happens when timedmediahandler is unable to generate a thumbnail. Which likely means that timedmediahandler wasn't told about the path of the ffmpeg command.

Kimmywingz (talkcontribs)

Thank you for your response. EmbedVideo is disabled.

For the ffmpeg command, this is the line in the LS.p - $wgFFmpegLocation = '/usr/bin/ffmpeg';

I've tried it with and without this line with no change (same error). I don't know if it should point to a different location, and if so how would I determine that location. Would I need ImageMagick enabled/disabled to work with TMH? Does it make a difference?

Thank you

Kimmywingz (talkcontribs)

How might I determine what the correct path for wgFFmpegLocation should be if not the default /usr/bin/ffmpeg?

Are there any other thoughts on resolving this error, it is still persisting and I am unsure how to proceed?

Thank you

TheDJ (talkcontribs)

Best is looking at the logs. See also Manual:How to debug. and see if you can find more details about the error context.

> How might I determine what the correct path for wgFFmpegLocation should be if not the default /usr/bin/ffmpeg?

I'm assuming you are on linux, but which ffmpeg will generally give you the right path of the binary.

Reply to "TimedText"

Poster / hero / thumbnail image for a video?

4
Calvin27516 (talkcontribs)

I see from the extension page that

[[File:Video.ogv|File:Video.ogv]]

"Display a video at its nominal size. Displays a still image from the midpoint with a play button to start an embedded player."

My first question is, why does the file have to be specified twice? When I specify it just once, it seems to work just fine. So I'm not sure what I am missing.

But my real question is, "Is there ay way to override the the default behavior of displaying a still image from the midpoint of the video?" I have uploaded a hero / poster image from the video as an image file. But I can't see any syntax that let's me specify it as the image to use.

Is this possible?

Tacsipacsi (talkcontribs)

My first question is, why does the file have to be specified twice? When I specify it just once, it seems to work just fine. So I'm not sure what I am missing.

The second occurrence is actually the caption, I have no idea why the examples look like this.

Is there ay way to override the the default behavior of displaying a still image from the midpoint of the video?

It is possible to override which frame of the video to display (using |thumbtime=). It is not possible to display a completely different image. (I’m not the developer who made this decision, but to be honest, I like that it’s this way: I always find it annoying when I click on a YouTube video, and the scene visible on the thumbnail – because of which I clicked on it – doesn’t come up at all in the video. With TimedMediaHandler’s restrictions, this couldn’t happen.)

Calvin27516 (talkcontribs)

Thank you for the response. I was so hung up on specifying an alternate image file the way YouTube lets do that I completely skipped over the thumbtime parameter. I can live with that.

TheDJ (talkcontribs)

I've corrected the examples (will take some time to update due to the translations)

Reply to "Poster / hero / thumbnail image for a video?"

Problems with the player at WikiFarm

5
Fokebox (talkcontribs)

Hello!

I have wiki farm with language subdomains and subdomain with keeping all files.

  • en.mywiki.org - My English wiki
  • de.mywiki.org - German one
  • files.mywiki.org - Keep all images, video etc.

I have following settings at LocalSettings.php for storing files:

# One storage and uploads
$wgUseSharedUploads             = true;
$wgHashedSharedUploadDirectory  = true;
$wgUploadNavigationUrl   = 'https://files.wikijournal.org/wiki/Special:Upload';
$wgUploadPath            = '/w-wiki/images';
$wgSharedUploadPath      = $wgUploadPath;
$wgUploadDirectory       = "/var/www/admin/www/w/images";
$wgSharedUploadDirectory = $wgUploadDirectory;

# Shared files
$wgFetchCommonsDescriptions = true;
$wgSharedUploadDBname = 'mywiki_org';
$wgSharedUploadDBprefix = 'files__'; # Table name prefix
$wgRepositoryBaseUrl = "https://files.mywiki.org/wiki/File:";

When installed the extension and uploaded my video, I can view the video with the player on the page of uploaded file https://files.mywiki.org/wiki/File:MyVideo.mp4.

But when I insert the file to the page at en.mywiki.org I see the warning "Error missing media source". Can you please help to setup the extension so that I can use player at my all wiki farm subdomains.

Ciencia Al Poder (talkcontribs)

It is/was incompatible with ForeignDBRepo phab:T63986 until MediaWiki 1.41.

Fokebox (talkcontribs)

Does it mean that the issue is resolved at MW 1.41 and all be fixed as soon as I upgrade? Now I use MW 1.40

TheDJ (talkcontribs)

it's also not super well tested with mp4 honestly.

Fokebox (talkcontribs)

Well, I'll try to use other format then as well

Reply to "Problems with the player at WikiFarm"

Error running /bin/bash - syntax error near unexpected token

4
195.80.103.225 (talkcontribs)

[exec] Error running /bin/bash '/volume2/www/test2.example.com/w/vendor/wikimedia/shellbox/src/Command/limit.sh' ''\''/volume2/www/bin/ffmpeg-6.0-amd64-static/ffmpeg'\'' -nostdin -threads 1  -y -i '\''/volume2/www/test2.example.com/w/images/6/6b/Test.ogv'\'' -ss 1  -s 1920x1080 -f mjpeg -an -vframes 1 '\''/tmp/transform_7eb9fb4c6892.jpg'\'' 2>&1' 'SB_INCLUDE_STDERR=;SB_CPU_LIMIT=180; SB_CGROUP='\'''\''; SB_MEM_LIMIT=629145600; SB_FILE_SIZE_LIMIT=104857600; SB_WALL_CLOCK_LIMIT=180; SB_USE_LOG_PIPE=yes': /volume2/www/test2.example.com/w/vendor/wikimedia/shellbox/src/Command/limit.sh: line 4: $'\r': command not found

/volume2/www/test2.example.com/w/vendor/wikimedia/shellbox/src/Command/limit.sh: line 6: syntax error near unexpected token `$'{\r''

/volume2/www/test2.example.com/w/vendor/wikimedia/shellbox/src/Command/limit.sh: line 6: `cleanup() {

Tacsipacsi (talkcontribs)

Does by any chance your host computer run Windows? The error messages complain about excess carriage return characters, which are used by Windows, but not by Linux.

195.80.103.225 (talkcontribs)

Apologies for the delay. The host is running on a Synology NAS Web Station, which I believe is using a Linux kernel.

Tacsipacsi (talkcontribs)

Then maybe you copied from a Windows computer? I have no experience administering Linux servers from Windows, but I can imagine line endings could be problematic. If not, then I have no idea what’s going wrong.

Reply to "Error running /bin/bash - syntax error near unexpected token"

How to change resolution permanatly?

1
80.153.140.71 (talkcontribs)

I would like to change the resolution settings for all videos in my mediawiki page - has anyone an idea how to do it?

Reply to "How to change resolution permanatly?"
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"