Open zreitano opened 9 years ago
Currently it's not possible to crop video at all. You can pad video with #, but not crop. I have the same problem 2 years ago, so forked paperclip-ffmpeg and made a crop instead of pad. You can try https://github.com/attenzione/paperclip-ffmpeg for now. But i think this behaviour should be implemented in this gem, too.
Thank you! And agreed. But even # doesn't pad the video for me. And it returns the exact same video as 500x500 (without the hashtag).
Any ideas?
has_attached_file :video, path: "/posts/videos/:id/:style.:extension",
:styles => {
:square => {:geometry => "500x500#", :format => 'mp4', :streaming => true }
},
:processors => [:transcoder]
possibly this gem is not finished yet, for padding.
The geometry options are actually totally ignored in this version of the gem. You can see here that the various options are extracted but they are never passed to the output. The only thing the output sees is a sanitized geometry setting which causes the backend to resize to the requested height/width.
The video uploaded does not maintain aspect ratio. In the readme it says, " '!' - Keep the same aspect of the image/video, but with the passed dimesion."
My goal is to be able to be able to have the video returned in a square (while maintaining the aspect ratio). Cropping from the center would be ideal, as well.
Any help would be greatly appreciated. I included my code below.
Here is a link to a skewed 500x500! video of my puppy: http://s3.amazonaws.com/pivotdevelopment/posts/videos/102/square.mp4?1440617576
Here is the non-skewed version for comparison: http://s3.amazonaws.com/pivotdevelopment/posts/videos/103/square.mp4?1440617933