viddl 0.0.8 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/viddl.rb +1 -1
- data/lib/viddl/video/clip.rb +9 -2
- data/lib/viddl/video/instance.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8036485a4484ac0bcf98502b2ff6044c7fa77c9
|
4
|
+
data.tar.gz: 51caad29c7c23014c75e6efb511f127d97f432e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b1a42f32432edb76dc663a9564f0d2ca5fb49e5c257fa5377a97f1696df181e855e1785817061c08eeab4b52e7edaf126d1b1517552bafe3ec4149824ee37f6
|
7
|
+
data.tar.gz: c1db4ed9ecb5ce81287a921a9a1f3779a6ab5e105e6039e59c70461c119e9bc702d2184ea8bb4846caf856c9aea7f08af41813f7e8044d9d2751dc697e2d689d
|
data/lib/viddl.rb
CHANGED
data/lib/viddl/video/clip.rb
CHANGED
@@ -17,6 +17,7 @@ module Viddl
|
|
17
17
|
# @param [String] source_path Path to video file to create clip from
|
18
18
|
# @param [Hash] options
|
19
19
|
# @option options [Boolean] :audio Whether to include audio
|
20
|
+
# @option options [String] :flags Flags to pass to ffmpeg
|
20
21
|
# @option options [Numeric] :start Time in the source file where the clip starts
|
21
22
|
# @option options [Numeric] :duration Duration of the clip
|
22
23
|
# @option options [Numeric] :end Time in the source file where the clip ends
|
@@ -39,6 +40,7 @@ module Viddl
|
|
39
40
|
# Create a clip using the given options
|
40
41
|
# @param [Hash] options
|
41
42
|
# @option options [Boolean] :audio Whether to include audio
|
43
|
+
# @option options [String] :flags Flags to pass to ffmpeg
|
42
44
|
# @option options [Numeric] :start Time in the source file where the clip starts
|
43
45
|
# @option options [Numeric] :duration Duration of the clip
|
44
46
|
# @option options [Numeric] :end Time in the source file where the clip ends
|
@@ -65,6 +67,7 @@ module Viddl
|
|
65
67
|
# Command line to create a clip from the source file and given options
|
66
68
|
# @param [Hash] options
|
67
69
|
# @option options [Boolean] :audio Whether to include audio
|
70
|
+
# @option options [String] :flags Flags to pass to ffmpeg
|
68
71
|
# @option options [Numeric] :start Time in the source file where the clip starts
|
69
72
|
# @option options [Numeric] :duration Duration of the clip
|
70
73
|
# @option options [Numeric] :end Time in the source file where the clip ends
|
@@ -94,13 +97,14 @@ module Viddl
|
|
94
97
|
end
|
95
98
|
|
96
99
|
populate_output_path(formatted_opts)
|
97
|
-
"ffmpeg -i #{@source_path} #{module_arg_string} #{@path.to_s}"
|
100
|
+
"ffmpeg -i #{@source_path} #{module_arg_string} #{options[:flags]} #{@path.to_s}"
|
98
101
|
end
|
99
102
|
end
|
100
103
|
|
101
104
|
# Options formatted for ffmpeg
|
102
105
|
# @param [Hash] options
|
103
106
|
# @option options [Boolean] :audio Whether to include audio (default: true)
|
107
|
+
# @option options [String] :flags Flags to pass to ffmpeg
|
104
108
|
# @option options [Numeric] :start Time in the source file where the clip starts
|
105
109
|
# @option options [Numeric] :duration Duration of the clip
|
106
110
|
# @option options [Numeric] :end Time in the source file where the clip ends
|
@@ -112,13 +116,16 @@ module Viddl
|
|
112
116
|
options.delete_if { |k, v| v.nil? }
|
113
117
|
mod_options = MODULES.map { |mod| mod.options_formatted(options) }
|
114
118
|
formatted_options = mod_options.inject(:merge)
|
115
|
-
|
119
|
+
[:flags, :output_path].each do |option|
|
120
|
+
formatted_options[option] = options[option] unless options[option].nil?
|
121
|
+
end
|
116
122
|
formatted_options
|
117
123
|
end
|
118
124
|
|
119
125
|
# Set the clip path
|
120
126
|
# @param [Hash] options
|
121
127
|
# @option options [Boolean] :audio Whether to include audio
|
128
|
+
# @option options [String] :flags Flags to pass to ffmpeg
|
122
129
|
# @option options [Numeric] :start Time in the source file where the clip starts
|
123
130
|
# @option options [Numeric] :duration Duration of the clip
|
124
131
|
# @option options [Integer, String] :width The desired width to resize to
|
data/lib/viddl/video/instance.rb
CHANGED
@@ -21,6 +21,7 @@ module Viddl
|
|
21
21
|
# Cut the video source using the given options
|
22
22
|
# @param [Hash] options
|
23
23
|
# @option options [Boolean] :audio Whether to include audio
|
24
|
+
# @option options [String] :flags Flags to pass to ffmpeg
|
24
25
|
# @option options [Numeric] :start Time in the source file where the clip starts
|
25
26
|
# @option options [Numeric] :duration Duration of the clip
|
26
27
|
# @option options [Numeric] :end Time in the source file where the clip ends
|