New Module: NoFFMPEG

rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Tue, 2010-09-14 18:29

I've uploaded a new module, NoFFMPEG, to my github account. It can be found at:
http://github.com/rWatcher/gallery3-contrib/tree/master/modules/noffmpeg/

This module overrides Gallery 3's default helpers/movie.php file with one that has been modified to work without FFMPEG present on the server, allowing users to upload video's in supported formats. Uploaded videos will be given a default thumbnail, and the video width and height will be set to 320x240.

I've uploaded test .flv videos using both the add photos menu option and the server add module, and everything appears to work file with this module turned on.

Note that users will still see the "Can't find ffmpeg on your system. Movie uploading disabled." message on the add photo's dialog, and that users will need to manually type something like "*.flv" into the Select photos dialog in order to actually see videos.

This module is not intended for servers that actually have FFMPEG installed. If FFMPEG is on the system, Gallery should continue to use ffmpeg as normal (although I haven't tested this).

I have only tested this against the current git code (as of commit 1a0d76c43e3545771ae3), so it may not work with older releases like RC-2. Also, I've only tested this on an unsupported server configuration (Windows/IIS), although I don't foresee any problems using it with linux servers.

---
Report Problems/Suggestions Here | Get latest version | Documentation | Coffee Fund | My Library | My GitHub

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2010-09-14 20:42

@rWatcher
would this class help?

It can parse .flv for height, width, framerate...

I had asked the author a while back if he'd consider expanding to other types and he said he may - looks like he has not but would not hurt to ask again.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Wed, 2010-09-15 03:09

If that PHP class works, then perhaps we don't need ffmpeg at all?
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2010-09-15 03:34

It works for flv only ATM, I'll see if a little prodding @the author can get him to expand a bit.
Plus would still need a way to extract a thumb. Which BTW flash can do with the BitmapData class. For G2 I created an AIR desktop video player which could snap a png image from the currently playing movie.
this is ~ how I was testing this class w/ G2:

$flv = new FLVMetaData($item->fetchPath());
$metaData = $flv->getMetaData();
    if($metaData !== false){
        echo $metaData["width"] . "<br />";
        echo $metaData["height"] . "<br />";
        //$flv->dumpMetaData();
        //var_dump($metadata);
    }
...

worked on all flv's I tested.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2010-09-15 03:42
 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Fri, 2010-09-17 03:33

I've added the class file to the module -- It will now attempt to auto-detect video height and width when dealing with .flv files.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2010-09-17 04:15
 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Fri, 2010-09-17 14:22

It worked, although I only tested it with one video file. There's a warning in the class file about how metadata fields "might be dependent upon the software used to create the FLV", so figured there's a possibility that it might not work with some files.

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Tue, 2012-04-17 03:41

I've updated this module for use with Gallery 3.0.1. I've also "fixed" the upload photos form to remove the ffmpeg not found message and to display video files in the file selection dialog.

 
eddy@inpulsearts.com
eddy@inpulsearts.com's picture

Joined: 2009-08-04
Posts: 14
Posted: Wed, 2011-05-04 21:36

which directory do I upload this module to?

Eddy
http://www.inpulsearts.com

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2011-05-04 22:12
 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Thu, 2011-05-05 00:58
eddy@inpulsearts.com wrote:
which directory do I upload this module to?

/your_gallery_3_directory/modules/

 
RFick73

Joined: 2010-12-22
Posts: 11
Posted: Thu, 2011-09-29 03:26

I am trying to get videos to upload using fmmpeg or noffmprg

After I installed the noffmpeg module located at 'http://gallery.menalto.com/files/noffmpeg.zip' I am able to manually type in movie file names and supposedly successfully upload them according to the Normal "Add Photos" link
Problem is, I don;t see the file after uploading it. I can't find it anywhere. I have a bone stock install & am wondering what I may have to change to get it to work so I can upload movie files.

I have tried a .mpg & it seems like it uploads fine, it even states it added it.
I tried .mov & .avi, but they failed stating that the upload script could not be found.

What do I need to do to get the files to upload and show properly?

What are the actually supported file types that this supports?

OS: Win NT 6.1 (Server 2008 R2)
PHP: 5.3.8
MySQL: 5.1.58-community
Gallery was just downloaded & installed: 3.0.2 (Coollanta)

 
RFick73

Joined: 2010-12-22
Posts: 11
Posted: Sat, 2011-10-01 14:44

>>Bump<< Anyone?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2011-10-01 15:48

G3 only natively supports and displays flash video(flv) or mp4
there is another module for unsupported video types http://www.gallerymodules.com/

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
RFick73

Joined: 2010-12-22
Posts: 11
Posted: Sun, 2011-10-02 18:43

I tried the 'videos' module.
It's basically a ServerAdd module but for videos.
It works, but some videos don't end up getting a thumbnail, and is there any way to change each of the thumbnails individually so I can use a screen capture from it for each video?

Or did I try the wrong one, I was hoping more to embed the videos into the gallery.

Any other suggestions would be greatly appreciated.

 
RFick73

Joined: 2010-12-22
Posts: 11
Posted: Sun, 2011-10-02 19:41

I think maybe I'm getting myself confused trying to use all these different modules or something...
In the end, I just want an easy way to add different video types to my gallery.
Either leaving them be as the original encoding, or having something re-encode them.

I currently use the Serveradd module to upload new Directories/albums.
What is the best way to get the videos in as well?
The 'videos' module seemed to work for me, but I don't see a way of changing the thumbnail for the video & well, I would rather not have to have people download the video THEN watch it.
The 'transcode' module seemed the viable next step. But I enabled it, and set it up in the advanced tab, but it doesn't seem to be doing anything? Am I supposed to still use the regular Add Photo's link and chnge the name to the .avi or what I want? It basically told me the file was larger than 2MB.
I also tried using the 'noffmpeg' module, I don;t get the file size error, but nothing seems to happen afterwards either still.

Anyone have a suggestion for me?

OS: Win NT 6.1 (Server 2008 R2)
PHP: 5.3.8
MySQL: 5.1.58-community
Gallery was just downloaded & installed: 3.0.2 (Coollanta)

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2011-10-02 19:44

I don't use G3 myself, but I did setup a test install and hacked the core code to let all web friendly formats play.
flv, f4v, mov, mp4(all play in my flashvideo player) and webM which would play via HTML5 <video /> in all modern browsers except safari(but who cares?)

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
RFick73

Joined: 2010-12-22
Posts: 11
Posted: Mon, 2011-10-03 02:02

So, have I setup my video module incorrectly, or am I missing some other module or setup perameter?
It looks like it tries to upload the video, then it just doesn't show anything afterwards.

Suggestions?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2011-10-03 02:17

Both my inexpensive hosts have ffmpeg installed as default so can only offer a suggestion to post a url to an file that is giving grief so I can test it.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
ebrandow

Joined: 2010-11-30
Posts: 7
Posted: Thu, 2011-12-15 23:16

My host (ICDSoft) also doesn't offer ffmpeg. I installed the noffmpeg module and was able to upload videos. It just pulls the generic placeholder icon as a thumbnail since it can't actually use a video frame (as has been discussed elsewhere). I'm then able to simply ftp a replacement image for the generic icon. However, it stretches/squishes that replacement image to 200x200, the dimensions of the placeholder image. For the life of me I cannot find where that width and/or height is defined. It's not in Settings -> Advanced. The video dimensions plugin defines the height/width of the video itself, but not the thumbnail. I've been digging around through files, but I can't find where it's defined. Any help?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2011-12-16 00:30

What theme?
Url to offending image?

if default wind theme:
edit gallery3/themes/wind/views/page.html.php
just before the </head> add:

<style>
  #g-album-grid img {
    width:200px; //or your desired width
    height: auto;
  }
