From 52fadaf4a685ed62f4a79c0b5b8053d45073f683 Mon Sep 17 00:00:00 2001 From: Calvin Walton Date: Thu, 24 Jan 2019 14:56:48 -0500 Subject: [PATCH] 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. --- record-and-playback/core/lib/recordandplayback/edl/video.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/record-and-playback/core/lib/recordandplayback/edl/video.rb b/record-and-playback/core/lib/recordandplayback/edl/video.rb index 57989c3b64..269be99a6a 100644 --- a/record-and-playback/core/lib/recordandplayback/edl/video.rb +++ b/record-and-playback/core/lib/recordandplayback/edl/video.rb @@ -287,6 +287,9 @@ module BigBlueButton info[:width] = info[:video][:width].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 info[:sample_aspect_ratio] = Rational(1, 1)