Skip to content

Commit

Permalink
Merge pull request #111 from samvera-labs/ffmpeg_errors
Browse files Browse the repository at this point in the history
Improve error handling for ffmpeg adapter
  • Loading branch information
cjcolvar authored Aug 30, 2022
2 parents dc4b82c + 8820e60 commit d4474f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/active_encode/engine_adapters/ffmpeg_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def find(id, opts = {})
elsif cancelled? encode.id
encode.state = :cancelled
elsif encode.percent_complete < 100
encode.errors << "Encoding has completed but the output duration is shorter than the input"
encode.errors.prepend("Encoding has completed but the output duration is shorter than the input")
encode.state = :failed
end

Expand Down Expand Up @@ -170,7 +170,7 @@ def read_errors(id)
err_path = working_path("error.log", id)
error = File.read(err_path) if File.file? err_path
if error.present?
[error]
["Error encountered during encoding. Check ffmpeg log for more details.", error]
else
[]
end
Expand Down Expand Up @@ -227,7 +227,7 @@ def ffmpeg_command(input_url, id, opts)
"#{k}: #{v}\r\n"
end.join
header_opt = "-headers '#{header_opt}'" if header_opt.present?
"#{FFMPEG_PATH} #{header_opt} -y -loglevel error -progress #{working_path('progress', id)} -i \"#{input_url}\" #{output_opt}"
"#{FFMPEG_PATH} #{header_opt} -y -loglevel level+fatal -progress #{working_path('progress', id)} -i \"#{input_url}\" #{output_opt}"
end

def sanitize_base(input_url)
Expand Down

0 comments on commit d4474f4

Please sign in to comment.