ffmpeg-filter_graph 0.1.4 → 0.1.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa0bbf4ed676022a7b35a4aff42b66cf2a5d2988
4
- data.tar.gz: ef731984c3cebdbc6bb001459b10e9d97b846b37
3
+ metadata.gz: 3f29e693f1ef69308e2c2db2fc3ad156bf40c102
4
+ data.tar.gz: f0db3e6f30bfbe1de8b44d4432331102c1d3b74e
5
5
  SHA512:
6
- metadata.gz: 03232cd2095f7c22014b427f5427c10bfbf7ffdbc8d6d78f1cb4cfcdbb26c7daad8f39ea9c65672b4dc5e6f8ee16594ce4786dd52b0109d9ec28e786370538ea
7
- data.tar.gz: 5e44641498b622704e50f00a44cd138306b2c5282ebe9456b52bbcffe1dd3bfb1ffe532342860ef37957dfa3248bd5ae87474ab7e65236c5817487430cb393fb
6
+ metadata.gz: 1061299cbbd0075725d58e92db74d75caf0ff34c950f4ab7f5b62839d5cbb276b925e0e2373ace98dfac3035a977669f6d8bc62f2ebbbe3529f298613bf35d7e
7
+ data.tar.gz: 7cf668d20464230d26e5bd66f2367614dabde130494fc98dde319a2749a062c7add044861487bd05d68c0184d434c6dac1db25ae0bd1b70ed4b040fa331084b9
data/README.md CHANGED
@@ -7,6 +7,9 @@ In a sense, this gem is really a "string factory", as it's main output is a
7
7
  single string you can pass as the argument to `ffmpeg`'s `-filter_complex`
8
8
  command-line argument.
9
9
 
10
+ ## Requirements
11
+ - `ffmpeg` v3.0
12
+
10
13
 
11
14
  ## Wishlist
12
15
  - Track inpads and outpats, to ensure that outpads are used, and inpads exist.
@@ -12,11 +12,14 @@ require 'ffmpeg/filter_graph/filter_factory'
12
12
  require 'ffmpeg/filter_graph/chain'
13
13
  require 'ffmpeg/filter_graph/graph'
14
14
 
15
- require 'ffmpeg/filter_graph/generate_filters_audio'
16
- require 'ffmpeg/filter_graph/generate_filters_audio_sink'
17
- require 'ffmpeg/filter_graph/generate_filters_audio_src'
18
- require 'ffmpeg/filter_graph/generate_filters_multimedia'
19
- require 'ffmpeg/filter_graph/generate_filters_video'
20
- require 'ffmpeg/filter_graph/generate_filters_video_src'
15
+ # These files are responsible for creating the Filter sub-classes
16
+ require 'ffmpeg/filter_graph/generators/audio'
17
+ require 'ffmpeg/filter_graph/generators/audio_sink'
18
+ require 'ffmpeg/filter_graph/generators/audio_src'
19
+ require 'ffmpeg/filter_graph/generators/multimedia'
20
+ require 'ffmpeg/filter_graph/generators/multimedia_src'
21
+ require 'ffmpeg/filter_graph/generators/video'
22
+ require 'ffmpeg/filter_graph/generators/video_sink'
23
+ require 'ffmpeg/filter_graph/generators/video_src'
21
24
 
22
25
  require 'ffmpeg/filter_graph/version'
@@ -5,58 +5,74 @@ module FFmpeg::FilterGraph
5
5
  optional: [:level_in, :threshold, :ratio, :attack, :release, :makeup,
6
6
  :knee, :link, :detection, :mix]
7
7
  },
8
+
8
9
  ACrossFade: {
9
10
  required: [:curve1, :curve2],
10
11
  optional: [:nb_samples, :duration, :overlap]
11
12
  },
13
+
12
14
  ADelay: {
13
15
  required: [:delays]
14
16
  },
17
+
15
18
  AEcho: {
16
19
  required: [:in_gain, :out_gain, :delays, :decays]
17
20
  },
21
+
18
22
  AEmphasis: {
19
23
  required: [:level_in, :level_out, :type],
20
24
  optional: [:mode]
21
25
  },
26
+
22
27
  AEval: {
23
28
  required: [:exprs],
24
29
  optional: [:channel_layout],
25
30
  options_string: -> { [exprs, join_options(:channel_layout)].compact.join(':') }
26
31
  },
