ruby-av / paperclip-av-transcoder

Audio/Video Transcoder for Paperclip using FFMPEG/Avconv
MIT License
136 stars 83 forks source link

Preserve aspect ratio generates an error with AV in 0.6.4, is OK in 0.6.2 #32

Open bbozo opened 9 years ago

bbozo commented 9 years ago

This works well in 0.6.2, but in 0.6.4 it seems that for

      :image => { :geometry => "320x!", :format => 'jpg', :time => Video.screenshot_time(attachment.instance) }

the command generated by gem is

avconv -ss 12 -i "/tmp/421b47ffd946ca083b65cd668c6b17e6150903-15269-1806hcy-.mp4" -f image2 -vframes 1 -s 320x -y "/tmp/421b47ffd946ca083b65cd668c6b17e6150903-15269-1806hcy-150903-15269-1jh1vbd-.jpg"

which generates an empty file.

bbozo commented 9 years ago

Sorry, doesn't work in 0.6.2 either, it just doesn't generate an error, in 0.6.2 it generates a 320x320 image, ditching the aspect ratio

bbozo commented 9 years ago

Duplicate of #31 ?

bbozo commented 9 years ago

PS, is there a workaround for this? An older version of the gem perhaps?

attenzione commented 9 years ago

for now, workaround is to use convert_options: { output: "320x" } parameter (or whatever avconv supports) instead of :geometry

mattleonard commented 7 years ago

The above doesn't work but I was able to get it to work for ffmpeg using the following: has_attached_file :movie, :styles => {:mp4 => { :convert_options => { :output => { :vf => 'scale=640:-1' }}, :format => 'mp4' }}, :processors => [:transcoder]