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:
parent
04d31d300f
commit
52fadaf4a6
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user