active_encode 2.0.0 → 2.0.2

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
  SHA256:
3
- metadata.gz: 4f90e9c3cedb039d22d5576047ff97f27007e1ab0a4a42be49a8af6332152237
4
- data.tar.gz: cd525b293617c059017568d2bd9d70817213f4b81e9331cf08b330412c8f35c7
3
+ metadata.gz: 8e79b7e04c4ce64bd75701672631d45b7c7c7a340361295bfc007be2f28aa293
4
+ data.tar.gz: e5cd432ef6102257eff4d257906961ed1513e81f58520bdc6c6d4f07293d5a5a
5
5
  SHA512:
6
- metadata.gz: 7cdfba6f2f6f5712ecb9c54f8f7fd61c679559ca07930c43430cc26a85d96e7469d6b1d33061922dc05abf2a287b92676a7c4cf9bc66f4216607cafdc7fa86b3
7
- data.tar.gz: 9c7ce5b39d81c746eda7bf54e023c6893300aa6a5bd4743f5afefe430189e62cd7419ff065d86bd3be4368b44bf4005ba18241472d1374f74744700905272ed5
6
+ metadata.gz: 7126ae7b947b53233cd05f2202fb155a327144e8f611c81640b90611c0c600358e66374908820e7f6df35cb4d0837f8e2487d883b6151b9c3009526e330c7cc5
7
+ data.tar.gz: 73369f2a8423a4bcc5d346af76f7da2d8c3ca290da5f229218c137fdeb6e6155e1a4db4ade5e947bf78e3a3ef8cc8b35e2941b53767a52d3ecaac8e35211619d
data/.circleci/config.yml CHANGED
@@ -17,6 +17,7 @@ jobs:
17
17
  executor:
18
18
  name: 'samvera/ruby'
19
19
  ruby_version: << parameters.ruby_version >>
20
+ resource_class: large
20
21
  environment:
21
22
  ENGINE_CART_RAILS_OPTIONS: --skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-coffee --skip-puma --skip-test
22
23
  RAILS_VERSION: << parameters.rails_version >>
@@ -37,12 +38,13 @@ jobs:
37
38
  keys:
38
39
  - v1-ffmpeg-<< parameters.ffmpeg_version >>
39
40
 
40
- - run: curl https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-<< parameters.ffmpeg_version >>-amd64-static.tar.xz | tar xJ -C /tmp/ --strip-components=1
41
+ - run: if [ ! -f /tmp/ffmpeg ]; then curl https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-<< parameters.ffmpeg_version >>-amd64-static.tar.xz | tar xJ -C /tmp/ --strip-components=1; fi
41
42
 
42
43
  - save_cache:
43
44
  key: v1-ffmpeg-<< parameters.ffmpeg_version >>`
44
45
  paths:
45
46
  - /tmp/ffmpeg
47
+ - /tmp/ffprobe
46
48
 
47
49
  - samvera/cached_checkout
48
50
 
@@ -74,39 +76,27 @@ jobs:
74
76
  workflows:
75
77
  ci:
76
78
  jobs:
79
+ - bundle_and_test:
80
+ name: "ruby4-0_rails8-1"
81
+ ruby_version: "4.0.2"
82
+ rails_version: "8.1.3"
83
+ - bundle_and_test:
84
+ name: "ruby4-0_rails8-0"
85
+ ruby_version: "4.0.2"
86
+ rails_version: "8.0.5"
77
87
  - bundle_and_test:
78
88
  name: "ruby3-4_rails8-0"
79
- ruby_version: "3.4.1"
80
- rails_version: "8.0.1"
89
+ ruby_version: "3.4.9"
90
+ rails_version: "8.0.5"
81
91
  - bundle_and_test:
82
92
  name: "ruby3-4_rails7-2"
83
- ruby_version: "3.4.1"
84
- rails_version: "7.2.2.1"
85
- - bundle_and_test:
86
- name: "ruby3-4_rails7-1"
87
- ruby_version: "3.4.1"
88
- rails_version: "7.1.5.1"
93
+ ruby_version: "3.4.9"
94
+ rails_version: "7.2.3.1"
89
95
  - bundle_and_test:
90
96
  name: "ruby3-3_rails8-0"
91
- ruby_version: "3.3.7"
92
- rails_version: "8.0.1"
97
+ ruby_version: "3.3.11"
98
+ rails_version: "8.0.5"
93
99
  - bundle_and_test:
94
100
  name: "ruby3-3_rails7-2"
95
- ruby_version: "3.3.7"
96
- rails_version: "7.2.2.1"
97
- - bundle_and_test:
98
- name: "ruby3-3_rails7-1"
99
- ruby_version: "3.3.7"
100
- rails_version: "7.1.5.1"
101
- - bundle_and_test:
102
- name: "ruby3-2_rails8-0"
103
- ruby_version: "3.2.7"
104
- rails_version: "8.0.1"
105
- - bundle_and_test:
106
- name: "ruby3-2_rails7-2"
107
- ruby_version: "3.2.7"
108
- rails_version: "7.2.2.1"
109
- - bundle_and_test:
110
- name: "ruby3-2_rails7-1"
111
- ruby_version: "3.2.7"
112
- rails_version: "7.1.5.1"
101
+ ruby_version: "3.3.11"
102
+ rails_version: "7.2.3.1"
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency "aws-sdk-elastictranscoder"
31
31
  spec.add_development_dependency "aws-sdk-mediaconvert", ">= 1.157.0"
32
32
  spec.add_development_dependency "aws-sdk-s3"
33
+ spec.add_development_dependency "benchmark" # Needed for bixby/rubocop with ruby 4+
33
34
  spec.add_development_dependency "bixby", '~> 5.0', '>= 5.0.2'
34
35
  spec.add_development_dependency "bundler"
35
36
  spec.add_development_dependency "coveralls"
@@ -201,7 +201,7 @@ module ActiveEncode
201
201
  end
202
202
 
203
203
  def write_errors(encode)
204
- File.write(working_path("error.log", encode.id), encode.errors.join("\n"))
204
+ File.write(working_path("error.log", encode.id), encode.errors.join("\n"), mode: 'a')
205
205
  File.write(working_path("exit_status.code", encode.id), "1") unless File.exist?(working_path("exit_status.code", encode.id))
206
206
  end
207
207
 
@@ -290,7 +290,7 @@ module ActiveEncode
290
290
  "#{k}: #{v}\r\n"
291
291
  end.join
292
292
  header_opt = "-headers '#{header_opt}'" if header_opt.present?
293
- "#{FFMPEG_PATH} #{header_opt} -y -loglevel level+fatal -progress #{working_path('progress', id)} -i \"#{input_url}\" #{supplemental_file_opt} #{output_opt}"
293
+ "#{FFMPEG_PATH} #{header_opt} -y -loglevel level+error -progress #{working_path('progress', id)} -i \"#{input_url}\" -max_muxing_queue_size 1024 #{supplemental_file_opt} #{output_opt}"
294
294
  end
295
295
 
296
296
  def caption_extraction_options(filename, count, id)
@@ -519,6 +519,8 @@ module ActiveEncode
519
519
  # NOTE: certain audio files don't return any track information
520
520
  @probe_cache ||= {}
521
521
  @probe_cache[url] ||= mediaconvert.probe({ input_files: [{ file_url: url }] })&.probe_results&.first
522
+ rescue Aws::MediaConvert::Errors::ServiceError
523
+ nil
522
524
  end
523
525
 
524
526
  def output_id_format
@@ -74,7 +74,7 @@ module ActiveEncode
74
74
 
75
75
  # Copy derivatives to work directory
76
76
  options[:outputs].each do |opt|
77
- output_path = copy_derivative_to_working_path(opt[:url], new_encode.id)
77
+ output_path = copy_derivative_to_working_path(opt[:url], opt[:label], new_encode.id)
78
78
  filename_label_hash[output_path] = opt[:label]
79
79
  end
80
80
 
@@ -286,8 +286,9 @@ module ActiveEncode
286
286
  ActiveEncode.sanitize_input(input_url)
287
287
  end
288
288
 
289
- def copy_derivative_to_working_path(url, id)
290
- output_path = working_path("outputs/#{ActiveEncode.sanitize_base url}#{File.extname url}", id)
289
+ def copy_derivative_to_working_path(url, label, id)
290
+ label_url = add_label_to_url(ActiveEncode.sanitize_base(url), label)
291
+ output_path = working_path("outputs/#{label_url}#{File.extname url}", id)
291
292
  if url.start_with? "s3://"
292
293
  # Use aws-sdk-s3 download_file method
293
294
  # Single request mode needed for compatibility with minio
@@ -297,6 +298,12 @@ module ActiveEncode
297
298
  end
298
299
  output_path
299
300
  end
301
+
302
+ def add_label_to_url(url, label)
303
+ return url if url.match?(/\-#{label}$/)
304
+
305
+ url.gsub(/#{label}$/, '') + "-#{label}"
306
+ end
300
307
  end
301
308
  end
302
309
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveEncode
3
- VERSION = '2.0.0'
3
+ VERSION = '2.0.2'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_encode
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Klein, Chris Colvard, Phuong Dinh
@@ -135,6 +135,20 @@ dependencies:
135
135
  - - ">="
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
+ - !ruby/object:Gem::Dependency
139
+ name: benchmark
140
+ requirement: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ type: :development
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
138
152
  - !ruby/object:Gem::Dependency
139
153
  name: bixby
140
154
  requirement: !ruby/object:Gem::Requirement