dragonfly-ffmpeg 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -66,9 +66,16 @@ module EnMasse
66
66
 
67
67
  configurable_attr :output_directory, '/tmp'
68
68
 
69
+ # Encodes a Dragonfly::TempObject with the given format.
70
+ #
71
+ # An optional profile may be specified by passing a symbol in as the optional profile parameter.
72
+ # Profiles are defined by the configurable attribute 'encoder_profiles' - by default one profile
73
+ # is defined for major web formats, :html5.
69
74
  def encode(temp_object, format, profile = :html5, options = {})
75
+ options[:meta] = {} unless options[:meta]
70
76
  format = format.to_sym
71
- original_filename = File.basename(temp_object.path, '.*')
77
+
78
+ original_basename = File.basename(temp_object.path, '.*')
72
79
 
73
80
  raise UnsupportedFormat, "Format not supported - #{format}" unless supported_format?(format)
74
81
  unless profile.is_a?(Profile)
@@ -79,15 +86,15 @@ module EnMasse
79
86
  options.merge!(profile.encoding_options)
80
87
 
81
88
  origin = ::FFMPEG::Movie.new(temp_object.path)
82
- tempfile = new_tempfile(format, original_filename)
89
+ tempfile = new_tempfile(format, original_basename)
83
90
  transcoded_file = origin.transcode(tempfile.path, options)
84
91
 
85
92
  content = ::Dragonfly::TempObject.new(File.new(transcoded_file.path))
86
93
  meta = {
87
- :name => original_filename,
94
+ :name => (original_basename + ".#{format}"),
88
95
  :format => format,
89
96
  :ext => File.extname(transcoded_file.path)
90
- }
97
+ }.merge(options[:meta])
91
98
 
92
99
  [ content, meta ]
93
100
  end
@@ -19,7 +19,7 @@
19
19
  module EnMasse
20
20
  module Dragonfly
21
21
  module FFMPEG
22
- VERSION = "0.1.2"
22
+ VERSION = "0.1.4"
23
23
  end
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,90 +1,126 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: dragonfly-ffmpeg
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.2
3
+ version: !ruby/object:Gem::Version
4
+ hash: 19
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 4
10
+ version: 0.1.4
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Jamie Winsor
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-11-09 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: dragonfly
16
- requirement: &70152818693000 !ruby/object:Gem::Requirement
17
+
18
+ date: 2011-11-14 00:00:00 -08:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
17
24
  none: false
18
- requirements:
25
+ requirements:
19
26
  - - ~>
20
- - !ruby/object:Gem::Version
21
- version: '0.9'
27
+ - !ruby/object:Gem::Version
28
+ hash: 25
29
+ segments:
30
+ - 0
31
+ - 9
32
+ version: "0.9"
22
33
  type: :runtime
34
+ name: dragonfly
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
23
37
  prerelease: false
24
- version_requirements: *70152818693000
25
- - !ruby/object:Gem::Dependency
26
- name: streamio-ffmpeg
27
- requirement: &70152818692500 !ruby/object:Gem::Requirement
38
+ requirement: &id002 !ruby/object:Gem::Requirement
28
39
  none: false
29
- requirements:
40
+ requirements:
30
41
  - - ~>
31
- - !ruby/object:Gem::Version
42
+ - !ruby/object:Gem::Version
43
+ hash: 63
44
+ segments:
45
+ - 0
46
+ - 8
47
+ - 0
32
48
  version: 0.8.0
33
49
  type: :runtime
50
+ name: streamio-ffmpeg
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
34
53
  prerelease: false
35
- version_requirements: *70152818692500
36
- - !ruby/object:Gem::Dependency
37
- name: rake
38
- requirement: &70152818692040 !ruby/object:Gem::Requirement
54
+ requirement: &id003 !ruby/object:Gem::Requirement
39
55
  none: false
40
- requirements:
56
+ requirements:
41
57
  - - ~>
42
- - !ruby/object:Gem::Version
58
+ - !ruby/object:Gem::Version
59
+ hash: 63
60
+ segments:
61
+ - 0
62
+ - 9
63
+ - 2
43
64
  version: 0.9.2
44
65
  type: :runtime
66
+ name: rake
67
+ version_requirements: *id003
68
+ - !ruby/object:Gem::Dependency
45
69
  prerelease: false
46
- version_requirements: *70152818692040
47
- - !ruby/object:Gem::Dependency
48
- name: rspec
49
- requirement: &70152818691580 !ruby/object:Gem::Requirement
70
+ requirement: &id004 !ruby/object:Gem::Requirement
50
71
  none: false