</style>

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
ebrandow

Joined: 2010-11-30
Posts: 7
Posted: Fri, 2011-12-16 03:12

I like how it's handling image thumbnails, and this css seemed to impact everything. I'm just trying to correct how it's handling the movie thumbnail, which is the only one that seems to be stretched because of a defined height. I'll PM you the url.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2011-12-16 12:29
<style>
  .g-thumbnail {
    width: 200px;
    height: auto;
  }
  .g-valign {
    margin-top: 20px !important;
  }
</style>

The noffmpeg module is likely setting the thumb at 200x200 but I've never even cracked that module open and don't care to.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Fri, 2011-12-16 19:00

If I remember correctly, Gallery automatically detected the height and width of the thumbnail (which in this case would be the 200x200 missing_movie.png file) and then stores it in the items database under thumb_height / thumb_width. Creating an alternate missing_movie.png with different dimensions and placing it in the modules/noffmpeg/images folder should result in image thumbnails being assigned the new height and width for future uploads. You should also be able to manually edit the db entry and change the thumbnail height and width for existing movies that way.

 
ebrandow

Joined: 2010-11-30
Posts: 7
Posted: Fri, 2011-12-16 21:02

That did it -- thank you so much, rWatcher!

 
psychoph

Joined: 2009-11-15
Posts: 36
Posted: Wed, 2012-01-04 03:10

rWatcher i noticed that you added some code to include
// rWatcher edit: include MP4Info.php library.
include MODPATH . "noffmpeg/libraries/MP4Info.php";

What i didn't notice in the libraries folder was the MP4Info.php was that file coming from the project http://code.google.com/p/php-mp4info/

I didn't see any code actually using the project though was that a todo feature?

 
psychoph

Joined: 2009-11-15
Posts: 36
Posted: Wed, 2012-01-04 03:43

I think i did what rWatcher was wanting to do. I took the code from the google project i listed above and included it in noffmpeg. Now it will at least get the height and width of the mp4 file that is uploaded. I wasn't sure if there are other valid file formats and I still need to test it with the mp4s that I am converting to youtube format using xilisoft and the ones i can upload form my cell phone, but it worked with one.

Maybe someone else wants to review the code and see if I did anything stupid as this is my first try at this.

It still doesn't get a thumbnail image.

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Tue, 2012-04-17 03:42

Updated for use with Gallery 3.0.3.

 
shadlaws

Joined: 2012-03-14
Posts: 183
Posted: Fri, 2013-02-22 23:01

UPDATE: recent upgrades to Gallery have made this module obsolete. If you're currently using it, we recommend that you deactivate it. For more information, please see the documentation page at http://codex.galleryproject.org/Gallery3:User_guide:Obsolete_modules.