Skip to content

Instantly share code, notes, and snippets.

@dt1973
Last active August 29, 2015 14:18
Show Gist options
  • Save dt1973/886b2eb2e2cc72c75983 to your computer and use it in GitHub Desktop.
Save dt1973/886b2eb2e2cc72c75983 to your computer and use it in GitHub Desktop.

Replacing paperclip-ffmpeg with paperclip-av-transcoder

Live app with instructions: http://runnable.com/VR3jBtJKSwh21EKs/paperclip-av-transcoder

Problem

LoadError in Forem::TopicsController#create
cannot load such file -- /root/rails-repo/lib/paperclip_processors/qtfaststart.rb

Extracted source (around line #274):
272   def require(file)
273     result = false
274     load_dependency(file) { result = super }
275     result
276   end
277 end

photo.rb

class Photo < ActiveRecord::Base
  belongs_to :post, :class_name => "Forem::Post"
  
  has_attached_file :attachment,
    styles: {
      medium: {
        format: "mp4",
        streaming: true,
        # processors: [:ffmpeg, :qtfaststart]
        processors: [:transcoder, :qtfaststart]
      },
      thumbnail: "70x70#"
    }

  validates_attachment :attachment, presence: true, content_type: {
    content_type: ["image/jpg", "image/jpeg", "image/png", "image/gif"]
  }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment