Echanges sur Frigate

Ok, merci, je vais essayer d’améliorer le contraste et peut être mettre des masques. Après mon plus gros pb est de ne pas pouvoir lire les enregistrements sur le mobile. Y arrives tu ?

Oui. Pas de souci de ce côté là non plus.
Frigate → Addon frigate proxy → Appli mobile et tout va bien

Merci @Pulpy-Luke, voila une excellente nouvelle !! Cela signifie que je devrais arriver à faire fonctionner aussi.
Tu n’as bien pas de problème à lire les vidéos avec la carte Frigate dans Lovelace, puis en cliquant sur le bouton du menu « clip galerie » ?

Je m’aperçois que sur mobile, je n’ai aucun pb si je vais sur l’interface frigate accessible depuis le menu. Je peux voir les événements, cliquer sur 1 et voir la vidéo qui arrive rapidement… Le problème n’est donc à priori pas une question de taille d’enregistrement trop lourd ou de mauvais codec. Il viendrait de la « frigate card » qui n’arrive pas à charger les vidéos des événements. Le pb arrive aussi bien sur iPhone qu’android. Sur iPhone l’application tourne et ne redonne pas la main. Sur Android, j’ai le message « error streaming - time out » qui fini par arriver.

Ci-dessous la config de ma carte Frigate. Mais j’ai relu la doc et ne voit rien de spécifique pour la lecture des enregistrements et la « clip gallery ». As tu toi quelque chose de spécifique sur la carte ou côté frigate ?

type: custom:frigate-card
cameras:
  - camera_entity: camera.foscam
  - camera_entity: camera.reolink
view:
  default: live
  camera_select: live
menu:
  mode: below
  buttons:
    frigate_ui: false
    download: false
    image: false
    frigate: false
  button_size: 50px
event_gallery:
  min_columns: 4
live:
  controls:
    thumbnails:
      mode: below
      size: 60px
      media: clips
    title:
      mode: popup-top-left
      duration_seconds: 10
    next_previous:
      style: chevrons
event_viewer:
  controls:
    thumbnails:
      mode: below
    title:
      mode: popup-top-left
      duration_seconds: 5
    next_previous:
      style: thumbnails
  lazy_load: false
dimensions:
  aspect_ratio_mode: dynamic
image:
  mode: screensaver

Sur mon disque, j’ai des enregistrement MP4 scindés en blocs de 850Ko environ. Idem pour toi ?

Attention. Je ne passe pas par lovelace dans mon cas mais par l’addon pour la visu.
Je testerai ta carte ce soir pour être dans les même conditions

1 « J'aime »

Salut,

J’utilise aussi la carte comme toi et je pense que c’est à cause de tes blocks de 850mo que tu n’arrives pas à lire les vidéos.
Perso mes détections font des petites vidéo d’environ 10 Mo

Je peux les lire dans la card et aussi en notification sur android.

Merci @KKox. Donc ça peut marcher ! :blush: Il faut vraiment que je trouve pourquoi.
Chaque bloc fait 850Ko (pas Mo, oups j’ai corrigé). Et la vidéo complète doit aussi faire 10 Mo comme chez toi.
Je continue à chercher…

ça vaudrait le coup de comparer plus en détails les options de la carte avec @KKox .
Avec juste unn copié/collé (et adaptation de l’entité caméra) ça reste en téléchargement sans jamais aboutir

Ok, merci @Pulpy-Luke pour le test. @KKox, on compte donc sur toi pour nous dire comment tu as fait marcher ta config :blush: Arrives tu a nous partager la config de ta carte ?

alors voici ma carte avec la nouvelle version 3.0.0 :

- type: 'custom:frigate-card'
        cameras:
          - camera_entity: camera.back
          - camera_entity: camera.garage
        elements:
              - type: 'custom:frigate-card-conditional'
                conditions:
                  camera: 
                    - camera.garage
                  view:
                    - live
                elements:
                  - type: custom:frigate-card-menu-state-icon
                    entity: switch.garage_detect
                    tap_action:
                      action: toggle
              - type: 'custom:frigate-card-conditional'
                conditions:
                  camera: 
                    - camera.back
                  view:
                    - live
                elements:
                  - type: custom:frigate-card-menu-state-icon
                    entity: switch.back_detect
                    tap_action:
                      action: toggle

La partie elements sert à avoir un bouton pour activer/désacvtiver la détection :

tempsnip

Je pense plus à un problème d’encodage/décodage je mets mes paramètres de frigate au cas ou :

ffmpeg:
  # Optional: global ffmpeg args (default: shown below)
  global_args: -hide_banner -loglevel warning
  # Optional: global hwaccel args (default: shown below)
  # NOTE: See hardware acceleration docs for your specific device
  hwaccel_args:
        - -hwaccel
        - vaapi
        - -hwaccel_device
        - /dev/dri/renderD128
        - -hwaccel_output_format
        - yuv420p
  # Optional: global input args (default: shown below)
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
  # Optional: global output args
  output_args:
    # Optional: output args for detect streams (default: shown below)
    detect: -f rawvideo -pix_fmt yuv420p
    # Optional: output args for record streams (default: shown below)
    record: -f segment -segment_time 10 -segment_format ts -reset_timestamps 1 -strftime 1 -c copy
    # Optional: output args for rtmp streams (default: shown below)
    rtmp: -c copy -f flv

