Configure the size of the screen shots that get generated from frames?
We are heavily using pandastream to allow user upload of videos and are currently grabbing the first screenshot frame to use as our thumbnail. Is there a way to set the dimensions of the screenshots that get generated? I would like to avoid post processing the the screenshots in order to get the correct size of the screenshot/thumbnail to fit our design (our design calls for a 'square').
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Vivien Schilis on 27 Jan, 2012 06:08 PM
Hi,
We have a new api for screenshots to do that, it's a JPEG profile.
Panda::Profile.create :preset_name => 'jpeg', :width => .. , :height => ..., frame_count => 7 )
It performs frame captures on the original video.
You can set the sizes, aspect, frame_count (number evenly spaced) or frame_interval
(ex: '2s' or '600f') or frame_offsets(ex: '2s, 10s, 250f, 400f') You can also set a custom path (path_format => 'test/:video_id/captures/:id') and other encoding options you can find in other encoding profiles
encodings returns an array of files matching the extname of your profile.
=> [12345_1.jpg, 12345_2.jpg, ...]
set the frame_count to 0 to other profiles to not perform any screenshots
Best,
Vivien
3 Posted by pivotal-halogen on 27 Jan, 2012 06:26 PM
Is this in the panda 1.5.0 gem and is this something we would stick inside one of our initializers, or pass through our delegator? We have a delegator inside our model that does:
=> delegate :screenshots, :encodings, :height, :width, :to => :panda_video, :allow_nil => true
Is there documentation on what the jpeg options will do? Ideally we would want to have the same options as Paperclip using their built in Geometry to do 180x180# to force a size of 180 x 180 and cropping out the rest. (not sure if panda screenshots are paperclip under the hood)
Vivien Schilis closed this discussion on 09 Feb, 2012 05:00 PM.
Jonas Pfenniger re-opened this discussion on 08 Mar, 2012 01:34 PM
Support Staff 4 Posted by Jonas Pfenniger on 08 Mar, 2012 01:34 PM
Hi,
sorry your message went into Tender's spam box and I didn't see it before today.
The profile works like a usual profile. You set it up with the API and it will generate the screenshot resolution that you have set when a new video is uploaded. Under the hood, it's using ffmpeg to get and filter the images. You can also change the aspect_mode variable to crop.
Hope it's not too late.
Regards,
Jonas
Vivien Schilis closed this discussion on 11 Apr, 2012 02:13 PM.