32
+
27
33
  AFade: {
28
34
  required: [:curve],
29
35
  optional: [:type, :start_sample, :nb_samples, :start_time, :duration]
30
36
  },
37
+
31
38
  AffTFilt: {
32
39
  optional: [:real, :imag, :win_size, :win_func, :overlap]
33
40
  },
41
+
34
42
  AFormat: {
35
43
  optional: [:channel_layouts, :sample_fmts, :sample_rates]
36
44
  },
45
+
37
46
  AGate: {
38
47
  optional: [:level_in, :range, :threshold, :ratio, :attack, :release,
39
48
  :makeup, :knee, :detection, :line]
40
49
  },
50
+
41
51
  ALimiter: {
42
52
  optional: [:level_in, :level_out, :limit, :attack, :release, :asc,
43
53
  :asc_level, :level]
44
54
  },
55
+
45
56
  AllPass: {
46
57
  required: [:frequency, :width_type, :width]
47
58
  },
59
+
48
60
  AMerge: {
49
61
  optional: [:inputs]
50
62
  },
63
+
51
64
  AMix: {
52
65
  optional: [:inputs, :duration, :dropout_transition]
53
66
  },
67
+
54
68
  APad: {
55
69
  optional: [:packet_size, :pad_len, :whole_len]
56
70
  },
71
+
57
72
  APhaser: {
58
73
  optional: [:in_gain, :out_gain, :delay, :decay, :speed, :type]
59
74
  },
