I finally got ffmpeg working to generate thumbnails, and like I owuld expect, it uses frame 1 as the thumbnail.
But for reasons too long to describe, I need to use the offset function that I know ffmpeg can use to generate the quicktime from FRAME 12 of all of my quicktimes.
I am using Gallery2, with ffmpeg. Can someone please walk me through how I change the DEFAULT action to always use frame 12 of the movie for the thumbnail.
Thanks
Posts: 8601
the thumbpage module gives you a UI to pick a time offset for the thumbnail.
if you just want to change the default behavior you can look at the code in modules/ffmpeg/classes.
Posts: 15
As far as I can tell, ffmpeg is just being controlled by gallery. So there is no user interface at all the way I am using it. So I assume gallery is sending commands to the app. But I dont know where those would be or how to change the default action.
What file in modules/ffmpeg/classes would I edit to make it happen?
Fred
Posts: 15
I have found these in the FfmpegToolKit.class file:
if (isset($context['ffmpeg.offset'])) {
array_unshift($args, '-ss', $context['ffmpeg.offset']);
unset($context['ffmpeg.offset']);
}
case 'select-offset':
// Doesn't change file; just remembers offset for future operation..
$context['ffmpeg.offset'] = $parameters[0];
if ($sourceFilename != $destFilename) {
and these in the FfMpegToolKitHelper.class file
if ($supportsOffset) {
$operations['select-offset'] = array(
'params' => array(array('type' => 'float',
'description' => $gallery->i18n('offset in seconds'))),
'description' => $gallery->i18n('Select time offset in movie file'),
'mimeTypes' => $mimeTypes,
'outputMimeType' => null);
}
But I dont know how to edit them or what the syntax is for it to work correctly. I would like Frame 12 to be the thumbnail.....
Posts: 8601
right, that's why i told you the thumbpage module gives you a UI.
(thumbnail tab on "edit movie")
or, just replace
with
to always use a fixed offset (that would be 0.2 seconds).
Posts: 15
that second bit helps alot THANK YOU! The first part confused me because my gallery in edit movie doesnt have a thumbnail tab. It only has a place in the general tab where you can specify the thumbnail size. but there doesnt seem to be any other interface for thumbnails.
but i will try the hard coded offset now, that will work great!
Thanks again
Posts: 8601
there is a module called "thumbnail page".. activate it to get a "thumbnail" tab in "edit movie"
Posts: 15
mindless,
I appreciate all of your help. I added the module, but however there is still no third tab on the edit movie page. I only have a General, and a Movie Size Tab on that page.
??
Posts: 8601
don't know what to tell you.. maybe deactivate both thumbpage and ffmpeg and then reactivate both, ffmpeg first.
http://codex.gallery2.org/index.php/Gallery2:Modules:thumbpage
Posts: 15
As it turns out, it seems my version of ffmpeg doesnt support the -ss option.
I have no idea what to try next.
Fred
Posts: 8601
ah, good catch.. can you try a version of ffmpeg that supports it?
Posts: 15
OK, First hurdle down. now there is a tab in the edit movie window.. My next need is to get it to automatically generate thumbnail from the 12 frame of the video.
Now that it is working do you think the replacement you suggested would work?
Fred
Posts: 8601
yup
Posts: 15
Ok great! Everything working. Now the real tricky part!
The code you have me to replace works! Thank you. But how would I do this.
With the offset hard coded like the example above, it always uses that offset even if the user enters a new offset manually from the interface.
I would like to leave the ability to change the thumbnail offset in gallery, but to have a default. So if none is specifified, use a 1.5 offset. But if the user specifies one, then use that one.
Can you help with that?
Thanks!
Posts: 8601
instead of replacing that block of code from above, just add this after it:
else { array_unshift($args, '-ss', '0.2'); }
now it will use the requested offset and just default to 0.2 if none is given.
Posts: 15
Worked like a dream! Thanks! Mindless, i owe you a case of beer!
Fred
Posts: 1
Thanks, works perfect.
http://www.pengeautomaten.dk
Posts: 5
in gallery2\modules\thumbpage\module.inc and gallery2\modules\core\classes\GalleryModule.class
-no if (isset($context['ffmpeg.offset'])) {
array_unshift($args, '-ss', $context['ffmpeg.offset']);
unset($context['ffmpeg.offset']);
}
Posts: 1
But for reasons too long to describe, I need to use the offset function that I know ffmpeg can use to generate the quicktime from FRAME 12 of all of my quicktimes.
discount tiffnay jewelry
I am using Gallery2, with ffmpeg. Can someone please walk me through how I change the DEFAULT action to always use frame 12 of the movie for the thumbnail.
Chanel Bags Online
Thanks
Worked like a dream! Thanks! Mindless, i owe you a case of beer!
polo t shirts