Mplayer module - Hacking ffmpeg module to use mplayer for thumb creation

josini

Joined: 2005-12-07
Posts: 14
Posted: Wed, 2005-12-07 07:45

I'm trying to work this out but fail to understand completely. I have tried replacing FfmpegToolkit.class (in ../modules/ffmpeg/classes) with both MplayerToolkit.class and I get no errors when adding my album but no video-thumbnails. I have files in several formats in my test-album - ie. vmw, avi, divx, xvid and none gives a thumbnail!

I'm pretty sure it's because have not installed it correctly and could use a bit of help...

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Wed, 2005-12-07 08:06

that file was for when we were developing the module and I used it for testing. If you look towards the end of the first page you will see a file called mplayer.zip. This is the complete module. You need to download the zip. Unpack it. Place the entire mplayer folder that you will get when you unzip it into the modules directory on your server. Then when you go to site admin of gallery and then to modules you will now see the mplayer module. Click on the link to install it and then on the link to activate it. Your all done.

edited) Here is a copy of the link to the file and I went thru the post and deleted the development files as to avoid confusion.

http://gallery.menalto.com/files/mplayer.zip

 
josini

Joined: 2005-12-07
Posts: 14
Posted: Wed, 2005-12-07 08:22

Thx - but the mplayer.zip file seems corrupt!

[edit] Tried another extractor with success...

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Wed, 2005-12-07 18:08

did you get it to work?

 
josini

Joined: 2005-12-07
Posts: 14
Posted: Wed, 2005-12-07 18:58

Well... I figured out why I coundn't get it to work! It seems that Mplayer does not accept absolute foldernames in windows-style (ie. C:\WINDOWS\TMP) but it can use relative names (ie TMP). Therefore I have had to modify MplayerToolkit.class:performOperation. I have set $tmpDir="tmp" just before the initial setting of $jpegOutDir:

Quote:
case 'convert-to-image/jpeg':
$tmpDir="tmp";
$jpegOutDir = "jpeg:outdir=";
$jpegOutDir .= $tmpDir;

This is the quick-and-dirty way to solve it! Maybe you can find an other solution?

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Thu, 2005-12-08 01:21

That is very strange. This code directly above where you are talking about sets up the output directory.

global $gallery;
	$platform = $gallery->getPlatform();
	$tmpDir = $platform->tempnam($gallery->getConfig('data.gallery.tmp'), 'mpl_');
	$platform->unlink($tmpDir);
	list ($success) = GalleryUtilities::guaranteeDirExists($tmpDir);
	if (!$success) {
	    return array(GalleryStatus::error(ERROR_PLATFORM_FAILURE, __FILE__, __LINE__), null, null);
	}
	$tmpFilename = $platform->tempnam($tmpDir, 'mplr_');

it creates a unique file name. Then it deletes the file. It then creates a directory using the name of the unique file as the name of the directory. This is used so in case you have multiple users creating thumbs at the same time you dont accidentally take their thunmbs for your video. It then uses this directory inside your temp directory to do what it has to do. It then creates the file that we will use as the output of the actual thumb creating operation. by adding the code
$tmpDir="tmp";
to this you essentially change where the temp jpegs will be created. Since we send $tmpDir to the function _mplayer You luck out in the fact that the function then looks for the temp jpsegs in the right spot. This fix will work as long as you dont have multiple users creating thumbs for video files at the same time. If you do you will run into problems. Also I do not see why your having troubles as the commands used should be platform independant. It is the whole reason for using the $platform->tempnam command. The $platform is what does it. Are you sure that your temp directory is set up properly for Gallery. Also if the module doesnt work properly for you then you might want to check the zipcart module as well as it uses the same command. This is where the creation of the unique temporary folders command was borrowed from.

Also Valiant is a far superior coder than myself he might have an opinion as to why you are having the trouble you are having. Thanks for giving me a heads up on this. Is anyone else using this module on a windows server. are you having the same problem?

Mattyb

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Thu, 2005-12-08 02:42

It may be because you already have TMP or TEMP or both already defined in your environment variables pointing to a different path.
Right click on My Computer | Advanced tab, click the Environment Variables button.

 
josini

Joined: 2005-12-07
Posts: 14
Posted: Thu, 2005-12-08 08:33