75
+
60
76
  APulsator: {
61
77
  required: [:amount],
62
78
  optional: [:level_in, :level_out, :mode, :offset_l, :offset_r, :width,
@@ -68,16 +84,21 @@ module FFmpeg::FilterGraph
68
84
  ASetNSamples: {
69
85
  optional: [:nb_out_samples, :pad]
70
86
  },
87
+
71
88
  ASetRate: {
72
89
  optional: [:sample_rate]
73
90
  },
91
+
74
92
  AShowInfo: {},
93
+
75
94
  AStats: {
76
95
  optional: [:length, :metadata, :reset]
77
96
  },
97
+
78
98
  ASyncTs: {
79
99
  optional: [:compensate, :min_delta, :first_pts]
80
100
  },
101
+
81
102
  ATempo: {
82
103
  optional: [:tempo],
83
104
  options_string: -> { tempo }
@@ -89,87 +110,166 @@ module FFmpeg::FilterGraph
89
110
  required: [:width_type, :width],
90
111
  optional: [:frequency, :csg]
91
112
  },
113
+
92
114
  BandReject: {
93
115
  required: [:width_type, :width],
94
116
  optional: [:frequency]
95
117
  },
118
+
96
119
  Bass: {
97
120
  required: [:gain, :width_type, :width],
98
121
  optional: [:frequency]
99
122
  },
123
+
100
124
  BiQuad: {
101
125
  required: [:b0, :b1, :b2, :a0, :a1, :a2]
102
126
  },
127
+
103
128
  Bs2b: {
104
129
  required: [:profile, :fcut, :feed]
105
130
  },
131
+
106
132
  ChannelMap: {
107
133
  required: [:map],
108
134
  optional: [:channel_layout]
109
135
  },
136
+
110
137
  ChannelSplit: {
111
138
  optional: [:channel_layout]
112
139
  },
140
+
113
141
  Chorus: {
114
142
  required: [:delays, :decays, :speeds, :depths],
115
143
  optional: [:in_gain, :out_gain]
116
144
  },
117
145
 
118
- # TODO Compand
119
- # TODO CompensationDelay
120
- # TODO DcShift
121
- # TODO DynAudNorm
146
+ Compand: {
147
+ required: [:attack, :delay, :points],
148
+ optional: [:'soft-knee', :gain, :volume, :delay]
149
+ },
150
+
151
+ CompensationDelay: {
152
+ optional: [:mm, :cm, :m, :dry, :wet, :temp]
153
+ },
154
+
155
+ DcShift: {
156
+ required: [:shift],
157
+ optional: [:limitergain]
158
+ },
159
+
160
+ DynAudNorm: {
161
+ optional: [:f, :g, :p, :m, :r, :n, :c, :b, :s]
162
+ },
122
163
 
123
164
  Earwax: {},
124
165
 
125
- # TODO Equalizer
126
- # TODO ExtraStereo
127
- # TODO FirEqualizer
128
- # TODO Flanger
129
- # TODO HighPass
130
- # TODO Join
131
- # TODO Ladspa
132
- # TODO LowPass
166
+ Equalizer: {
167
+ required: [:frequency, :width_type, :width, :gain]
168
+ },
169
+
170
+ ExtraStereo: {
171
+ optional: [:m, :c]
172
+ },
173
+
174
+ FirEqualizer: {
175
+ required: [:gain_entry],
176
+ optional: [:gain, :delay, :accuracy, :wfunc, :fixed, :multi]
177
+ },
178
+
179
+ Flanger: {
180
+ optional: [:delay, :depth, :regen, :width, :speed, :shape, :phase, :interp]
181
+ },
182
+
183
+ HighPass: {
184
+ required: [:width_type],
185
+ optional: [:frequency, :poles, :width]
186
+ },
187
+
188
+ Join: {
189
+ optional: [:inputs, :channel_layout, :map]
190
+ },
191
+
192
+ Ladspa: {
193
+ required: [:file],
194
+ optional: [:plugin, :controls, :sample_rate, :nb_samples, :duration]
195
+ },
196
+
197
+ LowPass: {
198
+ required: [:width_type],
199
+ optional: [:frequency, :poles, :width]
200
+ },
133
201
 
134
202
  Pan: {
135
203
  optional: [:channel_layout, :outputs],
136
204
  options_string: -> { "#{channel_layout}| #{outputs.join(' | ')}" }
137
205
  },
206
+
138
207
  ReplayGain: {},
208
+
139
209
  Resample: {},
140
210
 
141
- # TODO RubberBand
211
+ RubberBand: {
212
+ required: [:tempo, :pitch, :transient, :detector, :phase, :window,
213
+ :smoothing, :formant, :pitchq, :channels]
214
+ },
142
215
 
143
216
  SideChainCompress: {
144
217
  optional: [:level_in, :threshold, :ratio, :attack, :release, :makeup,
145
218
  :knee, :link, :detection, :level_sc, :mix]
146
219
  },
220
+
147
221
  SideChainGate: {
148
222
  optional: [:level_in, :range, :threshold, :ratio, :attack, :release,
149
223
  :makeup, :knee, :link, :detection, :level_sc]
150
224
  },
225
+
151
226
  SilenceDetect: {
152
227
  optional: [:duration, :noise]
153
228
  },
154
229
 
155
- # TODO SilenceRemove
156
- # TODO Sofalizer
157
- # TODO StereoTools
158
- # TODO StereoWiden
230
+ SilenceRemove: {
231
+ optional: [:start_periods, :start_duration, :start_threshold,
232
+ :stop_periods, :stop_duration, :stop_threshold,
233
+ :leave_silence, :detection, :window]
234
+ },
235
+
236
+ Sofalizer: {
237
+ required: [:sofa],
238
+ optional: [:gain, :rotation, :evelation, :radius, :type, :speakers]
239
+ },
240
+
241
+ StereoTools: {
242
+ optional: [:level_in, :level_out, :balance_in, :balance_out, :softclip,
243
+ :mutel, :muter, :phasel, :phaser, :mode, :slev, :sbal, :mlev,
244
+ :mpan, :base, :delay, :sclevel, :phase]
245
+ },
246
+
247
+ StereoWiden: {
248
+ optional: [:delay, :feedback, :crossfeed, :drymix]
249
+ },
250
+
251
+
159
252
  # TODO Scale_Npp
160
253
  # TODO Select
161
- # TODO Treble
254
+
255
+ Treble: {
256
+ required: [:gain, :width_type, :width],
257
+ optional: [:frequency]
258
+ },
162
259
 
163
260
  Tremolo: {
164
261
  optional: [:f, :d]
165
262
  },
263
+
166
264
  Vibrato: {
167
265
  optional: [:f, :d]
168
266
  },
267
+
169
268
  Volume: {
170
269
  editable: true,
171
270
  optional: [:volume, :precision, :replaygain, :replaygain_preamp, :eval]
172
271
  },
272
+
173
273
  VolumeDetect: {},
174
274
  }.each do |class_name, opts|
175
275
  FilterFactory.create(class_name, opts).create_class_in(self)
@@ -1,18 +1,33 @@
1
1
  # @see https://ffmpeg.org/ffmpeg-filters.html
2
2
  module FFmpeg::FilterGraph
3
3
  {
4
- # TODO ABuffer
4
+ ABuffer: {
5
+ required: [:sample_rate, :sample_fmt, :channel_layout],
6
+ optional: [:time_base, :channels]
7
+ },
8
+
5
9
  AEvalSrc: {
6
10
  required: [:exprs],
7
11
  optional: [:sample_rate, :duration, :channel_layout, :nb_samples],
8
12
  options_string: -> { "#{exprs}:#{join_options(:duration, :sample_rate, :channel_layout, :nb_samples)}" }
9
13
  },
14
+
10
15
  ANullSrc: {
11
16
  optional: [:channel_layout, :sample_rate, :nb_samples]
12
17
  },
13
- # TODO Flite
14
- # TODO ANoiseSrc
15
- # TODO Sine
18
+
19
+ Flite: {
20
+ optional: [:list_voices, :nb_samples, :text, :textfile, :voice]
21
+ },
22
+
23
+ ANoiseSrc: {
24
+ optional: [:sample_rate, :amplitude, :duration, :color, :seed, :nb_samples]
25
+ },
26
+
27
+ Sine: {
28
+ optional: [:frequency, :beep_factor, :sample_rate, :duration,
29
+ :samples_per_frame]
30
+ },
16
31
  }.each do |class_name, opts|
17
32
  FilterFactory.create(class_name, opts).create_class_in(self)
18
33
  end
@@ -0,0 +1,16 @@
1
+ # @see https://ffmpeg.org/ffmpeg-filters.html
2
+ module FFmpeg::FilterGraph
3
+ {
4
+ AMovie: {
5
+ required: [:filename],
6
+ optional: [:format_name, :seek_point, :streams, :stream_index, :loop]
7
+ },
8
+
9
+ Movie: {
10
+ required: [:filename],
11
+ optional: [:format_name, :seek_point, :streams, :stream_index, :loop]
12
+ },
13
+ }.each do |class_name, opts|
14
+ FilterFactory.create(class_name, opts).create_class_in(self)
15
+ end
16
+ end
@@ -0,0 +1,117 @@
1
+ # @see https://ffmpeg.org/ffmpeg-filters.html
2
+ module FFmpeg::FilterGraph
3
+ {
4
+ AlphaExtract: {},
5
+
6
+ AlphaMerge: {},
7
+
8
+ Ass: {
9
+ optional: [:shaping]
10
+ },
11
+
12
+ AtaDenoise: {
13
+ optional: [:'0a', :'0b', :'1a', :'1b', :'2a', :'2b', :s]
14
+ },
15
+
16
+ Bbox: {
17
+ optional: [:min_val]
18
+ },
19
+
20
+ BlackDetect: {
21
+ optional: [:black_min_duration, :picture_black_ratio_th, :pixel_black_th]
22
+ },
23
+
24
+ BlackFrame: {
25
+ optional: [:amount, :threshold]
26
+ },
27
+
28
+ # TODO blend
29
+ # TODO tblend
30
+
31
+ BWDiF: {
32
+ optional: [:mode, :parity, :deint]
33
+ },
34
+
35
+ BoxBlur: {
36
+ optional: [:luma_radius, :luma_power, :chroma_radius, :chroma_power,
37
+ :alpha_radius, :alpha_power]
38
+ },
39
+
40
+ ChromaKey: {
41
+ required: [:color],
42
+ optional: [:similarity, :blend, :yuv]
43
+ },
44
+
45
+ CieScope: {
46
+ required: [:system, :cie, :gamuts, :intensity, :contrast],
47
+ optional: [:size, :corrgamma, :showwite, :gamma]
48
+ },
49
+
50
+ CodecView: {
51
+ optional: [:mv, :qp]
52
+ },
53
+
54
+ ColorBalance: {
55
+ optional: [:rs, :gs, :bs, :rm, :gm, :bm, :rh, :gh, :bh]
56
+ },
57
+
58
+ ColorKey: {
59
+ required: [:color],
60
+ optional: [:similarity, :blend]
61
+ },
62
+
63
+ ColorLevels: {
64
+ optional: [:rimin, :gimin, :bimin, :aimin,
65
+ :rimax, :gimax, :bimax, :aimax,
66
+ :romin, :gomin, :bomin, :aomin,
67
+ :romax, :gomax, :bomax, :aomax]
68
+ },
69
+
70
+ ColorChannelMixer: {
71
+ optional: [:rr, :rg, :rb, :ra,
72
+ :gr, :gg, :gb, :ga,
73
+ :br, :bg, :bb, :ba,
74
+ :ar, :ag, :ab, :aa]
75
+ },
76
+
77
+ ColorMatrix: {
78
+ required: [:src, :dst]
79
+ },
80
+
81
+ ColorSpace: {
82
+ optional: [:all, :space, :trc, :prm, :rng, :format, :fast, :dither,
83
+ :wpadapt]
84
+ },
85
+
86
+ Convolution: {
87
+ optional: [:'0m', :'1m', :'2m', :'3m',
88
+ :'0rdiv', :'1rdiv', :'2rdiv', :'3rdiv',
89
+ :'0bias', :'1bias', :'2bias', :'3bias']
90
+ },
91
+
92
+ Copy: {},
93
+
94
+ CoreImage: {
95
+ optional: [:list_filters, :filter, :output_rect]
96
+ },
97
+
98
+ Crop: {
99
+ required: [:out_w, :out_h],
100
+ optional: [:x, :y, :keep_aspect]
101
+ },
102
+
103
+ CropDetect: {
104
+ optional: [:limit, :round, :reset_count]
105
+ },
106
+
107
+ Curves: {
108
+ optional: [:preset, :master, :red, :green, :blue, :all, :psfile]
109
+ },
110
+
111
+ DataScope: {
112
+ required: [:size, :x, :y, :mode, :axis]
113
+ },
114
+ }.each do |class_name, opts|
115
+ FilterFactory.create(class_name, opts).create_class_in(self)
116
+ end
117
+ end
@@ -1,7 +1,11 @@
1
1
  # @see https://ffmpeg.org/ffmpeg-filters.html
2
2
  module FFmpeg::FilterGraph
3
3
  {
4
+ BufferSink: {},
5
+ NullSink: {},
4
6
  }.each do |class_name, opts|
5
7
  FilterFactory.create(class_name, opts).create_class_in(self)
6
8
  end
7
9
  end
10
+
11
+
@@ -1,5 +1,5 @@
1
1
  module Ffmpeg
2
2
  module FilterGraph
3
- VERSION = '0.1.4'
3
+ VERSION = '0.1.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffmpeg-filter_graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Sangster
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-17 00:00:00.000000000 Z
11
+ date: 2016-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -143,13 +143,14 @@ files:
143
143
  - lib/ffmpeg/filter_graph/chain.rb
144
144
  - lib/ffmpeg/filter_graph/filter.rb
145
145
  - lib/ffmpeg/filter_graph/filter_factory.rb
146
- - lib/ffmpeg/filter_graph/filters/audio.rb
147
- - lib/ffmpeg/filter_graph/generate_filters_audio.rb
148
- - lib/ffmpeg/filter_graph/generate_filters_audio_sink.rb
149
- - lib/ffmpeg/filter_graph/generate_filters_audio_src.rb
150
- - lib/ffmpeg/filter_graph/generate_filters_multimedia.rb
151
- - lib/ffmpeg/filter_graph/generate_filters_video.rb
152
- - lib/ffmpeg/filter_graph/generate_filters_video_src.rb
146
+ - lib/ffmpeg/filter_graph/generators/audio.rb
147
+ - lib/ffmpeg/filter_graph/generators/audio_sink.rb
148
+ - lib/ffmpeg/filter_graph/generators/audio_src.rb
149
+ - lib/ffmpeg/filter_graph/generators/multimedia.rb
150
+ - lib/ffmpeg/filter_graph/generators/multimedia_src.rb
151
+ - lib/ffmpeg/filter_graph/generators/video.rb
152
+ - lib/ffmpeg/filter_graph/generators/video_sink.rb
153
+ - lib/ffmpeg/filter_graph/generators/video_src.rb
153
154
  - lib/ffmpeg/filter_graph/graph.rb
154
155
  - lib/ffmpeg/filter_graph/helper.rb
155
156
  - lib/ffmpeg/filter_graph/utils/strings.rb
File without changes