Skip to content

Instantly share code, notes, and snippets.

@mlitwiniuk
Created December 4, 2011 11:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlitwiniuk/1429975 to your computer and use it in GitHub Desktop.
Save mlitwiniuk/1429975 to your computer and use it in GitHub Desktop.
CarrierWave - video encoding with Voyeur - app/uploaders/
# encoding: utf-8
class VideoUploader < CarrierWave::Uploader::Base
include CarrierWave::VideoConverter
storage :file
version :mp4 do
process :encode_video => [:mp4]
def full_filename(for_file)
"#{File.basename(for_file, File.extname(for_file))}.mp4"
end
end
version :webm do
process :encode_video => [:webm]
def full_filename(for_file)
"#{File.basename(for_file, File.extname(for_file))}.webm"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment