Add a check to reject undecodable video streams.

In some cases, ffmpeg will be able to read the file, but the video itself
can't be decoded (missing/corrupt stream headers, for example). In this case,
some of the properties on the stream object will be nil.
Make sure that pix_fmt is present in the probed info, since that's a required
property.
This commit is contained in:
Calvin Walton 2019-01-24 14:56:48 -05:00
parent 04d31d300f
commit 52fadaf4a6

View File

@ -287,6 +287,9 @@ module BigBlueButton
info[:width] = info[:video][:width].to_i info[:width] = info[:video][:width].to_i
info[:height] = info[:video][:height].to_i info[:height] = info[:video][:height].to_i
# Check for corrupt/undecodable video streams
return {} if info[:video][:pix_fmt].nil?
return {} if info[:width] == 0 or info[:height] == 0 return {} if info[:width] == 0 or info[:height] == 0
info[:sample_aspect_ratio] = Rational(1, 1) info[:sample_aspect_ratio] = Rational(1, 1)