Blog

CarrierWave. Basic video conversion. A step-by-step tutorial

The implementation of CarrierWave with Voyeur gem is pretty outdated at the moment, so I thought I could share something more up to date

Months ago we wrote about video conversion with CarrierWave. The time has come to offer you a short update on that.

This time I have used streamio-ffmpeg. However, this may not work with the latest ffmpeg builds. ffmpeg itself is required and needs to be installed manually, for example with homebrew on OSX. I have used the following code with ffmpeg version 2.4.4.

CarrierWave tutorial step-by-step

Add to your gemfile:

gem 'streamio-ffmpeg'

Custom processor will look like this (lib/carrierwave_processing/):

and your CarrierWave uploader will be something like:

You also need an initializer that will load your custom processor (config/initializers/carrierwave_processors.rb)

If you also need to use different formats of the uploaded file in views you need to add some code to the uploader mounted in your model. In my case, I have a post model.

And now you are ready to convert some media files ;)

This is the first part of bigger series about CarrierWave and video conversion. Stay tuned for more!

Sample app, that illustrates this blog post can be found here: prograils/video-converter-test

Photo by: startupstockphotos.com

Check our latest product - it's based on our experience of managing over 50-people strong company. The tool we're missing as a small company and not an enterprise.

humadroid.io is an employee and performance management software. It's an unique tool allowing everyone to be in the loop - by having up to date info about co-workers, time-off, benefits, assets, helping with one-on-ones, being a go-to place for company-wide announcements.

Check out humadroid.io
Top

Contact us

* Required fields

The controller of your personal data provided via this contact form is Prograils sp. z o.o., with a registered seat at Sczanieckiej 9A/10, 60-215 PoznaƄ. Your personal data will be processed in order to respond to your inquiries and for our marketing purposes (e.g. when you ask us for our post-development, maintenance or ad hoc engagements for your app). You have the rights to: access your personal data, rectify or erase your personal data, restrict the processing of your personal data, data portability and to object to the processing of your personal data. Learn more.

Notice

We do not track you online. We use only session cookies and anonymous identifiers for the purposes specified in the cookie policy. No third-party trackers.

I understand
Elo Mordo!Elo Mordo!