Sorry guys - this is not a problem caused by the Mplayer-module - it is the Mplayer itself! I found the solution by running Mplayer standalone giving the same parameters as MplayerToolkit sets up. And as soon as I changed from

Quote:
jpeg:outdir="<mydrive>:\mygallery\tmp"

to

Quote:
jpeg:outdir="tmp"

it worked and the thubmnails are created. Mplayer even gives an error-message indicating some problem with the filename in jpeg:outdir.

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Thu, 2005-12-08 08:44

If you are typing that command to mplayer with the quotes, try it without the quotes, as they are not supposed to be there. Let us know. it should look like
jpeg:outdir=<mydrive>:\mygallery\tmp

Mattyb

 
josini

Joined: 2005-12-07
Posts: 14
Posted: Thu, 2005-12-08 09:20

Here is the command I send (I have substituted the real-drives and folders with dummies):

Quote:
Q:\mplayer\mplayer.exe Q:\www\gallery\gallery2-files\albums\abc.avi -nosound -vo jpeg:outdir=Q:\www\gallery\gallery2-files\tmp\mpl8537.tmp -frames 2 Q:\www\gallery\gallery2-files\tmp\g2d8539.tmp

And with above I get the following in file Q:\www\gallery\gallery2-files\tmp\g2d8539.tmp:

Quote:
Could not parse arguments at the position indicated below:
outdir=Q:\www\gallery\gallery2-files\tmp\mpl8537.tmp
^
Error opening/initializing the selected video_out (-vo) device.

The ^ is placed directly under the first backslash.

When I change the command to:

Quote:
Q:\mplayer\mplayer.exe Q:\www\gallery\gallery2-files\albums\abc.avi -nosound -vo jpeg:outdir=gallery2-files\tmp\mpl8537.tmp -frames 2 Q:\www\gallery\gallery2-files\tmp\g2d8539.tmp

AND makes sure to run it from Q:\www\gallery the thumbnails are created perfect in Q:\www\gallery\gallery2-files\tmp\mpl8537.tmp\

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Fri, 2005-12-09 02:36

well im no expert with either windows server or mplayer but it looks like the command you are sending to mplayer is wrong in 2 spots. One the outdir needs to be a directory not a file and two you are adding the name of the file at the end of the command again. Does this work?

Q:\mplayer\mplayer.exe Q:\www\gallery\gallery2-files\albums\abc.avi -nosound -vo jpeg:outdir=gallery2-files\tmp\ -frames 2

Mattyb

 
josini

Joined: 2005-12-07
Posts: 14
Posted: Fri, 2005-12-09 22:36

Mattyb> It makes no difference that the folder is named mpl8537.tmp - this is allowed on windows. Besides the command I referred to was actually built by MplayerToolkit.

I have now isolated the problem to the driveletter. If I strip off Q: it works - but only if run while located on Q-drive.

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Sat, 2005-12-10 01:14

hmm. I wonder is anyone else using windows and do they have this problem as well? Anybody? I would think that if this is a windows only problem then we could check to see if it is windows and if so strip off the first 2 letters of the variable for the tempfolder. If anyone else is using windows could you please let me know whether you are having the same problem as josini. Thanks for the help.

josini
we'll see if we can get this figured out.

Mattyb

 
zylantha

Joined: 2003-08-20
Posts: 7
Posted: Wed, 2005-12-21 13:56

I may be missing something, but after installing this module Gallery still won't create thumbnails for my MP4 movies. mplayer is happy to play them, but Gallery just says that no graphics toolkits are installed that support the files.

I have tried hacking some code very quickly do recreate the same references to "mp4" extensions as there is in the module for "wmv" but maybe I'm barking up the wrong tree ... any chance of somebody who knows the code doing this mod (or confirming whether the problem really is that I'm suffering from lack of sleep?)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-12-21 14:50

