Fix: make ffmpeg log less verbose
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Fri, 7 Mar 2025 08:42:02 +0000 (09:42 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Fri, 7 Mar 2025 08:42:02 +0000 (09:42 +0100)
music_assistant/helpers/ffmpeg.py

index bafa8e728da086319a599f5f890e74dd128da7e7..ea27ff9e596f072d4e273af71c7ab01142cf5137 100644 (file)
@@ -106,10 +106,14 @@ class FFMpeg(AsyncProcess):
             if self.collect_log_history:
                 self.log_history.append(line)
             if "error" in line or "warning" in line:
-                self.logger.warning(line)
+                # ffmpeg logs can be a bit verbose and noisy so we tone them down a bit
+                # otherwise users get scared by all the red lines,
+                # even if its just a simple one-off encoding error
+                if self.logger.isEnabledFor(logging.DEBUG):
+                    self.logger.info(line)
             elif "critical" in line:
                 self.logger.error(line)
-            else:
+            elif self.logger.isEnabledFor(VERBOSE_LOG_LEVEL):
                 self.logger.log(VERBOSE_LOG_LEVEL, line)
 
             if "Invalid data found when processing input" in line: