streamio-ffmpeg 0.7.5 → 0.7.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/lib/ffmpeg/transcoder.rb +8 -1
- data/lib/ffmpeg/version.rb +1 -1
- metadata +2 -2
data/CHANGELOG
CHANGED
data/lib/ffmpeg/transcoder.rb
CHANGED
@@ -27,6 +27,7 @@ module FFMPEG
|
|
27
27
|
last_output = nil
|
28
28
|
Open3.popen3(command) do |stdin, stdout, stderr|
|
29
29
|
stderr.each("r") do |line|
|
30
|
+
fix_encoding(line)
|
30
31
|
output << line
|
31
32
|
if line =~ /time=(\d+.\d+)/
|
32
33
|
time = $1.to_f
|
@@ -41,8 +42,8 @@ module FFMPEG
|
|
41
42
|
end
|
42
43
|
|
43
44
|
if encoding_succeeded?
|
44
|
-
FFMPEG.logger.info "Transcoding of #{@movie.path} to #{@output_file} succeeded\n"
|
45
45
|
yield(1.0) if block_given?
|
46
|
+
FFMPEG.logger.info "Transcoding of #{@movie.path} to #{@output_file} succeeded\n"
|
46
47
|
else
|
47
48
|
errors = @errors.empty? ? "" : " Errors: #{@errors.join(", ")}. "
|
48
49
|
FFMPEG.logger.error "Failed encoding...\n#{command}\n\n#{output}\n#{errors}\n"
|
@@ -102,5 +103,11 @@ module FFMPEG
|
|
102
103
|
return false if @raw_options.is_a?(String)
|
103
104
|
true
|
104
105
|
end
|
106
|
+
|
107
|
+
def fix_encoding(output)
|
108
|
+
output[/test/]
|
109
|
+
rescue ArgumentError
|
110
|
+
output.force_encoding("ISO-8859-1")
|
111
|
+
end
|
105
112
|
end
|
106
113
|
end
|
data/lib/ffmpeg/version.rb
CHANGED