Selaa lähdekoodia

fix timestamp

Jason Hunter 3 vuotta sitten
vanhempi
commit
3fb24b4bf5
2 muutettua tiedostoa jossa 4 lisäystä ja 3 poistoa
  1. 2 2
      frigate/config.py
  2. 2 1
      frigate/object_processing.py

+ 2 - 2
frigate/config.py

@@ -472,8 +472,8 @@ class CameraConfig(BaseModel):
     )
     )
     motion: Optional[MotionConfig] = Field(title="Motion detection configuration.")
     motion: Optional[MotionConfig] = Field(title="Motion detection configuration.")
     detect: Optional[DetectConfig] = Field(title="Object detection configuration.")
     detect: Optional[DetectConfig] = Field(title="Object detection configuration.")
-    timestamp_style: Optional[TimestampStyleConfig] = Field(
-        title="Timestamp style configuration."
+    timestamp_style: TimestampStyleConfig = Field(
+        default_factory=TimestampStyleConfig, title="Timestamp style configuration."
     )
     )
 
 
     def __init__(self, **config):
     def __init__(self, **config):

+ 2 - 1
frigate/object_processing.py

@@ -404,6 +404,7 @@ class CameraState:
                 )
                 )
 
 
         if draw_options.get("timestamp"):
         if draw_options.get("timestamp"):
+            color = self.camera_config.timestamp_style.color
             draw_timestamp(
             draw_timestamp(
                 frame_copy,
                 frame_copy,
                 frame_time,
                 frame_time,
@@ -411,7 +412,7 @@ class CameraState:
                 font_effect=self.camera_config.timestamp_style.effect,
                 font_effect=self.camera_config.timestamp_style.effect,
                 font_scale=self.camera_config.timestamp_style.scale,
                 font_scale=self.camera_config.timestamp_style.scale,
                 font_thickness=self.camera_config.timestamp_style.thickness,
                 font_thickness=self.camera_config.timestamp_style.thickness,
-                font_color=self.camera_config.timestamp_style.color,
+                font_color=(color.red, color.green, color.blue),
                 position=self.camera_config.timestamp_style.position,
                 position=self.camera_config.timestamp_style.position,
             )
             )