I would actually love just a simple hack of zenphoto to treat video files (extentions defined in config somewhere) as photos and then when you click on them, it just plays when in the locally defined player. I am just looking for easy way for my family/friends to see the videos I take with my camera as easily as they can see photos (with zenphoto).
@steve: Not everyone can play .mov videos, you need to have quickTime installed. ZenVideo uses a flash player to read .flv video files. Actually, almost anyone has a flash plugin for its web browser... I don't think using .mov videos is a good solution BUT it won't be difficult to make zenvideo recognize .mov file : look after the is_valid_video() in the image class. You should look in template functions too for displaying the right viewer.
@permesso: Well your request is similar as steve's one. It needs to modify some part of the code... but the easiest way is still to convert your video in FLV files i suppose. On windows you can use http://www.rivavx.com products, on linux or mac os x, you can use directly ffmpeg to convert your videos.
Cheers for taking the time to reply, its appreciated.
I have a specific setup that requires the display of .mov files, the audience viewing the site will be aware of that and either have the required Quicktime player installed or be prepared to install it. It would be really beneficial to be able to do this from within Zenphoto as my existing site also runs on that, and it would save massive amounts of work to start all over again with a different gallery application.
I will download your Zenphoto files and look in the code for the changes required but I think it will be a little to advanced for my level of experience. If you have the time, any extra details or pointers that you feel like giving for further assistance would be great.
Just an update on this. I now have it running and playing QT movie files with no issues (thanks for the pointers and great code base to work from).
Is it possible to show a different thumbnail for each video as I will be displaying more than one video in each gallery? I am happy to create .jpg of each and name them independently (or the same as the .mov file) but are unsure how to get them to display correctly.
Again many thanks for writing this addition and your previous help :-)
If you want to run it as designed with no alterations, then it is simply a case of downloading the files and overwriting the originals.(just the changed files will do if you are already running an instance of Zenphoto or download and install the full package if not). The full package comes with all the changes already coded in to the download so there are no edits needed.
The installation process for the full package is the same as doing a full installation of Zenphoto.
Forget my question above, I was being dumb. I made a typo error in the file name for the thumb and was looking elsewhere for the issue thinking it may have had something to do with my edits to the files. Sometimes the solutions are closer to home ;-)
Everything is working great now, I just need to alter the CSS to get things to fit as I want.
@steve, you mentioned some pointers on modifying it for another extension - can you share those? I tweaked it to do mpeg, but would like to see if I went about it the right way, or if I missed something. Thanks!
would you mind copying and pasting in the modifications you made to functions.php and template-functions.php? i gave it a shot myself and realized i hadn't a clue what i was doing. :S
hi, I run a few websites using zenphoto and just recently tried this hack on one of them. I wanted to see if the bugs I found were particular to me or more universal.
Videos have to be uploaded via ftp, the admin web interface does not allow uploading of videos.
After uploading a video via ftp you need to visit the admin edit page and click save, otherwise you get an error on the gallery page.
Is everyone doing it this way?
A couple of the websites I run have several non-computer savvy people uploading, so ftp isn't an option. It would be great if the admin upload could be fixed.
On another note, how are people creating the flv files? I found a few different shareware apps but they all suck. I'd love to hear recommendations (Mac user).
Hey guys, Sorry to bump this old post. I have a problem where, some files that I upload are different resolution, such as HD. Now there is no toolbar or anything. How should I go about changing the frame dynamically to fit the higher resed images?
Also on a side note, is there any way to pull the files size(like in kb or mb?) or date uploaded for a file?
Has there been any progress with getting this to work with the latest SVN? The only reason I ask is because the SVN allows for subalbums and exif information.
No I do not. I was actually astonished I got your code to work. I have wanted this for a long time but I use subalbums! Thanks again for making this La0c00n.
This is great! One thing really bothers me though.
The way the player works by default, it has a control bar that covers part of the video. At 320x240 it's a very non-trivial part. If I move the mouse away, after a few seconds the bar goes away too. But that isn't entirely intuitive and I only noticed by accident. Besides, I'd like to leave it visible to give an indication of how much time remains.
I've been looking at the documentation from the apparent original producer of the FLV player (the SWF file). It's possible to control the image size, player bar color, show/hide volume control, etc... But how do I move that control bar under my movie where it belongs?!? I didn't have much luck finding info about that.
Maybe resize the video area to leave enough pixels for the control bar... But then the movie centers itself vertically, leaving a black bar on the top and an obstructed area on bottom. Ugh.
One other suggestion: It would be good to overlay something on the thumbnail image to indicate that it's a movie. That way photos and videos can be mixed in the same album, and people clicking through will know which type is about to be downloaded. Good for those with slow net access.
I wouldn't call it a major problem though. It would be easy enough to separate our movies and stills into different albums with "photo" and "video" in the album names. In my case (for now anyway) they're in completely separate galleries.
I would be grateful of any help - I have installed the video theme and on first view with the default theme, all appeared to be OK - video uploaded, displayed OK with thumb and played OK when tested. However, when I went into admin>options, it threw up the following error:
Warning: Invalid argument supplied for foreach() in /home/sites/mysite/public_html/zenphoto/zen/kses.php on line 429
It is repeated about 25-30 times before then displaying the list of themes. I tried changing the theme but still get the same error repeated on every page - whatever theme is selected. However, at the end of end of the error messages, it does give me the relevant screen eventually - with the last error message showing
Warning: Cannot modify header information - headers already sent by (output started at /home/sites/mysite/public_html/zenphoto/zen/kses.php:429) in /home/sites/mysite/public_html/zenphoto/index.php on line 9
When I eventaully scroll through all this and get to the relevant links - the video file still works but how do I get rid of this problem as it makes this fantasic feature unuseable at the current time?
I have no knowlege of php so am at a bit of a loss to understand what has gone wrong...
I have downloaded and installed the zenvideo zip file from the earlier link according to the instructions.
an for the video parameters; on my own site (under contruction at http://www.bertsimons.nl/wordpress/?p=28 )I used jeroen weijerings flashplayer and added this to my customfunctions.php which is called on my image.php page by printDefaultSizedImageVideo() tu use his player which has a lot of adjustable parameters. ( use it uploading an image and a flv of the same name eg movie.jpg, movie.flv)
// Video integration jeroen weijerings flashplayer
function printDefaultSizedImageVideo($alt, $class=NULL, $id=NULL) { // [BEGIN] added by cvogt: check for non image data $file_full = $_SERVER['DOCUMENT_ROOT'].getFullImageURL(); $file_wo_ext = substr($file_full,0,strrpos($file_full,".")); if( file_exists( $file_wo_ext.".flv" )){ ?>
<p id="player" style="width:520px;height:390px;">>Get Flash to see this player. <script type="text/javascript"> var so = new SWFObject("/zenphoto/themes/izen/flvplayer/flvplayer.swf","mpl","520","390","7"); so.addParam("allowfullscreen","true"); so.addVariable("file","<? echo substr(getFullImageURL(),0,strrpos(getFullImageURL(),".")); ?>.flv"); so.addVariable("displayheight","390"); so.addVariable("autostart","true"); so.addVariable("repeat","true"); so.addVariable("overstretch","true"); so.addVariable("showicons","false"); so.write("player"); </script> <? }
and off course add <script type="text/javascript" src="<?= $_zp_themeroot ?>/flvplayer/swfobject.js"></script> in your image.php header to get it working..
Has anyone figured out how to use the watermark hack to apply a watermark only to video thumbnails? If so, can you explain how? I have the video and watermark hack applied but so far I haven't been able to figure out how to apply a watermark only to video thumbnails.
Comments
@permesso: Well your request is similar as steve's one. It needs to modify some part of the code... but the easiest way is still to convert your video in FLV files i suppose. On windows you can use http://www.rivavx.com products, on linux or mac os x, you can use directly ffmpeg to convert your videos.
I have a specific setup that requires the display of .mov files, the audience viewing the site will be aware of that and either have the required Quicktime player installed or be prepared to install it. It would be really beneficial to be able to do this from within Zenphoto as my existing site also runs on that, and it would save massive amounts of work to start all over again with a different gallery application.
I will download your Zenphoto files and look in the code for the changes required but I think it will be a little to advanced for my level of experience. If you have the time, any extra details or pointers that you feel like giving for further assistance would be great.
Is it possible to show a different thumbnail for each video as I will be displaying more than one video in each gallery? I am happy to create .jpg of each and name them independently (or the same as the .mov file) but are unsure how to get them to display correctly.
Again many thanks for writing this addition and your previous help :-)
If you want to run it as designed with no alterations, then it is simply a case of downloading the files and overwriting the originals.(just the changed files will do if you are already running an instance of Zenphoto or download and install the full package if not). The full package comes with all the changes already coded in to the download so there are no edits needed.
The installation process for the full package is the same as doing a full installation of Zenphoto.
Everything is working great now, I just need to alter the CSS to get things to fit as I want.
I edited the expected files type from .flv to .mov (in zen > functions.php)
Then changed the code that calls the flash player to call the QT movie plugin for playing .mov files. This was done in zen > template-function.php.
I also modified the default size of the player window in zen > class-image.php as all my files will be the same default size.
Those where the only three files altered and thankfully La0c00n kindly commented all the code, so finding the correct places was easy.
would you mind copying and pasting in the modifications you made to functions.php and template-functions.php? i gave it a shot myself and realized i hadn't a clue what i was doing. :S
would be much appreciated!
Videos have to be uploaded via ftp, the admin web interface does not allow uploading of videos.
After uploading a video via ftp you need to visit the admin edit page and click save, otherwise you get an error on the gallery page.
Is everyone doing it this way?
A couple of the websites I run have several non-computer savvy people uploading, so ftp isn't an option. It would be great if the admin upload could be fixed.
On another note, how are people creating the flv files? I found a few different shareware apps but they all suck. I'd love to hear recommendations (Mac user).
I have a problem where, some files that I upload are different resolution, such as HD. Now there is no toolbar or anything. How should I go about changing the frame dynamically to fit the higher resed images?
Also on a side note, is there any way to pull the files size(like in kb or mb?) or date uploaded for a file?
Do you have some svn access to implement it ?
It looks like you can set the width and height in there but an autodetect script is beyond me.
Except using some system calls with ffmpeg
I had to add in the class-album.php/getAlbumThumbImage function:
`//jordi-kun - no images, no subalbums, check for videos
$dp = opendir($albumdir);
while ($thumb = readdir($dp)) {
if (is_file($albumdir.$thumb) && is_valid_video($thumb)) {
return new Image($this, $thumb);
}
}`
right after the
`// Otherwise, look in sub-albums.
$subalbums = $this->getSubAlbums();
foreach ($subalbums as $subdir) {
$subalbum = new Album($this->gallery, $subdir);
$thumb = $subalbum->getAlbumThumbImage();
if ($thumb != NULL && $thumb->exists) {
return $thumb;
}
}`
The way the player works by default, it has a control bar that covers part of the video. At 320x240 it's a very non-trivial part. If I move the mouse away, after a few seconds the bar goes away too. But that isn't entirely intuitive and I only noticed by accident. Besides, I'd like to leave it visible to give an indication of how much time remains.
I've been looking at the documentation from the apparent original producer of the FLV player (the SWF file). It's possible to control the image size, player bar color, show/hide volume control, etc... But how do I move that control bar under my movie where it belongs?!? I didn't have much luck finding info about that.
Maybe resize the video area to leave enough pixels for the control bar... But then the movie centers itself vertically, leaving a black bar on the top and an obstructed area on bottom. Ugh.
But otherwise, again, the video mod is well done.
I wouldn't call it a major problem though. It would be easy enough to separate our movies and stills into different albums with "photo" and "video" in the album names. In my case (for now anyway) they're in completely separate galleries.
this can be done using the watermark hack and forcing to watermark the thumbs of videos.
Warning: Invalid argument supplied for foreach() in /home/sites/mysite/public_html/zenphoto/zen/kses.php on line 429
It is repeated about 25-30 times before then displaying the list of themes. I tried changing the theme but still get the same error repeated on every page - whatever theme is selected. However, at the end of end of the error messages, it does give me the relevant screen eventually - with the last error message showing
Warning: Cannot modify header information - headers already sent by (output started at /home/sites/mysite/public_html/zenphoto/zen/kses.php:429) in /home/sites/mysite/public_html/zenphoto/index.php on line 9
When I eventaully scroll through all this and get to the relevant links - the video file still works but how do I get rid of this problem as it makes this fantasic feature unuseable at the current time?
I have no knowlege of php so am at a bit of a loss to understand what has gone wrong...
I have downloaded and installed the zenvideo zip file from the earlier link according to the instructions.
Thanks
i did add a filmstrip to the videos for thw zenvideo hack like described in this post
http://www.zenphoto.org/support/topic.php?id=1599&replies=4#post-9005
see it at http://www.kiemkracht.com/en/vrij werk/homo herbarius/
an for the video parameters;
on my own site (under contruction at http://www.bertsimons.nl/wordpress/?p=28 )I used jeroen weijerings flashplayer and added this to my customfunctions.php which is called on my image.php page by printDefaultSizedImageVideo() tu use his player which has a lot of adjustable parameters. ( use it uploading an image and a flv of the same name eg movie.jpg, movie.flv)
// Video integration jeroen weijerings flashplayer
function printDefaultSizedImageVideo($alt, $class=NULL, $id=NULL) {
// [BEGIN] added by cvogt: check for non image data
$file_full = $_SERVER['DOCUMENT_ROOT'].getFullImageURL();
$file_wo_ext = substr($file_full,0,strrpos($file_full,"."));
if( file_exists( $file_wo_ext.".flv" )){
?>
<p id="player" style="width:520px;height:390px;">>Get Flash to see this player.
<script type="text/javascript">
var so = new SWFObject("/zenphoto/themes/izen/flvplayer/flvplayer.swf","mpl","520","390","7");
so.addParam("allowfullscreen","true");
so.addVariable("file","<? echo substr(getFullImageURL(),0,strrpos(getFullImageURL(),".")); ?>.flv");
so.addVariable("displayheight","390");
so.addVariable("autostart","true");
so.addVariable("repeat","true");
so.addVariable("overstretch","true");
so.addVariable("showicons","false");
so.write("player");
</script>
<?
}
else {
echo "<img src=\"" . htmlspecialchars(getDefaultSizedImage()) . "\" style=\"border:1px solid #ccc\" alt=\"" . htmlspecialchars($alt, ENT_QUOTES) . "\"" .
" width=\"" . getDefaultWidth() . "\" height=\"" . getDefaultHeight() . "\"" .
(($class) ? " class=\"$class\"" : "") .
(($id) ? " id=\"$id\"" : "") . " />";
}
return;
}
<script type="text/javascript" src="<?= $_zp_themeroot ?>/flvplayer/swfobject.js"></script>
in your image.php header to get it working..
the patch can be found in the zenvideo ticket here
mov files are heavy, so only intranet use is advised. For both video types, Quicktime plugin for your browser is required.