maybe you need to add mp4 to an existing video mimetype in site admin -> mimetype manager (of course you need to install and active the mime module first and the mimetype you choose must be registered to be handled by the mplayer module (which is not editable).

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Thu, 2005-12-22 05:43

zylantha
Currently the mplayer module is hardcoded fo the mime types it registers. It will remain this way until Valiant or someone else has the time to rewrite the mime type handling. I have added mp4 to the handled mime types and the needed replacment file is attached. What you will need to do is go to mime types in the site admin and add a mime type. In the first field you will type the following: video/mp4 . In the next field you will type in this mp4 . Then you will need to overwrite the following file with the one provided here. It will need to be renamed to get rid of the .txt to MplayerToolkitHelper.class . It should be something like /modules/mplayer/classes/MplayerToolkitHelper.class . Then you will need to go to modules in the site admin and deactivate the mplayer module and reactivate it. This should allow mp4 to be decoded by mplayer to create thumbnails.

P.S. The playing of videos on you website does not use mplayer. mplayer is only used to create the thumbs. The playing of the videos is done by whatever video player you have installed on the browsing machine designated to handle that mime type.

Hope this helps and let me know the results.

Mattyb

 
zylantha

Joined: 2003-08-20
Posts: 7
Posted: Sat, 2005-12-24 03:23

Thanks Mattyb

Followed your instructions to make the changes, but still no luck ... observations:

1. Files previously uploaded (before adding the mime type to gallery admin) lose their extension and are recorded as "filename_mp4" instead of "filename.mp4". Re-creating the thumbnails does nothing and gallery still calls them "unknown".

2. Re-uploading the files (after adding the mime type to gallery admin) I now get the proper file extension recorded, but it seems to still have problems creating any thumbnails, I just get a broken thumbnail image displayed, which when you click on the thumbnail it still says "download unknown".

Any ideas? Would you like me to send you an MP4 to test?

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Sat, 2005-12-24 04:02

sure that would be fine. I dont know if I will have a chance in the next couple of days but I will try my hardest to get it working for you. I havent checked but it also may be a limitation of mplayer. I dont think it is but I will hopefully be able to give you an answer shortly. just send the file to me via PM.

Mattyb

just seen that you have already sent me the link. Ill get to it as soon as I can.

 
druven

Joined: 2005-12-25
Posts: 3
Posted: Mon, 2005-12-26 12:06

I'm using

mplayer $inputFilename -ss $timeOffsetInSeconds -nosound -vo jpeg:outdir=$outDir -frames 1

in order to create a thumbnail.

The problem is that there is no accordance between the timing of the frame I get to the argument I've used in the call ($timeOffsetInSeconds).

For example, for a movie which his length is 44 seconds, I get the last frame when I set $timeOffsetInSeconds to 30.
For a movie which his length is 4:22, I get the last frame when I set $timeOffsetInSeconds to 2:30.

Both ffmpeg and mplayer (using mplayer -identify $inputFileName -nosound -vc dummy -vo null
) returns the correct length of the movie.

How can I solve the problem, or know the range I can set in $timeOffsetInSeconds so the command will not fail?
Help will be truely appreciated.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-12-26 16:28

please ask your questions in only a single forum thread.

 
hardtoneselector

Joined: 2005-03-08
Posts: 46
Posted: Mon, 2005-12-26 16:33

Hi,

I just trying to get mplayer mod to run,... it seems to work and seems to do what it should,... so far so nice but, when I try to add any item with activated mplayer mod I get following error:

Error (ERROR_BAD_PATH)
in modules/core/classes/GalleryDataItem.class at line 129 (GalleryUnknownItem::error)
in modules/core/classes/GalleryUnknownItem.class at line 77 (GalleryUnknownItem::create)
in modules/core/classes/helpers/GalleryItemHelper_medium.class at line 203 (GalleryUnknownItem::create)
in modules/core/classes/GalleryCoreApi.class at line 1499 (ItemAddFromBrowser::addItemToAlbum)
in modules/core/ItemAddFromBrowser.inc at line 89 (ItemAddFromBrowser::addItemToAlbum)
in modules/core/ItemAdd.inc at line 94 (ItemAddFromBrowser::handleRequest)
in main.php at line 174 (ItemAddController::handleRequest)
in main.php at line 87
in modules/core/classes/GalleryEmbed.class at line 153
in /www/htdocs/..../modules/pnGallery2/pnuser.php at line 46 (GalleryEmbed::handleRequest)
in /www/htdocs/..../includes/pnMod.php at line 731
in /www/htdocs/..../index.php at line 102
System Information
Gallery version 2.0.2
PHP version 5.0.5 apache2handler
Webserver Apache/2.0.55
Database mysql 4.1.14-Max-log
Toolkits ImageMagick, NetPBM, Gd
Operating system Linux dd11024 2.4.21-273-athlon #1 Mon Jan 17 13:03:46 UTC 2005 i686
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)