# Optional: Detect configuration
# NOTE: Can be overridden at the camera level
detect:
  # Optional: width of the frame for the input with the detect role (default: shown below)
  width: 1280
  # Optional: height of the frame for the input with the detect role (default: shown below)
  height: 720
  # Optional: desired fps for your camera for the input with the detect role (default: shown below)
  # NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
  fps: 5
  # Optional: enables detection for the camera (default: True)
  # This value can be set via MQTT and will be updated in startup based on retained value
  enabled: True
  # Optional: Number of frames without a detection before frigate considers an object to be gone. (default: 5x the frame rate)
  max_disappeared: 25

# Optional: Object configuration
# NOTE: Can be overridden at the camera level
objects:
  # Optional: list of objects to track from labelmap.txt (default: shown below)
  track:
    - person
  # Optional: mask to prevent all object types from being detected in certain areas (default: no mask)
  # Checks based on the bottom center of the bounding box of the object.
  # NOTE: This mask is COMBINED with the object type specific mask below
  # mask: 0,0,1000,0,1000,200,0,200
  # Optional: filters to reduce false positives for specific object types
  filters:
    person:
      # Optional: minimum width*height of the bounding box for the detected object (default: 0)
      min_area: 5000
      # Optional: maximum width*height of the bounding box for the detected object (default: 24000000)
      max_area: 100000
      # Optional: minimum score for the object to initiate tracking (default: shown below)
      min_score: 0.5
      # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
      threshold: 0.7
      # Optional: mask to prevent this object type from being detected in certain areas (default: no mask)
      # Checks based on the bottom center of the bounding box of the object
      # mask: 0,0,1000,0,1000,200,0,200

# Optional: Motion configuration
# NOTE: Can be overridden at the camera level
motion:
  # Optional: The threshold passed to cv2.threshold to determine if a pixel is different enough to be counted as motion. (default: shown below)
  # Increasing this value will make motion detection less sensitive and decreasing it will make motion detection more sensitive.
  # The value should be between 1 and 255.
  threshold: 25
  # Optional: Minimum size in pixels in the resized motion image that counts as motion (default: ~0.17% of the motion frame area)
  # Increasing this value will prevent smaller areas of motion from being detected. Decreasing will make motion detection more sensitive to smaller
  # moving objects.
  contour_area: 100
  # Optional: Alpha value passed to cv2.accumulateWeighted when averaging the motion delta across multiple frames (default: shown below)
  # Higher values mean the current frame impacts the delta a lot, and a single raindrop may register as motion.
  # Too low and a fast moving person wont be detected as motion.
  delta_alpha: 0.2
  # Optional: Alpha value passed to cv2.accumulateWeighted when averaging frames to determine the background (default: shown below)
  # Higher values mean the current frame impacts the average a lot, and a new object will be averaged into the background faster.
  # Low values will cause things like moving shadows to be detected as motion for longer.
  # https://www.geeksforgeeks.org/background-subtraction-in-an-image-using-concept-of-running-average/
  frame_alpha: 0.2
  # Optional: Height of the resized motion frame  (default: 1/6th of the original frame height, but no less than 180)
  # This operates as an efficient blur alternative. Higher values will result in more granular motion detection at the expense of higher CPU usage.
  # Lower values result in less CPU, but small changes may not register as motion.
  frame_height: 180
  # Optional: motion mask
  # NOTE: see docs for more detailed info on creating masks
  # mask: 0,900,1080,900,1080,1920,0,1920

# Optional: Record configuration
# NOTE: Can be overridden at the camera level
record:
  enabled: True
  retain:
    days: 0
    mode: motion

  events:
    retain:
      default: 30
      mode: active_objects
    # Optional: Maximum length of time to retain video during long events. (default: shown below)
    # NOTE: If an object is being tracked for longer than this amount of time, the retained recordings
    #       will be the last x seconds of the event unless retain_days under record is > 0.
    max_seconds: 300
    # Optional: Number of seconds before the event to include (default: shown below)
    pre_capture: 5
    # Optional: Number of seconds after the event to include (default: shown below)
    post_capture: 5
    # Optional: Objects to save recordings for. (default: all tracked objects)
    objects:
      - person
    # Optional: Restrict recordings to objects that entered any of the listed zones (default: no required zones)
    required_zones: []
    # Optional: Retention settings for recordings of events
    retain:
      # Required: Default retention days (default: shown below)
      default: 0
      # Optional: Per object retention days
      objects:
        person: 30

# Optional: Configuration for the jpg snapshots written to the clips directory for each event
# NOTE: Can be overridden at the camera level
snapshots:
  # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
  # This value can be set via MQTT and will be updated in startup based on retained value
  enabled: true
  # Optional: print a timestamp on the snapshots (default: shown below)
  timestamp: true
  # Optional: draw bounding box on the snapshots (default: shown below)
  bounding_box: False
  # Optional: crop the snapshot (default: shown below)
  crop: False
  # Optional: height to resize the snapshot to (default: original size)
  height: 175
  # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)
  required_zones: []
  # Optional: Camera override for retention settings (default: global values)
  retain:
    # Required: Default retention days (default: shown below)
    default: 30
    # Optional: Per object retention days
    objects:
      person: 30

