ffmpeg movie thumbnails (with time)

floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2005-04-25 04:31

Attached is files needed to get movie thumbnails with ffmpeg. Only tested for version 1.5.
ffmpeg is a Free multimedia project developed under Linux (but can be compiled under other OS, like Windows).

Extract the files over the existing files.
/classes/AlbumItem.php << modified the function makeThumbnail() function
/setup/config_data.inc << modified to add the path for ffmpeg and the time under the options tab
/setup/functions.inc << added the ffmpeg check

The setup folder is optional.....you add the 2 variables in config.php

$gallery->app->use_ffmpeg = "/home/langleyc/ffmpeg/ffmpeg";
$gallery->app->ffmpeg_time = "0.3";

Ensure that your path to ffmpeg is correct and that the time (in seconds) is less than the movie.
ffmpeg might have a limitation for the time but I have not been able to find any documentation on this. It is hard to find any good documentation on ffmpeg.

Sorry I can't help with installing ffmpeg as I don't have shell access to my server. If you have a freeBSD server I can attach the pre compiled binary if requested.
If you have mplayer try mattyb's Mplayer mod for movie thumbnails

I have updated the embedded movie mod (using getID3) for 1.5 as well.

AttachmentSize
ffmpeg.zip40.42 KB
 
dewdoobrown

Joined: 2004-01-12
Posts: 38
Posted: Mon, 2005-04-25 07:02

I have done some testing. I am trying to rebuild my Movies Album and I get this message w/debugging on.

Rebuilding 9 thumbnails... 
Processing image 1... 
Generating thumbnail. 
Executing:
/Library/WebServer/Documents/gallery15/ffmpeg -i /Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.mov -ss -f singlejpeg -t 0.001 -y /Library/WebServer/Documents/gallery15/album/2bf6c2d8aa665b353ca1a13dfbad40f4.movieThumb.jpg 2>/Library/WebServer/Documents/gallery15/album/2bf6c2d8aa665b353ca1a13dfbad40f4.movieThumb.log

Results:
none

Debug messages:


Status: 1 (expected 0) 
Resizing Image: /Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg 
Getting Dimension of file: /Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg 
PHP's getimagesize() unable to determine dimensions. 
Executing:
'/usr/local/bin/identify' '/Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg'

Results:
none

Debug messages:
identify: missing an image filename `/Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg'.

Status: 1 (expected 0) 
Unable to determine image dimensions! 
   No resizing required 
Executing:
rm -f /Library/WebServer/Documents/gallery15/album/2bf6c2d8aa665b353ca1a13dfbad40f4.movieThumb.[0-9]*.jpg

Results:
none

Debug messages:


Status: 0 (expected 0) 
Getting Dimension of file: /Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg 
PHP's getimagesize() unable to determine dimensions. 
Executing:
'/usr/local/bin/identify' '/Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg'

Results:
none

Debug messages:
identify: missing an image filename `/Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg'.

Status: 1 (expected 0) 
Unable to determine image dimensions! 
Getting Dimension of file: /Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg 
PHP's getimagesize() unable to determine dimensions. 
Executing:
'/usr/local/bin/identify' '/Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg'

Results:
none