Since I use the unfinished postnuke integration it might be caused their, can somebody can give me a hint? Would be neak having mplayer working ffmpeg not supported by the host,...

greetings
bernie

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-12-26 18:46

since you're using pn/g2, i suggest you first try g2 standalone with the mplayer module before you try it with pn.

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Wed, 2005-12-28 03:05

zylantha
I did the changes to my install of gallery as I described to you. My thumbnails are created correctly. I did notice however that it does say unknown in the download link as well as in the drop down menu of the video. This isnt a function of the mplayer module but rather how files are determined to be movies within the gallery core. Either you or I need to start a new thread to ask how to change the gallery core to add a mime type and have it play inline as well as have gallery realize that it is a movie. I found some references within gallery code and attempted change but I think that because you cant deactivate gallery core and then reactivate gallery core the new factory registrations that need to be done arent. Maybe some one can tell me where in the mysql the tables are located that determine wether a mime type is set as a movie i/we can change them manually. I did some searching on these forums but all of the topics seemed to refer to an outdated galeery api. As far as why your thumbs arent created I would suggest that maybe your version of mplayer doesnt support mp4. You might try and update to the newest version, or also you might not have the proper codecs installed on your server. If you have shell access you can try the command manually to see if you can create a thumb that way. If you need help with the mplayer arguments I might be able to help. Let me know

Mattyb

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Wed, 2005-12-28 03:11

druven
Sorry but I dont have the foggiest idea why you would be having problems. the command you are using to find the length of the movie is the exact command the module uses. I did notice that on my instal the time of the video is not reported correctly. Mplayer always seems to make the time be a little longer than the actual time. If I set an offset that is longer than the actaul time of the movie I get the last frame but as soon as my offset goes below the actual time of the movie I get the thumb for the time that I have set. Maybe you could upgrade your version of mplayer to the newest, but other than that I am sorry to say that I cant help.

Mattyb

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Wed, 2005-12-28 03:18

hardtoneselector
So if you had an item already in the gallery it rebuilds thumbs correctly but if you try to add an item you get the error message. Is this correct? I would suggest that you have a problem with pn. Does the ffmpeg module present the same errors? They both have essentially the same commands one just uses ffmpeg and mine uses mplayer. I know that this module will work in an embedded gallery as mine is in mambo but I dont know about pn. If you cant get it to work in pn, and if pn is the problem, and it is that important to you, i.e. your main purpose of the site is gallery, then I would suggest that you move to a different cms with better support for gallery.

 
hardtoneselector

Joined: 2005-03-08
Posts: 46
Posted: Thu, 2005-12-29 05:37

@valiant: you are so right, I should try it standalone too, before asking!

Same same!!! It's the same Installation just accessed directly, this is working because I did not set embedded to true. I recive the following errors:

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in .../modules/pnGallery2/gallery2/modules/mplayer/classes/MplayerToolkit.class on line 209

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in .../modules/pnGallery2/gallery2/modules/mplayer/classes/MplayerToolkit.class on line 209

Warning: Invalid argument supplied for foreach() in .../modules/pnGallery2/gallery2/modules/core/classes/GalleryPlatform/UnixPlatform.class on line 56

Error
An error has occurred.

Back to the Gallery

Error Detail -
Error (ERROR_BAD_PATH)
in modules/core/classes/GalleryDataItem.class at line 129 (GalleryUnknownItem::error)
in modules/core/classes/GalleryUnknownItem.class at line 77 (GalleryUnknownItem::create)
in modules/core/classes/helpers/GalleryItemHelper_medium.class at line 203 (GalleryUnknownItem::create)
in modules/core/classes/GalleryCoreApi.class at line 1499 (ItemAddFromBrowser::addItemToAlbum)
in modules/core/ItemAddFromBrowser.inc at line 89 (ItemAddFromBrowser::addItemToAlbum)
in modules/core/ItemAdd.inc at line 94 (ItemAddFromBrowser::handleRequest)
in main.php at line 174 (ItemAddController::handleRequest)
in main.php at line 87
in main.php at line 80
System Information
Gallery version 2.0.2
PHP version 5.0.5 apache2handler
Webserver Apache/2.0.55
Database mysql 4.1.14-Max-log
Toolkits ImageMagick, NetPBM, Gd
Operating system Linux dd11024 2.4.21-273-athlon #1 Mon Jan 17 13:03:46 UTC 2005 i686
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)

