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 mediaTransmuxer.config do |c|
c.notifications_host = "NOTIFICATIONS_HOST"
endTransmuxer.config do |c|
c.zencoder.api_key = "ZENCODER_API_KEY"
endTransmuxer.config do |c|
c.s3.bucket_name = "S3_BUCKET_NAME"
endclass Medium < ActiveRecord::Base
include Transmuxer::Transmuxable
transmuxable :original_url
def original_url
"PUBLICLY_ACCESSIBLE_URL"
end
endTransmuxer::Transmuxable adds several class methods for finding objects that match a given state:
.processedreturns videos that have finished processing..failedreturns 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_retrym = 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