Skip to content

Commit 00b8a95

Browse files
committed
Minor fixes
1 parent c1243f2 commit 00b8a95

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

README.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
# Paperclip::Av::Transcoder
1+
# Paperclip Transcoder
2+
3+
Audio/Video Transcoder for Paperclip using FFMPEG/Avconv.
4+
5+
This is a replacement for ( https://github.com/owahab/paperclip-ffmpeg ).
6+
7+
## Status
8+
9+
[![Build Status](https://travis-ci.org/ruby-av/paperclip-av-transcoder.svg?branch=master)](https://travis-ci.org/ruby-av/paperclip-av-transcoder)
10+
[![Coverage Status](https://coveralls.io/repos/ruby-av/paperclip-av-transcoder/badge.png?branch=master)](https://coveralls.io/r/ruby-av/paperclip-av-transcoder?branch=master)
11+
[![Code Climate](https://codeclimate.com/github/ruby-av/paperclip-av-transcoder/badges/gpa.svg)](https://codeclimate.com/github/ruby-av/paperclip-av-transcoder)
212

3-
TODO: Write a gem description
413

514
## Installation
615

@@ -18,11 +27,26 @@ Or install it yourself as:
1827

1928
## Usage
2029

21-
TODO: Write usage instructions here
30+
In your model:
31+
32+
# app/models/user.rb
33+
class User < ActiveRecord::Base
34+
has_attached_file :avatar, :styles => {
35+
:medium => { :geometry => "640x480", :format => 'flv' },
36+
:thumb => { :geometry => "100x100#", :format => 'jpg', :time => 10 }
37+
}, :processors => [:ffmpeg]
38+
end
39+
40+
This will produce:
41+
42+
1. A transcoded `:medium` FLV file with the requested dimensions if they will match the aspect ratio of the original file, otherwise, width will be maintained and height will be recalculated to keep the original aspect ration.
43+
2. A screenshot `:thumb` with the requested dimensions regardless of the aspect ratio.
44+
45+
You may optionally add `<attachment>_meta` to your model and it will get populated with information about the processed video.
2246

2347
## Contributing
2448

25-
1. Fork it ( https://github.com/[my-github-username]/paperclip-av-transcoder/fork )
49+
1. Fork it ( https://github.com/ruby-av/paperclip-av-transcoder/fork )
2650
2. Create your feature branch (`git checkout -b my-new-feature`)
2751
3. Commit your changes (`git commit -am 'Add some feature'`)
2852
4. Push to the branch (`git push origin my-new-feature`)

spec/spec_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
ENV["RAILS_ENV"] = "test"
2+
require 'coveralls'
3+
Coveralls.wear!
4+
15
require 'rubygems'
26
require 'rspec'
37
require 'bundler/setup'

0 commit comments

Comments
 (0)