@mattyb: You are right this is what happens! And of course I try using mplayer because ffmpeg is not working, my Provider will not compile it or me.
And silly me I asked for PN without trying it standalone,... but standalone is the same,...
gallery is just a part not the purpose, and I do know Postnuke and not Mambo or other CMS. And since I have a bunch of other functions in the page I will hear the same when it comes to integrate some other function in Mambo,... ;)

 
swiftman

Joined: 2005-06-24
Posts: 10
Posted: Fri, 2005-12-30 18:03
hardtoneselector wrote:

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in .../modules/pnGallery2/gallery2/modules/mplayer/classes/MplayerToolkit.class on line 209

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in .../modules/pnGallery2/gallery2/modules/mplayer/classes/MplayerToolkit.class on line 209

Warning: Invalid argument supplied for foreach() in .../modules/pnGallery2/gallery2/modules/core/classes/GalleryPlatform/UnixPlatform.class on line 56

I had this same issue. I am using php 5.1 however but, I think my solution should work for you as well.

What I did was type cast the variables being passed to array_merge. For some reason the newer versions of php dont handle non array variables. In order to fix this all you must do is add the array cast in front of argument 1 and 2 like so...

Quote:
$platform->exec(array(array_merge((array)$mplayerPath, (array)$sourceFilename, $args)));

Thanks for the Mplayer Module! It works great! For some reason ffmpeg wasnt working with videos from my digital camera but, now with mplayer its no problem! :)

 
hardtoneselector

Joined: 2005-03-08
Posts: 46
Posted: Sun, 2006-01-01 22:59

@swiftman: I got rid of the wanrings now with changig line 209 to your suggetion! Thanks!
But still I got this Errors:

Quote:
Error (ERROR_BAD_PATH)
in modules/core/classes/GalleryDataItem.class at line 129 (GalleryUnknownItem::error)
in modules/core/classes/GalleryUnknownItem.class at line 77 (GalleryUnknownItem::create)
in modules/core/classes/helpers/GalleryItemHelper_medium.class at line 203 (GalleryUnknownItem::create)
in modules/core/classes/GalleryCoreApi.class at line 1499 (ItemAddFromBrowser::addItemToAlbum)
in modules/core/ItemAddFromBrowser.inc at line 89 (ItemAddFromBrowser::addItemToAlbum)
in modules/core/ItemAdd.inc at line 94 (ItemAddFromBrowser::handleRequest)
in main.php at line 174 (ItemAddController::handleRequest)
in main.php at line 87
in main.php at line 80
System Information
Gallery version 2.0.2
PHP version 5.0.5 apache2handler
Webserver Apache/2.0.55
Database mysql 4.1.14-Max-log
Toolkits ImageMagick, NetPBM, Gd
Operating system Linux dd11024 2.4.21-273-athlon #1 Mon Jan 17 13:03:46 UTC 2005 i686
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)

Some other hint?

thanks

 
geezidunno

Joined: 2006-01-09
Posts: 1
Posted: Mon, 2006-01-09 19:30
valiant wrote:
we can get a list of supported filetypes with:
mplayer -demuxer help

That doesn't work for me...

[localhost:]$ mplayer -demuxer help
MPlayer 1.0pre7-3.3 (C) 2000-2005 MPlayer Team
AltiVec found
CPU: PowerPC

The demuxer option must be an integer: help

Installed via darwinports which lists it as MPlayer 1.0pre7_0 (active)
Mac OS X 10.3.9

 
SuicideDog

Joined: 2006-01-10
Posts: 35
Posted: Tue, 2006-01-10 04:16

I had my brother do the following on his debian box to get mplayer installed : http://www.princessleia.com/MPlayer.php

He did everything the faq instructions install but didn't do the Live.com Codecs

