video_converter 0.6.7 → 0.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/video_converter/command.rb +10 -3
- data/lib/video_converter/version.rb +1 -1
- data/test/video_converter_test.rb +2 -2
- metadata +4 -4
| @@ -14,9 +14,16 @@ module VideoConverter | |
| 14 14 |  | 
| 15 15 | 
             
                attr_accessor :command
         | 
| 16 16 |  | 
| 17 | 
            -
                def initialize command, params | 
| 18 | 
            -
                  self.command = command. | 
| 19 | 
            -
                   | 
| 17 | 
            +
                def initialize command, *params
         | 
| 18 | 
            +
                  self.command = command.dup
         | 
| 19 | 
            +
                  if params.any?
         | 
| 20 | 
            +
                    if params[0].is_a?(Hash)
         | 
| 21 | 
            +
                      self.command.gsub!(/%\{(\w+?)\}/) { |m| params[0][$1.to_sym] }
         | 
| 22 | 
            +
                    else
         | 
| 23 | 
            +
                      self.command.gsub!('?') { params.shift }
         | 
| 24 | 
            +
                    end
         | 
| 25 | 
            +
                  end
         | 
| 26 | 
            +
                  raise ArgumentError.new("Command is not parsed '#{self.command}'") if self.command.include?('?') || self.command.match(/%{[\w\-.]+}/)
         | 
| 20 27 | 
             
                end
         | 
| 21 28 |  | 
| 22 29 | 
             
                def execute params = {}
         | 
| @@ -101,8 +101,8 @@ class VideoConverterTest < Test::Unit::TestCase | |
| 101 101 | 
             
                    (@c = VideoConverter.new(
         | 
| 102 102 | 
             
                      :input => ["test/fixtures/test (1).mp4", "test/fixtures/test (2).mp4"], 
         | 
| 103 103 | 
             
                      :output => [
         | 
| 104 | 
            -
                        {:filename=>"q1.m3u8", :path=>"test/fixtures/test (1).mp4", :type=>"segmented", :one_pass=>true, :video_codec=>"copy", :audio_codec=>"copy", : | 
| 105 | 
            -
                        {:filename=>"q2.m3u8", :path=>"test/fixtures/test (2).mp4", :type=>"segmented", :one_pass=>true, :video_codec=>"copy", :audio_codec=>"copy", : | 
| 104 | 
            +
                        {:filename=>"q1.m3u8", :path=>"test/fixtures/test (1).mp4", :type=>"segmented", :one_pass=>true, :video_codec=>"copy", :audio_codec=>"copy", 'bsf:v'=>"h264_mp4toannexb"}, 
         | 
| 105 | 
            +
                        {:filename=>"q2.m3u8", :path=>"test/fixtures/test (2).mp4", :type=>"segmented", :one_pass=>true, :video_codec=>"copy", :audio_codec=>"copy", 'bsf:v'=>"h264_mp4toannexb"}, 
         | 
| 106 106 | 
             
                        {:filename=>"playlist.m3u8", :type=>"playlist", :streams=>[
         | 
| 107 107 | 
             
                          {:path=>"q1.m3u8", :bandwidth=>464}, {:path=>"q2.m3u8", :bandwidth=>928}
         | 
| 108 108 | 
             
                        ]}
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: video_converter
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.6. | 
| 4 | 
            +
              version: 0.6.8
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2014-07- | 
| 12 | 
            +
            date: 2014-07-29 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: video_screenshoter
         | 
| @@ -140,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 140 140 | 
             
                  version: '0'
         | 
| 141 141 | 
             
                  segments:
         | 
| 142 142 | 
             
                  - 0
         | 
| 143 | 
            -
                  hash: - | 
| 143 | 
            +
                  hash: -1396491590226390857
         | 
| 144 144 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 145 145 | 
             
              none: false
         | 
| 146 146 | 
             
              requirements:
         | 
| @@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 149 149 | 
             
                  version: '0'
         | 
| 150 150 | 
             
                  segments:
         | 
| 151 151 | 
             
                  - 0
         | 
| 152 | 
            -
                  hash: - | 
| 152 | 
            +
                  hash: -1396491590226390857
         | 
| 153 153 | 
             
            requirements:
         | 
| 154 154 | 
             
            - ffmpeg, version 1.2 or greated configured with libx264 and libfaac
         | 
| 155 155 | 
             
            - live_segmenter to convert to hls
         |