Wraps common video-related tasks into Dragonfly analysers and processors.
Add this line to your application's Gemfile:
gem 'dragonfly_video'And then execute:
$ bundle
Or install it yourself as:
$ gem install dragonfly_video
The gem relies on ffmpeg (and ruby implementation streamio-ffmpeg) for reading metadata and generating screenshots of video files.
On a Mac you can install ffmpeg with homebrew: brew install ffmpeg.
Add the :video plugin to your Dragonfly config block:
Dragonfly.app.configure do
  plugin :video
endReads properties of a video file:
video.video_properties
# => {
#   duration: 7.5,
#   bitrate: 481,
#   size: 455546,
#   video_stream: "h264, yuv420p, 640x480 [PAR 1:1 DAR 4:3], 371 kb/s, 16.75 fps, 15 tbr, 600 tbn, 1200 tbc",
#   video_codec: "h264",
#   colorspace: "yuv420p",
#   resolution: "640x480",
#   width: 640,
#   height: 480,
#   frame_rate: 16.72,
#   audio_stream: "aac, 44100 Hz, stereo, s16, 75 kb/s",
#   audio_codec: "aac",
#   audio_sample_rate: 44100,
#   audio_channels: 2
# }Generates a screenshot of the video's first frame:
video.screenshotRemoves audio from the video:
video.remove_audioOptimizes the video based on predefined profiles: :streaming, :archive, :mobile or :default
video.optimize- Fork it ( https://github.com/asgerb/dragonfly_video/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