He got the following options and tried both XV and x11.

┌────┤ MPlayer Configuration ├─────┐
│ MPlayer Video Output │
│ │
│ xv │
│ xmga │
│ mga │
│ x11 │
│ gl │
│ sdl │
│ xvidix │

I have the ffmepg module disabled. The mplayer module is install and activated. When I test the mplayer toolkit is say it passes. The mime/types are set to display for wmv and avi but they won't generate a thumbnail for me. I just get a broken thumb. I get no errors and I have tried to rebuild the thumbs from both the album and the movie itself. It doesn't make a difference if it was already on the site or if I upload a new movie. I'm stumped! It seems like it is working because I don't get any errors but all I see is broken thumbs. ARGH!! Please help! Thanks in advance.

System info
Gallery version = 2.0.2 core 1.0.0.2
PHP version = 4.3.10-16 apache2handler
Webserver = Apache/2.0.54 (Debian GNU/Linux) PHP/4.3.10-16 mod_ssl/2.0.54 OpenSSL/0.9.7e
Database = mysql 4.0.24_Debian-10sarge1-log
Toolkits = ArchiveUpload, Dcraw, Exif, ImageMagick, NetPBM, SquareThumb, Thumbnail, mplayer, Gd
Operating system = Linux web1 2.6.8-022stab045.1-smp #1 SMP Fri Oct 28 16:44:24 MSD 2005 i686
Browser = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)

 
moridin1138

Joined: 2006-01-29
Posts: 1
Posted: Sun, 2006-01-29 18:16

Hello, I am getting this error when attempting to install the plugin. I searched this topic and others for answers, but have yet to find anything. It seems that even though I get this error, it installs the module because its there when I navigate back to the page. However I get the same error when I go to configure the module.

Warning: requireonce(/usr/share/gallery2/modules/core/classes/../../../modules/mplayer/classes/MplayerToolkitHelper.class): failed to open stream: Permission denied in /usr/share/gallery2/modules/core/classes/GalleryCoreApi.class on line 2505

Fatal error: requireonce(): Failed opening required '/usr/share/gallery2/modules/core/classes/../../../modules/mplayer/classes/MplayerToolkitHelper.class' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/gallery2/modules/core/classes/GalleryCoreApi.class on line 2505

Any help is appreciated. :)

Info:
PHP Version => 4.4.2-1
System => Linux debian 2.4.27-2
Gallery 2.0.2
MPlayer 1.0pre7-3.3.5

 
rgoodwin

Joined: 2006-02-14
Posts: 1
Posted: Tue, 2006-02-14 21:14

Any chance this will work on v2.1 any time soon? I hacked the core api requirements in the .inc but nogo :)

Damn me for having to use WMV video :) If only we had a free way to do Flash like YouTube or something that would be so much easier!

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2006-02-14 23:32

I updated the mplayer.zip file from above for Gallery 2.1.

Edit 8-Apr-2006 -- new version attached that fixes a couple bugs
Edit 13-Apr-2006 -- new version, one more bugfix

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Tue, 2006-02-14 23:42

thanks mindless
I was just looking at that and I had no idea when I was gonna have the time to sit down and start figuring it out. You have saved me the trouble. Thanks again.

Mattyb

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Wed, 2006-03-01 05:01

Upgraded G2 to latest 2.1 and updated to latest mplayer module.
When attempting to activate I get the following error:

Fatal error: Call to undefined function: relativerequireonce() in /var/www/localhost/htdocs/gallery2/modules/mplayer/module.inc on line 211

My server:
Gallery version = 2.1-rc-1b core 1.0.30
PHP version = 4.4.0-pl1-gentoo apache
Webserver = Apache 1.3.34
Database = mysql 4.0.25
Toolkits = Exif, Ffmpeg, NetPBM, ArchiveUpload, Thumbnail, Gd, Dcraw, ImageMagick
Operating system = Linux digi-archive 2.6.15-gentoo-r1 #1 SMP Sun Feb 5 12:13:48 PST 2006 i686
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2006-03-01 05:15

make sure you got the right zip file and extracted it in the right place.. that line in the zip above has requireOnce, not relativeRequireOnce.

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Wed, 2006-03-01 05:39
mindless wrote:
make sure you got the right zip file and extracted it in the right place.. that line in the zip above has requireOnce, not relativeRequireOnce.

