No commit activity in last 3 years
No release in over 3 years
Generates a various versions for carrierwave uploaded videos, versions can be generated giving options for quality, resolution, format, etc.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.14.6, ~> 1.14
~> 12.0
~> 3.5

Runtime

>= 3.0.2, ~> 3.0
 Project Readme

Installation

Add this line to your application's Gemfile:

gem 'carrierwave_streamio_ffmpeg'

And then execute:

$ bundle

Or install it yourself as:

$ gem install carrierwave_streamio_ffmpeg

Usage

In the Rails app/uploaders/filename.rb, call the encode function with options. Example :

class VideoUploader < CarrierWave::Uploader::Base
  include CarrierWave::Video
  include CarrierwaveStreamioFfmpeg

  storage :file

  def store_dir
    "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
  end
   
  version :mp4 do
    version :p480 do
      process encode: [{format: :mp4, resolution: :p480, quality: :med, preserve_aspect_ratio: :width}]
    end

    def full_filename(for_file)
      super.chomp(File.extname(super)) + '.mp4'
    end
  end
end

The options are passed as hash to this function, can be also empty.

The options are:

  • format - format of the output video, possible options are mp4, webm and ogv
  • resolution - resolution if output file, possible values are p240, p360, p480, p720, p1080 and p2160
  • quality - Quality of the file to be saved, possible values are very_low, low, med, high and very_high.
  • preserve_aspect_ratio - value to be preserved when correcting aspect ration, possible values :width and :height.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ssooraj/carrierwave_streamio_ffmpeg. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.