Extension talk:EmbedVideo

Jump to navigation Jump to search

About this board

mp4 upload fails when EmbedVideo extension enabled

2
Relayman357 (talkcontribs)

I just installed the EmbedVideo extension on my personal wiki (1.35.1) and it works fine with .mp4 files that had previously been uploaded to my wiki. After enabling the extension I tried to upload a new .mp4 to the wiki and I get the following internal error message. I can upload other file types (e.g. *.pdf) fine.

[8fe29de11236b2126af20734] /mediawiki-1.35.1/index.php/Special:Upload Error from line 119 of /var/www/html/mediawiki-1.35.1/extensions/EmbedVideo/classes/media/FFProbe.php: Call to undefined method FSFile::getLocalRefPath()
Backtrace:
#0 /var/www/html/mediawiki-1.35.1/extensions/EmbedVideo/classes/media/FFProbe.php(136): EmbedVideo\FFProbe->getFilePath()
#1 /var/www/html/mediawiki-1.35.1/extensions/EmbedVideo/classes/media/FFProbe.php(48): EmbedVideo\FFProbe->invokeFFProbe()
#2 /var/www/html/mediawiki-1.35.1/extensions/EmbedVideo/classes/media/FFProbe.php(68): EmbedVideo\FFProbe->getMetaData()
#3 /var/www/html/mediawiki-1.35.1/extensions/EmbedVideo/classes/media/VideoHandler.php(103): EmbedVideo\FFProbe->getStream()
#4 /var/www/html/mediawiki-1.35.1/includes/utils/MWFileProps.php(89): EmbedVideo\VideoHandler->getImageSize()
#5 /var/www/html/mediawiki-1.35.1/includes/upload/UploadBase.php(547): MWFileProps->getPropsFromPath()
#6 /var/www/html/mediawiki-1.35.1/includes/upload/UploadBase.php(482): UploadBase->verifyPartialFile()
#7 /var/www/html/mediawiki-1.35.1/includes/upload/UploadBase.php(390): UploadBase->verifyFile()
#8 /var/www/html/mediawiki-1.35.1/includes/upload/UploadFromFile.php(95): UploadBase->verifyUpload()
#9 /var/www/html/mediawiki-1.35.1/includes/specials/SpecialUpload.php(516): UploadFromFile->verifyUpload()
#10 /var/www/html/mediawiki-1.35.1/includes/specials/SpecialUpload.php(214): SpecialUpload->processUpload()
#11 /var/www/html/mediawiki-1.35.1/includes/specialpage/SpecialPage.php(600): SpecialUpload->execute()
#12 /var/www/html/mediawiki-1.35.1/includes/specialpage/SpecialPageFactory.php(635): SpecialPage->run()
#13 /var/www/html/mediawiki-1.35.1/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#14 /var/www/html/mediawiki-1.35.1/includes/MediaWiki.php(940): MediaWiki->performRequest()
#15 /var/www/html/mediawiki-1.35.1/includes/MediaWiki.php(543): MediaWiki->main()
#16 /var/www/html/mediawiki-1.35.1/index.php(53): MediaWiki->run()
#17 /var/www/html/mediawiki-1.35.1/index.php(46): wfIndexMain()
#18 {main}

Below is what I have in my LocalSettings.php. If I comment out the wfLoadExtension( 'EmbedVideo' ); line then I am able to upload .mp4 files no problem. So, as a work around that is what i'm doing. After uploading the files I then uncomment that line and the EmbedVideo extension works fine.

wfLoadExtension( 'EmbedVideo' );
$wgEmbedVideoEnableVideoHandler = true;
$wgEmbedVideoEnableAudioHandler = true;
$wgEmbedVideoAddFileExtensions = false;

Is this a known bug?

I'm running MediaWiki 1.35.1 on Ubuntu Mate 20.10 (Groovy Gorilla). PHP 7.4.9, MariaDB 10.3.25. The EmbedVideo extension is version 2.8.0.

Bozhob (talkcontribs)

