Fix FFmpeg MP4 video files.
Add this line to your application's Gemfile:
gem 'paperclip-av-qtfaststart'
And then execute:
$ bundle
Or install it yourself as:
$ gem install paperclip-av-qtfaststart
When FFmpeg produces mp4 files, it places the moov atom at the end which makes it unstreamable.
To fix this, use this processor to run qtfaststart after transcoding the video file using ruby-av/paperclip-av-transcoder
In your model:
class Lesson < ActiveRecord::Base
has_attached_file :video, :styles => {
:mobile => {:geometry => "400x300", :format => 'mp4', :streaming => true}
}, :processors => [:transcoder, :qtfaststart]
end
See danielgtaylor/qtfaststart for instructions on how to setup qtfaststart.
- Fork it ( https://github.com/ruby-av/paperclip-av-qtfaststart/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request