Heh, right you are. Had an older version. Re-downloaded, extract, and all fixed now.
Thanks!

 
Otacon

Joined: 2005-12-07
Posts: 10
Posted: Mon, 2006-03-13 22:36

Great module guys, currently using it on my gallery 2.1 setup :)

I was just wondering when you had plans to add watermarking support into the module, as that's about the only thing I'm missing now.

Keep up the good work.

Otacon

 
fondue

Joined: 2006-03-16
Posts: 1
Posted: Thu, 2006-03-16 01:12

Hey guys,

I'm brand new to Gallery, there's so much to do with it. I stumbled across this module but seem to be having an issue activating it. I don't get an error but it is asking me to input the path to mplayer. Basically, I just want to knowwhat I should be putting in here?? I have read through this board and it seems all I should have to do is install it and activate it. However, once i've installed it the only option I get then is to Configure it, that when I get this request for the path.

Any help would be great!
Thanks

 
swordfish
swordfish's picture

Joined: 2004-10-01
Posts: 388
Posted: Thu, 2006-03-16 02:59
fondue wrote:
Hey guys,

I'm brand new to Gallery, there's so much to do with it. I stumbled across this module but seem to be having an issue activating it. I don't get an error but it is asking me to input the path to mplayer. Basically, I just want to knowwhat I should be putting in here?? I have read through this board and it seems all I should have to do is install it and activate it. However, once i've installed it the only option I get then is to Configure it, that when I get this request for the path.

Any help would be great!
Thanks

As the text says on the Mplayer settings, "You must install the MPlayer binary on your server, then enter the path to the binary in the text box below." Just like the other tools - Dcraw, Ffmpeg, ImageMagick, NetPBM. Typically, on linux the mplayer path would be /usr/bin/mplayer
Mplayer site: www.mplayerhq.hu

 
galleryuser65

Joined: 2006-03-23
Posts: 3
Posted: Thu, 2006-03-23 18:03

I was having the same problem as fondue but finally got mplayer activated. My issue now is that I can not upload video files. Is the process different for video than for images? Thanks mattyb for this module! It makes Gallery much more useful. Here is the error log:
Error (ERROR_BAD_PATH)
in modules/core/classes/GalleryDataItem.class at line 129 (gallerystatus::error)
in modules/core/classes/GalleryUnknownItem.class at line 77 (gallerydataitem::create)
in modules/core/classes/helpers/GalleryItemHelper_medium.class at line 203 (galleryunknownitem::create)
in modules/core/classes/GalleryCoreApi.class at line 1499 (galleryitemhelper_medium::additemtoalbum)
in modules/core/ItemAddFromBrowser.inc at line 89 (gallerycoreapi::additemtoalbum)
in modules/core/ItemAdd.inc at line 94 (itemaddfrombrowser::handlerequest)
in main.php at line 174 (itemaddcontroller::handlerequest)
in main.php at line 87
in main.php at line 80

System Information
Gallery version 2.0.2
PHP version 4.4.1 apache
Webserver Apache/1.3.34 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.1 FrontPage/5.0.2.2635 mod_ssl/2.8.25 OpenSSL/0.9.7a
Database mysql 4.1.14-standard
Toolkits SquareThumb, Gd
Operating system Linux truly.servingyourhostingneeds.com 2.6.9-22.ELsmp #1 SMP Sat Oct 8 19:11:43 CDT 2005 i686
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.52

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Thu, 2006-03-23 19:12

galleryuser65 are you sure that you have mplayer installed? Are you using the correct version of mplayer. There are 2 versions within in this post. The latest one that is out is for 2.1. It is attatched to mindless' post. The older version is attached to my post and is for pre 2.1.

My bet is that you have the wrong version installed.

Otacon

I really hadnt had any plans to do watermarking support although I know that valiant had wanted to incorporate that into the final version of this module. Currently this version of mplayer doesnt really check to see what mime types it supports, it is hardcoded to just think it supports them all whether or not it really does. When valiant had time he was gonna fix that as well as probably try and get watermarking put in. I cant promise anything as I am very busy but in the next few weeks if I get a chance I might give it a try. May I suggest that you give it a try as well. I was able to make this module and I have realatively no programming knowledge. I learned as I did it.