After updating EmbedVideo to v2.9.0 I received the same error: Error from line 119 of extensions/EmbedVideo/classes/media/FFProbe.php: Call to undefined method FSFile::getLocalRefPath() I was not able to solve the problem and had to downgrade to version 2.8.0

Reply to "mp4 upload fails when EmbedVideo extension enabled"
Summary by Dinoguy1000

Video was replaced.

Dinoguy1000 (talkcontribs)

@Pppery: could we use a video that isn't religious for the example image and code samples throughout the page? WMF properties have enough biases as it is, without adding a religious bias as well.

Pppery (talkcontribs)
Dinoguy1000 (talkcontribs)

Having a boring-looking video might be best anyways, since it'd discourage people from focusing on the video choice much.

Pppery (talkcontribs)

It seems a little far-fetched to me that someone would make a claim of bias that the documentation for a video-embedding extension shows a video that happens to be religious.

Nevertheless, I would be willing to re-make this screenshot if someone else provides me with a link to a suitable creative-commons-licensed video on YouTube -- I don't feel like searching for a video that no one could possibly claim is objectionable myself.

PseudoSkull (talkcontribs)

@Pppery: This was an eye-opener to me too. I knew immediately from looking at it that this was footage of Stephen Anderson, the same radical Baptist preacher who has publicly exclaimed that he wants the government to execute homosexuals! I'm not accusing you of religious bias here, since you picked the video at random and you may not even have been aware of who Anderson is and his horrible beliefs, but we really shouldn't be including anything religious or political, especially something from a blatantly bigoted preacher, in technical documentation that has nothing to do with religion or politics. I ask that you please remove the image and find a different video example to use here. Even just an image depicting a man like this is highly inappropriate and can be taken both as highly offensive and that MediaWiki has a fundamentalist Baptist bias.

Pppery (talkcontribs)

I repeat my offer from earlier. I'll remake the screenshot if somebody else provides a source creative-commons-licensed video.

PseudoSkull (talkcontribs)

Since you asked for a video example, I found this one in just a few minutes: from the Wikimedia Foundation's YouTube channel, look up "Knowledge Belongs to All of Us". This kind of video seems appropriate for technical documentation as an inoffensive and non-political example. (I tried to send you a video link here but the stupid filter disallowed it. It should know better; I've been active for years on several WMF projects through this account!)

Pppery (talkcontribs)

OK, Yes Done.

Emikulic (talkcontribs)

Pppery, eEveryone has a thing so asking someone to post a suitable video link vs just comment on yours is a good idea. That one would not bother me at all as I simply would not pay attention to it.

Dinoguy1000 (talkcontribs)

Admittedly I might be sensitized to it because I was raised in a Baptist church. That being said, I don't think we should say "it's just a hypothetical so there's no reason to bother", especially when we have so many potential alternatives. I'll probably poke around and see if I can find something else after a bit.

NemesisAT (talkcontribs)

Embedded videos don't appear nicely in the VisualEditor, is it possible for this to be fixed, or to add some wikitext surrounding the video that'll hide it when the VisualEditor is opened?

Reply to "VisualEditor"

Add "Embed Video" icon to WikiEditor toolbar

3
Felix Englisch (talkcontribs)

If you are using EmbedVideo in combination with Extension:WikiEditor, you might want to make it easier for your users to insert a video. It is quite easy to add an icon to the toolbar which automatically inserts the code snippet required for embedding. Simply add the following to you LocalSettings.php:

$wgUseSiteJs = true;


Then, open the page "MediaWiki:Common.js" on your wiki and insert the following:

