I have Rails 3.0.3 with these gems:
- delayed_job 2.1.4
- delayed_paperclip 0.7.1
- paperclip 2.3.16
- paperclip-ffmpeg 0.7.0
(This combination is very specific. Some new gems will not work with others.)
Here is my Video Model:
class Video < Upload has_attached_file :file, :default_style => :view, :processors => [:ffmpeg], :url => '/system/:class/:attachment/:id/:style/:basename.:extension', :path => ':rails_root/public/system/:class/:attachment/:id/:style' \ + '/:basename.:extension', :default_url => '/images/en/processing.png', :styles => { :mp4video => { :geometry => '520x390', :format => 'mp4', :convert_options => { :output => { :vcodec => 'libx264', :vpre => 'ipod640', :b => '250k', :bt => '50k', :acodec => 'libfaac', :ab => '56k', :ac => 2 } } }, :oggvideo => { :geometry => '520x390', :format => 'ogg', :convert_options => { :output => { :vcodec => 'libtheora', :b => '250k', :bt => '50k', :acodec => 'libvorbis', :ab => '56k', :ac => 2 } } }, :view => { :geometry => '520x390', :format => 'jpg', :time => 1 }, :preview => { :geometry => '160x120', :format => 'jpg', :time => 1 } } validates_attachment_content_type :file, :content_type => VIDEOTYPES, :if => Proc.new { |upload| upload.file.file? } process_in_background :file end
When you create a new video object with an attachment, the original file is saved, but the conversion will not be performed. Even a call to Video.last.file.reprocess! there will be nothing but returning true . (Not sure what โtruthโ means in this case, since it does not work.)
I tried hardcoding the path to ffmpeg in Paperclip::options[:command_path] . I even tried to delete the paperclip-ffmpeg.rb file and replace it with an empty file. Actually, thinking that I will get an exception by doing this later, instead, I will simply โreturnโ again.
It looks like the paperclip-ffmpeg.rb file is loading because it is required by config/application.rb , but when you try to create a thumbnail or convert the video, nothing is called.
Can anyone help me with this? Thanks in advance!