Mattyb

 
galleryuser65

Joined: 2006-03-23
Posts: 3
Posted: Fri, 2006-03-24 10:56

mattyb, You are correct sir :) I had the wrong version of mplayer as well as several other things that were wrong. I updated to the newest mplayer linked in the thread as well as the latest version of Gallery. I can upload videos now but clicking on the folder they are in shows nothing. No thumbnail is diplayed or anything to indicate there are videos in the album. I verified through ftp that the files are in the album. I uploaded the latest i686 compiled version of mplayer. The compiled folder resides outside the mplayer module folder. What am I overlooking? Will keep going and see if I can figure it out on my own in the mean time.

 
azn_oohwee

Joined: 2006-03-06
Posts: 24
Posted: Fri, 2006-03-24 17:16

If you have ssh access to your server you should be able to build a copy of mplayer and use it.

 
transmorphic

Joined: 2006-03-14
Posts: 3
Posted: Tue, 2006-03-28 20:46

Hi. I've just installed this module for the first time.
I was getting type mismatch errors after a video upload, though I managed to correct that.
Now the uploads complete without error, but thumbnails are not generated, and the following error message is displayed when accessing the thumbnail tab on video items. Please assist. Thanks in advance.

Error (ERROR_TOOLKIT_FAILURE)

* in modules/ffmpeg/classes/FfmpegToolkit.class at line 181 (FfmpegToolkit::error)
* in modules/ffmpeg/classes/FfmpegToolkit.class at line 65 (FfmpegToolkit::_getMovieDimensions)
* in modules/thumbpage/ItemEditThumbOffset.inc at line 167 (FfmpegToolkit::getProperty)
* in modules/thumbpage/ItemEditThumbOffset.inc at line 109 (ItemEditThumbOffset::_getDuration)
* in modules/core/ItemEdit.inc at line 287 (ItemEditThumbOffset::loadTemplate)
* in modules/core/ItemAdmin.inc at line 147 (ItemEditView::loadTemplate)
* in modules/core/classes/GalleryView.class at line 317 (ItemAdminView::loadTemplate)
* in main.php at line 386 (ItemAdminView::doLoadTemplate)
* in main.php at line 87
* in main.php at line 80

System info:
Gallery version = 2.1 core 1.1.0
PHP version = 5.0.5 apache2handler
Webserver = Apache
Database = mysqlt 4.1.11-standard-log, lock.system=flock
Toolkits = ArchiveUpload, Exif, Ffmpeg, NetPBM, Thumbnail, Gd, mplayer
Acceleration = none/86400, none/86400
Operating system = Linux 2.6.9-11.EL #1 Wed Jun 8 16:59:52 CDT 2005 i686
Default theme = floatrix
Locale = en_US
Browser = Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

 
galleryuser65

Joined: 2006-03-23
Posts: 3
Posted: Tue, 2006-03-28 20:50

I compiled mplayer on the server and only have the option to download the movie but not play it. Is this module supposed to enable Gallery to play videos or is my understanding incorrect?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2006-03-28 22:22

transmorphic, please use the 3rd party plugins forum for support, thanks.
(that error is from modules/ffmpeg, not modules/mplayer ?)

galleryuser65, this module is an alternative to ffmpeg for autodetection of movie dimensions and for creating thumbnails for movie files. It does not do anything to enable embedded movie players.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2006-04-08 23:18

I attached an updated version of the module above that fixes a couple small bugs.

 
eversonl

Joined: 2006-04-13
Posts: 9
Posted: Thu, 2006-04-13 15:11

using that latest version attached to mindlesss' post I get

Quote:
Fatal error: Call to a member function on a non-object in /home/[edited]/public_html/avonindoor/gallery2/modules/mplayer/classes/MplayerToolkit.class on line 152

any ideas? seems to be referencing a temp directory that doesn't exist

Quote:
if ($ret) {
$platform->recursiveRmdir($tmpDir);
return array($ret->wrap(__FILE__, __LINE__), null, null, null);
}

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2006-04-13 15:27

fixed, new attachment above. thanks.
(though getting an error there means something went wrong with running your mplayer binary...)