av 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/av/commands/base.rb +11 -5
- data/lib/av/version.rb +1 -1
- data/spec/av/av_spec.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3a866330bd9c784df99f3235220e5184973215f
|
4
|
+
data.tar.gz: 671c46357af67d353a607948e6bdc03beefb2962
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5aa51d99ae99ae7aeb65287030b91a30eb16665ae8f582b2625e6816771c09d166129c854a99877db4aff1882d8620699ef6f1e3f3ca9022d552dbb27678ba8e
|
7
|
+
data.tar.gz: b4b7714fd9163a4178116e04ba38e693dcae73de65132a38cc9ecbe512ab2bcc9f2257e2ac1cc6190ba318680020599b9cec98ce855f10c0f048d1d00d651129
|
data/lib/av/commands/base.rb
CHANGED
@@ -8,6 +8,7 @@ module Av
|
|
8
8
|
attr_accessor :command_name
|
9
9
|
attr_accessor :input_params
|
10
10
|
attr_accessor :output_params
|
11
|
+
attr_accessor :output_format
|
11
12
|
attr_accessor :audio_filters
|
12
13
|
attr_accessor :video_filters
|
13
14
|
attr_accessor :default_params
|
@@ -27,6 +28,10 @@ module Av
|
|
27
28
|
end
|
28
29
|
|
29
30
|
def add_destination dest
|
31
|
+
# infer format from extension unless format has already been set
|
32
|
+
if @output_format.nil?
|
33
|
+
output_format File.extname(dest)
|
34
|
+
end
|
30
35
|
@destination = dest
|
31
36
|
end
|
32
37
|
|
@@ -114,19 +119,20 @@ module Av
|
|
114
119
|
end
|
115
120
|
|
116
121
|
def output_format format
|
117
|
-
|
118
|
-
|
122
|
+
@output_format = format
|
123
|
+
case format.to_sym
|
124
|
+
when :jpg, :jpeg, :png, :gif # Images
|
119
125
|
add_output_param 'f', 'image2'
|
120
126
|
add_output_param 'vframes', '1'
|
121
|
-
when
|
127
|
+
when :webm # WebM
|
122
128
|
add_output_param 'f', 'webm'
|
123
129
|
add_output_param 'acodec', 'libvorbis'
|
124
130
|
add_output_param 'vcodec', 'libvpx'
|
125
|
-
when
|
131
|
+
when :ogv # Ogg Theora
|
126
132
|
add_output_param 'f', 'ogg'
|
127
133
|
add_output_param 'acodec', 'libvorbis'
|
128
134
|
add_output_param 'vcodec', 'libtheora'
|
129
|
-
when
|
135
|
+
when :mp4
|
130
136
|
add_output_param 'acodec', 'aac'
|
131
137
|
add_output_param 'strict', 'experimental'
|
132
138
|
end
|
data/lib/av/version.rb
CHANGED
data/spec/av/av_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: av
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Omar Abdel-Wahab
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|