video_converter 0.6.7 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,9 +14,16 @@ module VideoConverter
14
14
 
15
15
  attr_accessor :command
16
16
 
17
- def initialize command, params = {}
18
- self.command = command.gsub(/%\{(\w+?)\}/) { |m| params[$1.to_sym] }
19
- raise ArgumentError.new("Command is not parsed '#{self.command}'") if self.command.match(/%{[\w\-.]+}/)
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 = {}
@@ -1,3 +1,3 @@
1
1
  module VideoConverter
2
- VERSION = "0.6.7"
2
+ VERSION = "0.6.8"
3
3
  end
@@ -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", :bitstream_format=>"h264_mp4toannexb"},
105
- {:filename=>"q2.m3u8", :path=>"test/fixtures/test (2).mp4", :type=>"segmented", :one_pass=>true, :video_codec=>"copy", :audio_codec=>"copy", :bitstream_format=>"h264_mp4toannexb"},
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.7
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-17 00:00:00.000000000 Z
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: -687398470917858121
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: -687398470917858121
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