Extension talk:FlvHandler

The player loads by won't play the video files. It says '''200 Stream not found. NetStream.Play.StreamNotFound, clip:'[Clip]'''

Then it displays the directory of where the file is.- 69.108.221.134
 * Is this a PHP error or a Flash applet error? What is the name of the FLV file?  If you look at the article for the video file itself, do you see the preview image?  Do you have a URL for your wiki I can look at to see the error? -- Malvineous 10:58, 14 May 2009 (UTC)


 * Here's a link with the videos. http://www.wikiaudio.org/index.php?title=Sandbox
 * I don't know what kind of error this is, I am a novice when it comes to development. I just follow instructions.
 * Btw I have another FLV extension installed and it seems to be doing roughly the same thing...not finding the FLV file to play but I know for a fact it's uploaded and in the directory the player is looking in - 99.167.101.80


 * Well the problem is that the FlvHandler code is trying to load the movie from http://www.wikiaudio.orgimages/e/eb/TEST.flv (note the missing slash between the 'org' and 'images'.) My guess is that you've changed the image path or upload path somewhere in your config (LocalSettings.php?) but left off a trailing slash somewhere.  I'm surprised you don't have the same problem uploading images to the wiki.  If you can find where that change has been made, both extensions should start working. -- Malvineous 22:28, 14 May 2009 (UTC)


 * I went to the localsetting.php file and on $wgUploadPath = "images"; and $wgUploadDirectory = "images"; I add a slash / before images.
 * It still didn't work and wouldn't allow for regular image uploads when I did this.
 * The other video player (the black one) showed a / slash before the word images in it's error display, so I know it recognized the change I made to LocalSettings.php
 * Is there anywhere else on the LogicSetting.php file you can think of? - 69.108.221.134


 * That's a tricky one. What's your $wgScriptPath set to?  That should start with a slash.  Otherwise can you stick your LocalSettings.php somewhere as a text file so I can see it? (with any passwords removed of course) -- Malvineous 10:32, 15 May 2009 (UTC)


 * The $wgScriptPath is set to     = "";
 * So in full it looks like this   $wgScriptPath       = "";
 * In short it looks like it isn't set to anything. What should it be set to ?
 * The LocalSetting.php:    http://www.yousendit.com/transfer.php?action=batch_download&batch_id=MnFqTkFsSWhtMExIRGc9PQ


 * Well it's the path to your index.php, so try setting it to a single slash and let me know if that makes a difference. (By the way, you can sign your messages here with ~ which automatically puts your name and the time in.) -- Malvineous 12:11, 15 May 2009 (UTC)


 * It kinda screwed up the site altogether, it made it look different and the sandbox and other pages wouldn't load. - 69.108.221.134 12:31, 15 May 2009 (UTC)


 * Actually just looking at your LocalSettings.php, you have all the extension require_once lines right at the top, before all the options are set. Does it make a difference moving those lines right to the end of LocalSettings.php?  Otherwise I'm afraid I'm out of ideas, I don't think MediaWiki is designed to install into the root directory of the webserver - you'll probably have to make a "wiki" folder and install into that (so your site is at http://www.wikiaudio.org/wiki/index.php instead.)  You can still "hide" this to make articles appear at nice addresses like http://www.wikiaudio.org/Main_Page, but I think the wiki itself needs to be in a subdirectory. -- Malvineous 12:57, 15 May 2009 (UTC)


 * Thanks for the help - suffice to say moving the required once messages didn't do anything. I will see about reinstalling in a WIKI folder sub directory. Could you keep this thread alive ( don't delete) and as I try and figure this out I will update for future troubleshooting etc. 207.47.18.254 13:09, 15 May 2009 (UTC)


 * BTW - can you think of anyway to modify the extension to accommodate the fact that we didn't install in a Wiki folder?? - 69.108.221.134 13:12, 15 May 2009 (UTC)
 * No problem, sorry I couldn't come up with a solution. There shouldn't be a need to reinstall the wiki, just moving it into a subfolder and setting $wgScriptPath, $wgUploadPath, etc. should be enough.  It might be possible to modify the extension though, in FlvHandler.php line 110 is where it generates the full URL to the .flv file.  If you change this from   to   then it should add in the extra slash that's missing from somewhere.  I've tried to follow the getUrl function but I can't see exactly where it gets the path from.  At any rate that change should make it work on your wiki, and break on everyone else's :-) -- Malvineous 00:52, 16 May 2009 (UTC)


 * We changed the directory to "Wiki" and still doesn't want to work. http://www.wikiaudio.org/wiki/index.php?title=Sandbox  Could you tell me exactly what to change the $wgScriptPath, $wgUploadPath and other LocalSettings to ? - 69.108.221.134 08:24, 16 May 2009 (UTC)


 * and the defaults should then be fine (so comment out any changes to $wgUploadPath, $wgUploadDirectory, $wgMath*) and it should work. You might need to purge the cache of any existing pages as they might still show old URLs (broken images) but the easiest way to check this is to edit the page and do a preview - if the image etc. works in the preview then all is well.  Don't forget to undo any changes to FlvHandler.php if you've applied my suggestion from above! -- Malvineous 08:35, 16 May 2009 (UTC)


 * I did both suggestions and still no dice. I tried changing the Flvhandler.php and it DID show an extra slash in the players window - but it still didn't play the file. The error simply displayed the slash.I also moved everything to a folder called Wiki and updated the localsetting.php file - didn't work. Anyway, thanks for your help. I appreciate it. - 69.108.221.134 08:49, 16 May 2009 (UTC)


 * That's very strange. The only other thing I can suggest is to try upgrading MediaWiki.  You're running 1.13.1 but I've only tested FlvHandler on 1.13.3 and 1.14.  If upgrading is too difficult (it's really quite easy though) you could try setting $wgUploadPath to "/wiki/images" but that should happen automatically.  The reason why modifying FlvHandler showed the slash but didn't work is because it was loading the file from "/images" but by that time you had moved everything into "/wiki/images".  If you modify FlvHandler.php again and set   then it will probably work, but again, it's a bit dodgy ;-) -- Malvineous 08:57, 16 May 2009 (UTC)


 * I upgraded to mediawiki 1.14, I made sure the directory was "Wiki" and then I modified the $strURL = $wgServer.'/wiki/'.$file->getUrl; to read accordingly and..holy crap..apparently it works! Thanks. If you ever have any audio related stuff you think I can help with feel free to ask. I appreciate this a lot! - 99.167.101.80 12:29, 16 May 2009 (UTC)


 * No worries, glad you got it working! That's a bit odd that you still had to modify the PHP file to get it to work, I might have to look into it in case I've generated the URL incorrectly (although it does work fine on my own MW installation.)  Would you mind posting an updated version of your LocalSettings.php again?  If I can replicate your config locally I might be able to see why it's not working.  -- Malvineous 12:46, 16 May 2009 (UTC)


 * Is there any way to have the movies go to the right. When I type [ [image:MOVE.flv|right]] or [[image:MOVE.flv|thumb]] it doesn't behave like a conventional image. I will upload my localsettings in a bit and add a link.


 * Local settings http://www.yousendit.com/download/MnFnUGhkbThqV0IzZUE9PQ - 99.167.101.80 15:01, 16 May 2009 (UTC)
 * Thanks for that, I've worked out what the problem is. In your LocalSettings.php you've set $wgUploadPath to "images" but this variable must start with a slash.  The default value is "${wgScriptPath}/images" which expands to "/wiki/images".  Since this is the default, if you remove both $wgUploadPath and $wgUploadDirectory from your LocalSettings.php, both FLV extensions will start working again.  I have also just released version r3 of FlvHandler, which includes a fix (so it will work, just like images do, even if you leave $wgUploadPath set incorrectly) and it also implements left and right floating alignment. -- Malvineous 02:24, 17 May 2009 (UTC)


 * Cool. I added it and it works too. If I wanted to generate the thumbnail ( it isn't generating) what exactly would I have to do?99.167.101.80 10:32, 17 May 2009 (UTC)


 * You'll need to contact your hosting provider and ask them to install FFmpeg on your webserver. -- Malvineous 10:56, 17 May 2009 (UTC)

Great job ! Although I noticed a bug in FlvHandler.php : variables $fp and $hp should be replaced with $frameParams and $handlerParams, respectively. --217.109.116.16 12:04, 12 May 2009 (UTC)
 * Well spotted, thanks for letting me know! I've uploaded version r2 which incorporates your fix. -- Malvineous 12:40, 12 May 2009 (UTC)

Add your extension to mediawiki svn
Hello, It looks like you may have done the best job in incorporating FlowPlayer into MediaWiki. However, we would all benefit even more if you would add it to MediaWiki SVN instead of hosting it at your own site. Thanks. --Alterego 18:54, 14 June 2009 (UTC)
 * Hi, thanks for the positive feedback! I'd be more than happy to add it to MW SVN, but I'm not sure what benefit that would provide - or even whether the current devs would consider this extension worthwhile! -- Malvineous 21:53, 14 June 2009 (UTC)


 * Having an extension SVN makes it easier to download, makes it more trustworthy-looking, provides version control, and ensures that it will still be available if you get run over by a bus. Important considerations, I know.  You can request commit access or ask a committer to add your extension for you.  —Emufarmers(T 20:56, 16 June 2009 (UTC)

Thumbnail generation
Works great, but I had to edit the following line:

to

(removed the ) so it can generate the thumbnails properly.

Here is my ffmpeg -version:

FFmpeg version SVN-r19689-snapshot, Copyright (c) 2000-2009 Fabrice Bellard, et al.  configuration: libavutil    50. 3. 0 / 50. 3. 0  libavcodec    52.32. 0 / 52.32. 0  libavformat   52.38. 0 / 52.38. 0  libavdevice   52. 2. 0 / 52. 2. 0  libswscale     0. 7. 1 / 0. 7. 1   built on Aug 24 2009 09:46:57, gcc: 4.2.1 (SUSE Linux) FFmpeg SVN-r19689-snapshot libavutil    50. 3. 0 / 50. 3. 0 libavcodec   52.32. 0 / 52.32. 0 libavformat  52.38. 0 / 52.38. 0 libavdevice  52. 2. 0 / 52. 2. 0 libswscale    0. 7. 1 / 0. 7. 1

Great extension, btw! Rafael Vargas 14:30, 24 August 2009 (UTC)


 * Ah ok, thanks for that. Looks like my web host (where the original ffmpeg string works) is using a really old version of ffmpeg:

 FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al. configuration: --prefix=/usr --libdir=${prefix}/lib --shlibdir=${prefix}/lib --incdir=${prefix}/include/ffmpeg ... libavutil version: 49.4.0 libavcodec version: 51.40.2 libavformat version: 51.11.0 built on Feb 4 2008 14:49:27, gcc: 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) ffmpeg     SVN-rUNKNOWN libavutil  3212288 libavcodec 3352578 libavformat 3345152 
 * I'll add your string to the main page. -- Malvineous 21:57, 24 August 2009 (UTC)
 * Hmm, just thinking - if you remove this parameter how does FFmpeg know to generate a .png file, as opposed to say a .jpg? Is there some other option that should be used instead? -- Malvineous 22:03, 24 August 2009 (UTC)

Thumbnail generation not even trying to generate?
Hi Malvineous, I am trying to get thumbnails work but even after hours no success. It seems that there is not even a try to generate a thumbnail (the player works fine). In FlvHandler.php $strThumbURL=$thumb->getURL; always returns fileicon.png.

I added a die("HERE"); in FlvImageHandler.php at the beginning of function dotransform to see if I ever get there but this is never being executed. In the page source I added the video with basic without any further parameters.

Can you give a clue where to look for the problem? --Mathias, 8. September 2009
 * What version of MediaWiki are you using? It's possible that if it's too old it's not calling the necessary functions.  Also I assume that's a typo in your example (a comma "," instead of a dot "." in "Test,flv").  Do other thumbnails work if you upload a large image? -- Malvineous 11:35, 10 September 2009 (UTC)

Small Hack to show videplayer in article page
Hi!

In your TODO there is to read: Preview on the .flv's article page, so you can watch the video from there (currently you have to embed it in a page before you can watch it.)

Also i've missed that feature.

Add the following code in file extensions/FlvHandler/FlvHandler.php before the last line ("?>"): $wgHooks['ImageOpenShowImageInlineBefore'][] = 'efFlvHandlerShowImage';

function efFlvHandlerShowImage($imagepage, $out) {   $skin=""; $fp=array; $hp=array; $time=false; $res=""; efFlvHandlerRender($skin, $imagepage->img->title->mDbkeyform, $imagepage->img, $fp, $hp, $time, $res); $out->addHTML($res); return true; }

If you call the article page (file page) then before the preview-image of the video you will see the videoplayer ! --Folke 11:21, 10 September 2009 (UTC)
 * Hey that's great, thanks for letting me know! I'll add it in this weekend and upload a new version.  -- Malvineous 11:35, 10 September 2009 (UTC)

Modified/improved version
Hi!

I've modified FlvHandler slightly, so it now has the following features:


 * Video player code is embedded anywhere (including Image Page) except Image Galleries and when size is set less than $wgMinFLVSize[] = array(180,180) by default. In Image Galleries, a "filmstrip" icon is also shown below each video to distinguish between videos and images.
 * Some error message formatting.
 * English+Russian i18n.
 * Removed commented out legacy-code (no hooks at all!).
 * Ability to set  and   before the inclusion of FlvHandler.php.
 * Automatic prepending of  with MediaWiki script path.
 * Support for any Unicode video file names (r3 can not download files with non-latin1 filenames).
 * Collages of 4 frames as previews when size is more than.
 * Modified FlvHandler is free of errors "frame size must be a multiple of 2" generated by ffmpeg, because the frame is extracted, and THEN resized using ImageMagick.
 * Flow player 3.1.3 bundled.

Important note: to disable embedding of video player code on image galleries, you need to apply 1-string patch to ImageGallery.php.

See http://svn.yourcmc.ru/viewvc.py/vitalif/trunk/MediaWiki-FlvHandler and http://yourcmc.ru/wiki/index.php/FlvHandler_(MediaWiki) as an extension page in my wiki.

http://yourcmc.ru/wiki/index.php/Категория:Видео is an example.

I wish these to be accepted into the trunk. Is it possible?

VitaliyFilippov 12:09, 14 September 2009 (UTC)