Debug messages:
identify: missing an image filename `/Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg'.

Dave I replaced my modified files to get ffmpeg to generate movie thumbs and I get:

Rebuilding 9 thumbnails... 
Processing image 1... 
Generating thumbnail. 
Executing:
/Library/WebServer/Documents/gallery15/ffmpeg -an -y -t 0:0:0.001 -i /Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.mov /Library/WebServer/Documents/gallery15/album/2bf6c2d8aa665b353ca1a13dfbad40f4.movieThumb.%4d.jpg 2>/Library/WebServer/Documents/gallery15/album/2bf6c2d8aa665b353ca1a13dfbad40f4.movieThumb.log

Results:
none

Debug messages:

Status: 0 (expected 0) 
Resizing Image: /Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg 
Getting Dimension of file: /Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg 
Executing:
'/usr/local/bin/convert' -quality 90 -size 150x150 -strip -coalesce '/Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg' -geometry 150x150 '/Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg.tmp'

Results:
none

Debug messages:

Status: 0 (expected 0) 
Executing:
rm -f /Library/WebServer/Documents/gallery15/album/2bf6c2d8aa665b353ca1a13dfbad40f4.movieThumb.[0-9]*.jpg

Results:
none

Debug messages:

Status: 0 (expected 0) 
Getting Dimension of file: /Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg 
Getting Dimension of file: /Library/WebServer/Documents/gallery15/albums/Miscellaneous/tshirt_folding.thumb.jpg 

and my movie thumbs gets built. I dunno if it my PHP version is the culprit PHP's getimagesize() error unable to determine dimensions.

I am curious if anyone else has problems. I did backup my files and my movie thumbs are getting created. Dave I thought you may want to know what I encountered.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2005-04-25 14:24

If I rebuild the thumbs I don't get any error messages. The thumbs are generated with the time set in config.php. I will do some testing when I get home.
I will try with a few movies as well.

Dave

 
lupar_blackice
lupar_blackice's picture

Joined: 2005-04-21
Posts: 60
Posted: Tue, 2005-04-26 10:59

Would you be able to post a example of what the modification should look like?

function makeThumbnail($dir, $thumb_size, &$album, $pathToThumb="")

is it just the pathToThumb that needs to be updated?

Quote:
/classes/AlbumItem.php << modified the function makeThumbnail() function

Thanks

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2005-04-26 17:10

ffmpeg takes the time from the movie and creats a thumbnail image.
the makeThumbnail() is the only function that is changed. The WHOLE function chnages. compare the file (original and the suplied)

Dave

 
lupar_blackice
lupar_blackice's picture

Joined: 2005-04-21
Posts: 60
Posted: Wed, 2005-04-27 16:22

Thanks for the reply but what should the code look like?

Quote:
makeThumbnail() is the only function that is changed

can you give me a example of what the code should look like?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2005-04-28 02:46

lupar_blackice,
look at the file in the download and compare to the the original. Is that too hard? or do you want me to show you the old and the new?

I don't understand what you mean when you say "what the code should look like". Can you explain?

Dave

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Wed, 2005-07-06 02:10

Hey guys i am having probs with the getimagesize foults as well. It appears to only happen on wmv and some avi. What did you do dewdoo brown to fix it? My knowledge of php is very limited so any help would be appreciated. Thanks
Matt

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2005-07-06 06:06

Can you post the error you see when you have debug on?
post the .wmv file so I can test. saying "i am having probs with the getimagesize foults as well" with no other details is not that helpful.

Dave

 
mattyb

Joined: 2005-07-04
Posts: 82
Posted: Thu, 2005-07-07 02:15

Hey Dave
Thanks for the reply but I realized what my problem is/was I am a relative noob as far as php and linux so i had found a precompiled version of ffmpeg and apparently that was giving me some of the problems. I compiled my own version on my webserver (surprisingly easy) and that fixed all but one which isnt a problem afterall. All but one of my wmv's are wmv3 which ffmepg doesnt support and the one that i could get to work for some reason is a wmv1 and that is why i was so confused. Anyways turns out the php code getimagesize wasnt the problem afterall. I have a related question but I dont want to hijack this thread so i'll start a new one. Could you look for it in this forum and offer some advice?
Thanks again

Matt

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2005-07-07 04:55

Glad you got it sorted so to speak.

Quote:
Sorry I can't help with installing ffmpeg as I don't have shell access to my server. If you have a freeBSD server I can attach the pre compiled binary if requested.

I have very little clue of movies ( I don't even have a movie camera, or a very good still camera). ffmpeg is hard to track as well; with different versions, OSs, and encoding/codeacs.

Dave

 
khsjr1970

Joined: 2004-04-24
Posts: 271
Posted: Fri, 2005-08-12 20:55

Dave ? anyway you can send me the pre compiled binary for FFMPEG ?

MY host is running FreeBSD version 4.11

The FFMPEG host is having FTP server problems so I cannot get it from there. I also wouldnt be sure how to compile it.

Thanks in advance.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2005-08-13 02:08

http://langleycom.com/gallery_download/

look for ffmpeg and download it. It might try to be saved as a .txt file but you should be able to just remove the .txt extention.

I am looking for a newer version that has all the .mov support compiled. My new camera makes .mov movies and this version of ffmpeg does not work to make thumbs (g1 and G2)

Dave

 
khsjr1970

Joined: 2004-04-24
Posts: 271
Posted: Sat, 2005-08-13 18:16

Beautiful !!!!!

thanks dave.

 
RooMeat

Joined: 2003-08-20
Posts: 19
Posted: Tue, 2005-08-16 12:57

I have a new install of Gallery 1.5.1 RC2 and I downloaded the 1.5movie_mod package. Uploaded this to me gallery install and overwrote existing files.
If I try to go to any gallery, I get the following error:

Fatal error: Cannot redeclare showchoice() in /home/httpd/vhosts/ozsportsbikes.com/httpdocs/modules/gallery/lib/Form.php on line 240

What did I miss?? :cry:

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2005-08-16 13:49

I have not updated the code for 1.5.1 yet not untill it it releaded (not RCs)

 
khsjr1970

Joined: 2004-04-24
Posts: 271
Posted: Tue, 2005-08-16 17:46
floridave wrote:
I am looking for a newer version that has all the .mov support compiled. My new camera makes .mov movies and this version of ffmpeg does not work to make thumbs (g1 and G2)
Dave

I would be more then happy to try to compile a newer version, if someone was willing to walk me through the steps, or point me toward some directions that do so. OH! and they should be written for dummies.

When it comes to command line commands, I have no idea what I'm doing. I do not run my own server. I know very little about Linux.

But I am more then willing to take a shot at it.

Is this something that can be done with say ? WS_FTP Pro ?
I would believe its just a matter of the codecs that it gets compiled with yes ?

 
reynan

Joined: 2003-09-10
Posts: 49
Posted: Mon, 2005-08-22 14:55

bare with me.. but i was not able to make it work. Could you post the changes that have been made in the AlbumItem.php with regards to the first post of Dave.

Can't seem to generate the thumbnail.

lupar_blackice wrote:
Would you be able to post a example of what the modification should look like?

function makeThumbnail($dir, $thumb_size, &$album, $pathToThumb="")

is it just the pathToThumb that needs to be updated?

Quote:
/classes/AlbumItem.php << modified the function makeThumbnail() function

thanks,
--reynan

 
justchil
justchil's picture

Joined: 2003-02-07
Posts: 225
Posted: Mon, 2005-08-22 14:59

Ok maybe I'm missing something here. I've compiled ffmpeg on my linux box with no problem. I ran the binary just to make sure it works.

I added the 2 lines to my config.php with the path of /usr/local/bin

I uploaded the files you have made and overwrote my existing files.

I'm not sure where to go now.. I've tried rebuilding thumbs but nothing happens. I'm not sure what I'm missing.

I have a fresh gallery install + your embed mod. (1.5)

Thanks

 
justchil
justchil's picture

Joined: 2003-02-07
Posts: 225
Posted: Mon, 2005-08-22 15:33

After some looking my AlbumItem.php and the AlbumItem.php I downloaded in your first post.. this line looks exactly the same on both

function setPhoto($dir, $name, $tag, $thumb_size, &$album, $pathToThumb="") {
function setPhoto($dir, $name, $tag, $thumb_size, &$album, $pathToThumb="") {

I can't get an error or anything so I'm doing _something_ wrong. I checked the config wizzard just to make sure the ffmpeg options are showing up.. and they are.

 
khsjr1970

Joined: 2004-04-24
Posts: 271
Posted: Mon, 2005-08-22 17:21

when you say you have a fresh install of gallery. this mod does not yet work with 1.5.1

dave is currently waiting for it to become final code before implementing this into the newest gallery 1.5.x

Gallery 2 also uses this feature with NO MODDING.

have either of you tried this ? just to compare apples to apples ?

 
khsjr1970

Joined: 2004-04-24
Posts: 271
Posted: Mon, 2005-08-22 17:22
RooMeat wrote:
I have a new install of Gallery 1.5.1 RC2 and I downloaded the 1.5movie_mod package. Uploaded this to me gallery install and overwrote existing files.
If I try to go to any gallery, I get the following error:

Fatal error: Cannot redeclare showchoice() in /home/httpd/vhosts/ozsportsbikes.com/httpdocs/modules/gallery/lib/Form.php on line 240

What did I miss?? :cry:

You missed that this IS NOT A PORTED NUKE MODULE WHICH IS WHAT YOU ARE USING.

 
justchil
justchil's picture

Joined: 2003-02-07
Posts: 225
Posted: Mon, 2005-08-22 17:41

Sorry fresh install meaning I just installed it using 1.5 NOT 1.5.1 but even with 1.5.1 that guy got an error. I'm getting nothing at all. In fact it's like I haven't done anything.. other than the options in the config wiz for ffmpeg.

I don't want to use g2.. I'm a g1 man 4 life :)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2005-08-23 01:34

justchil, I guess I am confused as well as others the WHOLE Function changed not just the first line of the function...This is what the makeThumbnail function should look like.

	function makeThumbnail($dir, $thumb_size, &$album, $pathToThumb="") {
		global $gallery;
		$name = $this->image->name;
		$tag = $this->image->type;

		if (isDebugging()) {
		     processingMsg(_("Generating thumbnail."));
		}
		
		if ($this->isMovie()) {
			/* Use ffmpeg for the thumb */
                       $sessionId = session_id();
                       // format for tmp files
                       $tmpThumbFmt = $gallery->app->tmpDir."/$sessionId.movieThumb";
                       $tmpThumbTyp = "jpg";
                       $tmpThumb = "$tmpThumbFmt.$tmpThumbTyp";
                       $time = $gallery->app->ffmpeg_time; // take the time from config.php
		       /* do we have ffmpeg installed */
                       if($gallery->app->use_ffmpeg && file_exists($gallery->app->use_ffmpeg)){
				$cmd = $gallery->app->use_ffmpeg." -i $dir/$name.$tag -ss $time -f singlejpeg -t 0.001 -y $tmpThumbFmt.$tmpThumbTyp 2>$tmpThumbFmt.log";
                               list($results, $status) = exec_internal($cmd);
                               if($status > 0){
                                       gallery_error(array_pop( file("$tmpThumbFmt.log")));
                               }
                       }
                       /* were we able to generate the thumb? */
                       if(file_exists($tmpThumb)){
                               fs_copy($tmpThumb, "$dir/$name.thumb.jpg");
                               $ret = resize_image("$dir/$name.thumb.jpg", "$dir/$name.thumb.jpg", $thumb_size);
                               exec_wrapper("rm -f $tmpThumbFmt.[0-9]*.$tmpThumbTyp");
                       }else{
                               /* Use a preset thumbnail */
                               fs_copy($gallery->app->movieThumbnail, "$dir/$name.thumb.jpg");
                       }

			$this->thumbnail = new Image;
			$this->thumbnail->setFile($dir, "$name.thumb", "jpg");
			list($w, $h) = getDimensions("$dir/$name.thumb.jpg");
			$this->thumbnail->setDimensions($w, $h);
		} else {
			/* Make thumbnail (first crop it spec) */
			if ($pathToThumb) {
				$ret = copy($pathToThumb,"$dir/$name.thumb.$tag");
			} 
			else if ($this->image->thumb_width > 0) {
				$ret = cut_image("$dir/$name.$tag", 
								 "$dir/$name.thumb.$tag", 
								 $this->image->thumb_x, 
								 $this->image->thumb_y,
								 $this->image->thumb_width, 
								 $this->image->thumb_height);
				if ($ret) {
					$ret = resize_image("$dir/$name.thumb.$tag", 
										"$dir/$name.thumb.$tag", $thumb_size);
				}
			} else {
				$ret = resize_image("$dir/$name.$tag", "$dir/$name.thumb.$tag",
					     $thumb_size);
			}

			if ($ret) { 
				$this->thumbnail = new Image;
				$this->thumbnail->setFile($dir, "$name.thumb", $tag);
	
				list($w, $h) = getDimensions("$dir/$name.thumb.$tag");
				$this->thumbnail->setDimensions($w, $h);

				/* if this is the highlight, remake it */
				if ($this->highlight) {
					$this->setHighlight($dir, 1, $album);
				}
			} else {
				return _("Unable to make thumbnail") ." ($ret)";
			}
		}

		return 0;
	}

Look in your temp directory to see if the thumb is made with a session ID and .jpg that might point you to the issue.

Dave

 
justchil
justchil's picture

Joined: 2003-02-07
Posts: 225
Posted: Tue, 2005-08-23 13:22

Yeah I have the whole function there. I used the file that you provided and overwrote my current file. I'm not seeing anything at all in the tmp folder :( It's like it's not doing anything at all.

I will keep trying to see if I can find a problem.. but at this point I'm about ready to give up.

 
khsjr1970

Joined: 2004-04-24
Posts: 271
Posted: Tue, 2005-08-23 17:39

may be a silly question but ive seen sillier mistakes.

have you uploaded a movie file ? to use with this mod ? to allow it to make a thumbnail ?

without the movie upped, dunno that the mod will do anything at all.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2005-08-23 17:57

in debug mode you should see the commands that galley is trying to run.
see if you can run the same commands on you own server. Perhaps the ffmpeg you are using is not compiled properly.
Try a G2 install and see if ffmpeg works in that. It has more testing and config options that might point you in the right direction.

Dave

 
justchil
justchil's picture

Joined: 2003-02-07
Posts: 225
Posted: Tue, 2005-08-23 18:36

Yes I uploaded a movie lol.. I'm not completely ignorant :P

I'll try your suggestions tonight Dave. Thanks for you hard work!

 
justchil
justchil's picture

Joined: 2003-02-07
Posts: 225
Posted: Fri, 2005-08-26 23:52

Ok guys I'm on to something finally. I've got a pot of coffee going so I'm not stopping til it works!

I'm down to figuring out what appears to be a syntax error with ffmpeg. I've got an error to work with now. I'll update this post once I narrow the problem down.

my cmd
$ ffmpeg -i evo_vs_cobra.mpeg -ss 2 -f singlejpeg -t 0.001 -y test.jpg

the output

Input #0, mpeg, from 'evo_vs_cobra.mpeg':
  Duration: 00:00:19.9, start: 0.267833, bitrate: 1076 kb/s
  Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 352x240, 29.97 fps, 893 kb/s
  Stream #0.1[0x1c0]: Audio: mp2, 44100 Hz, mono, 64 kb/s
Unknown input or output format: singlejpeg

update...

Ok so its something to do with singlejpeg as you can see.. I just made a gif thumb with no problem using -f gif

I now see that I can get a full listing of the formats supported on my machine with ffmpeg -formats. I see no listing of jpg or singlejpeg so I'm going to investigate..

 
justchil
justchil's picture

Joined: 2003-02-07
Posts: 225
Posted: Sat, 2005-08-27 01:19

Ok I'm getting closer...

ffmpeg -i evo_vs_cobra.mpeg -ss 13 -vframes 1 -t 0.001 -y test%d.jpg

Generates test1.jpg. %d defines the number of the pic according to how many vframes you set. This would work fine except it messes up the filename.

Either I'm going to have to figure out how to remove the %d part of it.. or just modify the gallery code to make it work.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2005-08-27 02:38

justchil, I _think_ that the singlejpg switch is only on some versions/platforms. One might want to look at the G2 code and see if it done a bit different. The code that I have for this mod is slightly modded G2 code for use in G1.

Dave

 
khsjr1970

Joined: 2004-04-24
Posts: 271
Posted: Sat, 2005-08-27 03:33

seperate from FFMPEG was a codec package download. not sure if this information helps or hiners, but in case it was overlooked and is part of the problem, then ive helped. If not then i just wasted 30 seconds of your life reading this, and unfortunatly there are no refunds : )

 
RooMeat

Joined: 2003-08-20
Posts: 19
Posted: Wed, 2005-09-07 05:02
khsjr1970 wrote:
You missed that this IS NOT A PORTED NUKE MODULE WHICH IS WHAT YOU ARE USING.

Ummm.. go back to school.
This mod works FINE within a embedded gallery. It just doesn't work with the RC versions. I had it working perfect with the previous version and from within Postnuke :)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2005-09-07 05:17

Calm down.

floridave wrote:
I have not updated the code for 1.5.1 yet not untill it it releaded (not RCs)

 
jrandom

Joined: 2004-12-05
Posts: 58
Posted: Thu, 2005-11-10 23:33

floridave,
I finally got the other problem working. Thanks for your help. I was wondering what do I have to do to get thumbnails to show up for videos. I get nothing. Only an envelope with the corner cut out. I activated the thumbnail page module but still no luck, I don't even get the thumbnail page tab when I select edit movie. Any ideas?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2005-11-11 05:21
jrandom wrote:
I activated the thumbnail page module but still no luck, I don't even get the thumbnail page tab when I select edit movie. Any ideas?

are you sure you are using G1?

 
jrandom

Joined: 2004-12-05
Posts: 58
Posted: Fri, 2005-11-11 13:52

No I am using G2 with dreamhost.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2005-11-11 18:08
jrandom wrote:
No I am using G2 with dreamhost.

Try in a G2 forum.

 
bjdownes
bjdownes's picture

Joined: 2004-03-13
Posts: 14
Posted: Tue, 2008-11-11 17:49

Hey floridave, are these files good for 1.6?
Is there a repository for patches like this? I'd like to see a complete list to see if there are any other's i'd like.
I thought i remembered seeing one back in the day but i couldn't find it .. .

 
bjdownes
bjdownes's picture

Joined: 2004-03-13
Posts: 14
Posted: Tue, 2008-11-11 17:51

Also has it been set up so you can use something other than first frame? I'd like to do the same thing i was trying to do with G2. (i want to use as default a second into the video for thumbnails or better yet, the middle of the video)

 
bjdownes
bjdownes's picture

Joined: 2004-03-13
Posts: 14
Posted: Tue, 2008-11-11 17:54

Oh, and another question (that prob doesn't deserve it's own topic).... any suggestions on a good host that supports ffmpeg (or at least its installation). I've found my virtual server hosts i've been using don't like ffmpeg (processor hog). So i'm doing all my testing on my laptop as a localserver.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2008-11-11 19:57
Quote:
Posted: Fri, 2005-11-11 11:08

was my last post in this thread 3 years TO THE DAY!

Quote:
Hey floridave, are these files good for 1.6?

I doubt it. lots have chanaged in 3 years,

Quote:
Is there a repository for patches like this?

only if the author submits them: https://sourceforge.net/tracker/?group_id=7130&atid=307130
I did not.

Quote:
Also has it been set up so you can use something other than first frame?

g2 does this, not this. You could look at how G2 does it witht eh ffmpeg call and adapt it to this, but you are on your own.

@hosts: Don't use ipowerweb, they use to support it but don't now. Dreamhost seems to be good but like most hosts they are cheap and thus overloaded/slow at times.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
bjdownes
bjdownes's picture

Joined: 2004-03-13
Posts: 14
Posted: Wed, 2008-11-12 06:59

Dave! Looks like even 1.5.9 doesn't like this mod . ..any chance you have a backup of 1.5.2 or whatever version that was back in the day?
Even if it's customized out . .. I'm gonna hack it to bits anyways. I just need a gallery that works with ffmpeg AND my iphone! I got G1 working with my iphone ad G2 working with ffmpeg .. . go figure.

Quote:
I have updated the embedded movie mod (using getID3) for 1.5 as well.

and do you remember if this had the embeded movie mod in it? looks like the link for that one is dead. . .

Raising old mods from the dead for an old version is prob not what you wake up in the morning wanting to do... So I understand if this is just way too much work for such a specialized purpose. It might even be good if i am forced to start from scratch anyways . .. So give me the word if i'm starting to bug ya... seriously tell me.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2008-11-12 22:28

Fixed the above link to go to the right thread.
I did not have the files for the embedded movie mod anymore but the internet time machine did:
http://web.archive.org/web/20080201131910/http://langleycom.com/gallery_download/ so this should work:
http://web.archive.org/web/20080201131910/http://langleycom.com/gallery_download/1.5.1movie_mod.zip ( it is for G1.5.1) but should still work for 1.5.2

I will put that file back up to my site when I get a chance.

@G1.5.2: http://downloads.sourceforge.net/gallery/gallery-1.5.2.zip?modtime=1221562868&big_mirror=1

Good luck!

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2008-11-12 22:34

FYI this is a great tool for finding and merging different files:
http://winmerge.org/

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
areamike

Joined: 2009-03-31
Posts: 5
Posted: Thu, 2009-10-01 16:04

Time to re-hash this topic.

floridave, I have added your code to Gallery 1.5..1. However, I can't seem to get thumbs created for my movie files that I am uploading.

I installed G2 to test ffmpeg with it and it works just fine for creating the thumbs for movies.

I checked my temp directory and found this log file.

Quote:
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --prefix=/usr --libdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include/ffmpeg --enable-libmp3lame --enable-libogg --enable-libvorbis --enable-libogg --enable-libtheora --enable-libfaad --enable-libfaac --enable-libgsm --enable-xvid --enable-x264 --enable-liba52 --enable-liba52bin --enable-pp --enable-shared --enable-pthreads --enable-gpl --disable-strip
libavutil version: 49.4.0
libavcodec version: 51.40.4
libavformat version: 51.12.1
built on Jun 4 2007 11:02:12, gcc: 4.1.1 20070105 (Red Hat 4.1.1-52)
[wmv3 @ 0x5b36d24]Extra data: 8 bits left, value: 0

Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 29.97 (30000/1001)
Input #0, asf, from '/var/www/html/albums/album08/dave_footstock06.wmv':
Duration: 00:00:59.0, start: 1.579000, bitrate: 1671 kb/s
Stream #0.0: Audio: wmav2, 44100 Hz, stereo, 160 kb/s
Stream #0.1: Video: wmv3, yuv420p, 720x480, 1500 kb/s, 29.97 fps(r)
Unknown input or output format: singlejpeg

Could that have something to do with the time set for ffmpeg? I left it at your default of 0.3. I have tried various videos that are different lengths. Still no success.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2009-10-02 02:34

Sorry I have moved on passed G1 and G2 and onto G3. No time to help out on this. Perhaps somebody from the community will help you out.
Google for 'singlejpeg' and ffmpeg. The coding for your version of ffmpeg might have changed.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2009-10-02 02:45

singlejpeg is depreciated try something like
$command = $_CONF['ffmpeg_path']." -i ".$inputPath." -ss ".$_CONF['thumb_offset']." -f mjpeg -vframes 1 -y -s 350x150 ".$outputPath;

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

 
areamike

Joined: 2009-03-31
Posts: 5
Posted: Fri, 2009-10-02 12:38
Quote:
$command = $_CONF['ffmpeg_path']." -i ".$inputPath." -ss ".$_CONF['thumb_offset']." -f mjpeg -vframes 1 -y -s 350x150 ".$outputPath;

Where would I use that code?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2009-10-02 12:57

Not a G1 guy. But apparently you applied Dave's code somewhere. I'm simply suggesting a different command mjpeg instead of singlejpeg.
Those $_CONF values would not be present in G1, you'll have to extrapolate.

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