J’espère que ca pourra t’aider @Argonaute

Encodage / décodage pourquoi pas mais dans mon cas ça reste les mêmes si je passe par l’addon ou lovelace, non ?

Ah oui :sweat_smile:

En tout cas tes blocks de moins de 1 mo pour les vidéos ça me parait bizarre. Je t’ai mis mes paramètres de frigate pour essayer. On sait jamais !

Après nos configs sont assez différentes je suis sur unraid avec tout en docker…

L’avantage du container c’est que à l’intérieur c’est pareil pour nous tous

@Argonaute : je confirme !! La carte de @KKox fonctionne

Oh génial !!! Je suis en déplacement et j’ai hâte d’essayer. D’avance merci :star_struck:
Il faut modifier la carte lovelace ou la config frigate au final ? Sur la carte il n’y a que les éléments pour des boutons de spécifique au final.

Hello,
J’ai testé la carte, mais c’est la même chose sur iphone (mais cela marche et a toujours marché sur PC / internet explorer).
J’ai également essayé de changer le format de la sortie. Le paramétrage output_args fait que le format de sortie est converti et cette opération prend énormément de CPU. Je passe pour une seule caméra de 6% de CPU a près de 50%.
@Pulpy-Luke, qu’as tu fait pour faire fonctionner sur mobile ? Juste changé la frigate card ou aussi le format des vidéos ?

Salut
Juste la carte. C’est les mêmes vidéos, le même encodage

Ok merci. Alors ce doit être le passage à la version 3 qui a résolu ton problème. De mon côté, ce doit être un pb lié à ios.

Salut tout le monde !
Pourriez vous partager vos automatisations pour la gestion des notifications frigate ?
J’ai testé la blueprint un peu plus haut, mais j’en suis pas trop satisfait. J’ai du bidouillé pas mal de chose dedans pour un résultat bof bof. Beaucoup de doublon, très verbeux en log d’info…
Pour info, je ne cherche pas à utiliser les notif Android, mais plutot Telegram : je n’accède à HA que via VPN sur mon téléphone. Et ce dernier n’étant pas toujours activé, je n’ai pas trouvé d’autre solution que de passer par Télégram.

Avec du retard mais au cas où tu en es encore besoin, j’utilise celle là :

Après je passe par les notifs sur l’application directement.

Bonjour,
J’ai suivi tes conseils (sans détection dans un premier temps) mais j’obtiens un message d’erreur concernant la configuration. As-tu une idée pour résoudre ce problème ?. Mille mercis en avance
Ci-après le LOG

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2022-07-12 16:46:56] frigate.app                    INFO    : Starting Frigate (0.10.1-83481af)
*************************************************************
*************************************************************
***    Your config file is not valid!                     ***
***    Please check the docs at                           ***
***    https://docs.frigate.video/configuration/index     ***
*************************************************************
*************************************************************
***    Config Validation Errors                           ***
*************************************************************
mapping values are not allowed here
  in "<unicode string>", line 7, column 11:
        ffmpeg:
              ^
Traceback (most recent call last):
  File "/opt/frigate/frigate/app.py", line 312, in start
    self.init_config()
  File "/opt/frigate/frigate/app.py", line 77, in init_config
    user_config = FrigateConfig.parse_file(config_file)
  File "/opt/frigate/frigate/config.py", line 900, in parse_file
    config = yaml.safe_load(raw_config)
  File "/usr/local/lib/python3.8/dist-packages/yaml/__init__.py", line 162, in safe_load
    return load(stream, SafeLoader)
  File "/usr/local/lib/python3.8/dist-packages/yaml/__init__.py", line 114, in load
    return loader.get_single_data()
  File "/usr/local/lib/python3.8/dist-packages/yaml/constructor.py", line 49, in get_single_data
    node = self.get_single_node()
  File "/usr/local/lib/python3.8/dist-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/local/lib/python3.8/dist-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/local/lib/python3.8/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.8/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python3.8/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.8/dist-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
  File "/usr/local/lib/python3.8/dist-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/local/lib/python3.8/dist-packages/yaml/parser.py", line 428, in parse_block_mapping_key
    if self.check_token(KeyToken):
  File "/usr/local/lib/python3.8/dist-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/usr/local/lib/python3.8/dist-packages/yaml/scanner.py", line 223, in fetch_more_tokens
    return self.fetch_value()
  File "/usr/local/lib/python3.8/dist-packages/yaml/scanner.py", line 577, in fetch_value
    raise ScannerError(None, None,
yaml.scanner.ScannerError: mapping values are not allowed here
  in "<unicode string>", line 7, column 11:
        ffmpeg:
              ^
*************************************************************
***    End Config Validation Errors                       ***
*************************************************************
[cmd] python3 exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.