var customizeToolbar = function () {
  $('#wpTextbox1').wikiEditor('addToToolbar', {
      section: 'advanced',
      group: 'insert',
      tools: {
        "Video": {
          label: 'Embed video',
          type: 'button',
          icon: '//upload.wikimedia.org/wikipedia/commons/6/64/Video_Camera_-_The_Noun_Project.svg',
          action: {
            type: 'encapsulate',
            options: {
              pre: '{{#ev:youtube|',
              peri: "Link to YouTube video",
              post: '|400|right|Caption}}'
            }
          }
        }
      }
    });
};
    
    /* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
    if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
    mw.loader.using( 'user.options' ).then( function () {
    if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
      $.when(
        mw.loader.using( 'ext.wikiEditor' ), $.ready
      ).then( customizeToolbar );
    }
  } );
}


Of course, you can change the default parameters of the video and also the icon. Just visit https://commons.wikimedia.org/wiki/Main_Page and look for a better one. And for more information about editing the toolbar, see Extension:WikiEditor/Toolbar customization.

Have fun!


Uncopy (talkcontribs)

Thanks Felix for updating you code, I removed my copy.

Felix Englisch (talkcontribs)

Thank you, User:Uncopy, that helped a lot! Due to your reply I also found some mistakes in my code (which are still in yours, I am sorry), so this was more than helpful.

Reply to "Add "Embed Video" icon to WikiEditor toolbar"

Would adding a youtube link create a corresponding File:* page?

2
TitusiMW (talkcontribs)

I have a quick question. Would this extension create a corresponding File:* page for a youtube link so I can start using that File:* to create gallery of thumbnails etc using MediaWIki's usual media/files related features?

Dinoguy1000 (talkcontribs)

Nope. A feature like that would be useful, though (I've had a few times I've missed it while working on a wiki). Wikia/FANDOM's video tool does have that feature, though I don't know where in their codebase you'd have to look to see how it's implemented (and it's anyone's guess how much work it'd be to port that functionality to be usable on a vanilla installation).

Reply to "Would adding a youtube link create a corresponding File:* page?"

Embed video based on file directory

1
AmazingTrans (talkcontribs)

I am using a local Mediawiki, and i have a video file just say at "c:\video.mp4".

Is it possible to embed this video in the mediawiki?

Reply to "Embed video based on file directory"

The extension is still experimental

6
TespSam (talkcontribs)

Why is this extension listed as stable if it hasn't been tested on windows? Why aren't windows and ffmpeg even mentioned in the documentation?

FreedomFighterSparrow (talkcontribs)

Probably because most people don't run MediaWiki on Windows... Also, you might want to tell people what is the actual issue you are facing.

TespSam (talkcontribs)

I have a requirement to run windows on my server. The issue I'm having is that people have made assumptions. Everyone knows what happens when you assume things.

Extension looks for ffprobe in the the /usr/bin directory so that it can execute it as a shell command. Helpful suggestions have included things like "add the /usr/bin directory to the php config on your windows server" and "why aren't you running linux". I put a try catch block around it as the functionality is apparently entirely unnecessary. Seems to work fine on my test environment so I might push to production.

FreedomFighterSparrow (talkcontribs)

It looks like v2.5.2 aims to fix your issue.

TespSam (talkcontribs)

That's cool, I'm on v2.7.3.

FreedomFighterSparrow (talkcontribs)

My bad, I was looking at the dates completely wrong and figured it was something new... I'll try to fix this soon.

Edit: I took a look, and I cannot see where you would have this problem. The FFProbe class indeed checks for ffprobe, but uses a file_exists function before trying to use it, so it shouldn't cause any problems. This is certainly true in v2.7.3. What specific error are you getting?

Reply to "The extension is still experimental"
Aka sektor (talkcontribs)

What about coub.com support for this extension?

Reply to "coub.com support"
Kevin Perkin (talkcontribs)

As soon as I include the parameter wfLoadExtension( 'EmbedVideo' ); in the LocalSettings.php file I get a server error when I try and access my wiki. It's like it can't find the extension code, but that is all present in the specified directories. Has anybody else experienced similar issue?

Reply to "Installation problems"

Doesn't embed uploaded MP4 files, am I missing something?

1
DigitalManiak3k (talkcontribs)

When I try to embed an uploaded .MP4 file I use the "{{#evu:*link to mp4 on http server*|alignment=right}}" and get the result back "Couldn't parse video from *link to mp4 on http server*"

Reply to "Doesn't embed uploaded MP4 files, am I missing something?"