Skip to content

Commit b7b0099

Browse files
committed
support http inputs for interim files
1 parent 61cfd98 commit b7b0099

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/ffmpeg/transcoder.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
require 'shellwords'
33
require 'fileutils'
44
require 'securerandom'
5+
require 'digest'
56

67
FIXED_LOWER_TO_UPPER_RATIO = 16.0/9.0
78
FIXED_UPPER_TO_LOWER_RATIO = 9.0/16.0
@@ -38,7 +39,11 @@ def initialize(movie, output_file, options = EncodingOptions.new, transcoder_opt
3839
@movie.paths.each do |path|
3940
# Make the interim path folder if it doesn't exist
4041

41-
dirname = "#{TEMP_DIR}/interim#{File.dirname(path)}/"
42+
if path.start_with?("http")
43+
dirname = "#{TEMP_DIR}/interim/#{SecureRandom.urlsafe_base64}/"
44+
else
45+
dirname = "#{TEMP_DIR}/interim#{File.dirname(path)}/"
46+
end
4247
unless File.directory?(dirname)
4348
FileUtils.mkdir_p(dirname)
4449
end

0 commit comments

Comments
 (0)