51
- requirements:
72
+ requirements:
52
73
  - - ~>
53
- - !ruby/object:Gem::Version
74
+ - !ruby/object:Gem::Version
75
+ hash: 23
76
+ segments:
77
+ - 2
78
+ - 6
79
+ - 0
54
80
  version: 2.6.0
55
81
  type: :development
82
+ name: rspec
83
+ version_requirements: *id004
84
+ - !ruby/object:Gem::Dependency
56
85
  prerelease: false
57
- version_requirements: *70152818691580
58
- - !ruby/object:Gem::Dependency
59
- name: guard-rspec
60
- requirement: &70152818691120 !ruby/object:Gem::Requirement
86
+ requirement: &id005 !ruby/object:Gem::Requirement
61
87
  none: false
62
- requirements:
88
+ requirements:
63
89
  - - ~>
64
- - !ruby/object:Gem::Version
90
+ - !ruby/object:Gem::Version
91
+ hash: 11
92
+ segments:
93
+ - 0
94
+ - 4
95
+ - 2
65
96
  version: 0.4.2
66
97
  type: :development
98
+ name: guard-rspec
99
+ version_requirements: *id005
100
+ - !ruby/object:Gem::Dependency
67
101
  prerelease: false
68
- version_requirements: *70152818691120
69
- - !ruby/object:Gem::Dependency
70
- name: fuubar
71
- requirement: &70152818690740 !ruby/object:Gem::Requirement
102
+ requirement: &id006 !ruby/object:Gem::Requirement
72
103
  none: false
73
- requirements:
74
- - - ! '>='
75
- - !ruby/object:Gem::Version
76
- version: '0'
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ hash: 3
108
+ segments:
109
+ - 0
110
+ version: "0"
77
111
  type: :development
78
- prerelease: false
79
- version_requirements: *70152818690740
80
- description: FFMPEG libraries for processesing, encoding, analysing and generating
81
- videos with Dragonfly
82
- email:
112
+ name: fuubar
113
+ version_requirements: *id006
114
+ description: FFMPEG libraries for processesing, encoding, analysing and generating videos with Dragonfly
115
+ email:
83
116
  - jamie@enmasse.com
84
117
  executables: []
118
+
85
119
  extensions: []
120
+
86
121
  extra_rdoc_files: []
87
- files:
122
+
123
+ files:
88
124
  - .gitignore
89
125
  - .rspec
90
126
  - .travis.yml
@@ -106,31 +142,41 @@ files:
106
142
  - spec/dragonfly-ffmpeg/encoder_spec.rb
107
143
  - spec/spec_helper.rb
108
144
  - spec/support/video_matchers.rb
145
+ has_rdoc: true
109
146
  homepage: https://github.com/enmasse-entertainment/dragonfly-ffmpeg
110
147
  licenses: []
148
+
111
149
  post_install_message:
112
150
  rdoc_options: []
113
- require_paths:
151
+
152
+ require_paths:
114
153
  - lib
115
- required_ruby_version: !ruby/object:Gem::Requirement
154
+ required_ruby_version: !ruby/object:Gem::Requirement
116
155
  none: false
117
- requirements:
118
- - - ! '>='
119
- - !ruby/object:Gem::Version
120
- version: '0'
121
- required_rubygems_version: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ hash: 3
160
+ segments:
161
+ - 0
162
+ version: "0"
163
+ required_rubygems_version: !ruby/object:Gem::Requirement
122
164
  none: false
123
- requirements:
124
- - - ! '>='
125
- - !ruby/object:Gem::Version
126
- version: '0'
165
+ requirements:
166
+ - - ">="
167
+ - !ruby/object:Gem::Version
168
+ hash: 3
169
+ segments:
170
+ - 0
171
+ version: "0"
127
172
  requirements: []
173
+
128
174
  rubyforge_project: dragonfly-ffmpeg
129
- rubygems_version: 1.8.11
175
+ rubygems_version: 1.6.2
130
176
  signing_key:
131
177
  specification_version: 3
132
178
  summary: A video manipulation plugin for Dragonfly
133
- test_files:
179
+ test_files:
134
180
  - spec/dragonfly-ffmpeg/analyser_spec.rb
135
181
  - spec/dragonfly-ffmpeg/encoder_spec.rb
136
182
  - spec/spec_helper.rb