ffmpeg movie thumbnails (with time)
floridave
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. Extract the files over the existing files. 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. 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 updated the embedded movie mod (using getID3) for 1.5 as well.
|
||||
Posts: 38
I have done some testing. I am trying to rebuild my Movies Album and I get this message w/debugging on.
Dave I replaced my modified files to get ffmpeg to generate movie thumbs and I get:
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.
Posts: 27300
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
Posts: 60
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?
Thanks
Posts: 27300
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
Posts: 60
Thanks for the reply but what should the code look like?
can you give me a example of what the code should look like?
Posts: 27300
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
Posts: 82
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
Posts: 27300
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
Posts: 82
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
Posts: 27300
Glad you got it sorted so to speak.
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
Posts: 271
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.
Posts: 27300
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
Posts: 271
Beautiful !!!!!
thanks dave.
Posts: 19
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:
Posts: 27300
I have not updated the code for 1.5.1 yet not untill it it releaded (not RCs)
Posts: 271
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 ?
Posts: 49
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.
thanks,
--reynan
Posts: 225
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
Posts: 225
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.
Posts: 271
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 ?
Posts: 271
You missed that this IS NOT A PORTED NUKE MODULE WHICH IS WHAT YOU ARE USING.
Posts: 225
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
Posts: 27300
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.
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
Posts: 225
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.
Posts: 271
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.
Posts: 27300
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
Posts: 225
Yes I uploaded a movie lol.. I'm not completely ignorant :P
I'll try your suggestions tonight Dave. Thanks for you hard work!
Posts: 225
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
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..
Posts: 225
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.
Posts: 27300
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
Posts: 271
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 : )
Posts: 19
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
Posts: 27300
Calm down.
Posts: 58
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?
Posts: 27300
are you sure you are using G1?
Posts: 58
No I am using G2 with dreamhost.
Posts: 27300
Try in a G2 forum.
Posts: 14
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 .. .
Posts: 14
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)
Posts: 14
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.
Posts: 27300
was my last post in this thread 3 years TO THE DAY!
I doubt it. lots have chanaged in 3 years,
only if the author submits them: https://sourceforge.net/tracker/?group_id=7130&atid=307130
I did not.
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
Posts: 14
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.
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.
Posts: 27300
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
Posts: 27300
FYI this is a great tool for finding and merging different files:
http://winmerge.org/
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 5
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.
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.
Posts: 27300
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
Posts: 8339
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
Posts: 5
Where would I use that code?
Posts: 8339
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