A library for converting videos into HLS format.
Add this line to your application's Gemfile:
gem 'transmuxer'
And then execute:
$ bundle
Or install it yourself as:
$ gem install transmuxer
To set up transmuxing for Medium model, run the following:
rails generate transmuxer media
Transmuxer.config do |c|
c.notifications_host = "NOTIFICATIONS_HOST"
end
Transmuxer.config do |c|
c.zencoder.api_key = "ZENCODER_API_KEY"
end
Transmuxer.config do |c|
c.s3.bucket_name = "S3_BUCKET_NAME"
end
class Medium < ActiveRecord::Base
include Transmuxer::Transmuxable
transmuxable :original_url
def original_url
"PUBLICLY_ACCESSIBLE_URL"
end
end
Transmuxer::Transmuxable
adds several class methods for finding objects that match a given state:
.processed
returns videos that have finished processing..failed
returns videos that failed processing.
m = Medium.first
m.transmux
you can pass { audio: true }
to transmux
if you only want to transcode to mp3
m = Medium.first
m.transmux_retry
m = Medium.first
m.transmux_progress
- Fork it ( https://github.com/[my-github-username]/transmuxer/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