diff --git a/lbry/file_analysis.py b/lbry/file_analysis.py index 0a9476b65..d0e99c47c 100644 --- a/lbry/file_analysis.py +++ b/lbry/file_analysis.py @@ -37,10 +37,10 @@ class VideoFileAnalyzer: try: version, code = await self._execute(name, "-version") except Exception as e: - log.warning("Unable to run %s, but it was requested. Message: %s", name, str(e)) code = -1 - version = "" + version = str(e) if code != 0 or not version.startswith(name): + log.warning("Unable to run %s, but it was requested. Code: %d; Message: %s", name, code, version) raise FileNotFoundError(f"Unable to locate or run {name}. Please install FFmpeg " f"and ensure that it is callable via PATH or conf.ffmpeg_folder") return version diff --git a/tests/integration/other/test_transcoding.py b/tests/integration/other/test_transcoding.py index 60cad7992..08ea9fe00 100644 --- a/tests/integration/other/test_transcoding.py +++ b/tests/integration/other/test_transcoding.py @@ -93,6 +93,11 @@ class TranscodeValidation(ClaimTestCase): fixed_file = await self.analyzer.verify_or_repair(True, True, file_name) pathlib.Path(fixed_file).unlink() + async def test_max_bit_rate(self): + self.conf.video_bitrate_maximum = 100 + with self.assertRaisesRegex(Exception, "The bit rate is above the configured maximum"): + await self.analyzer.verify_or_repair(True, False, self.video_file_name) + async def test_video_format(self): file_name = self.make_name("bad_video_format_1") if not file_name.exists():