frigate icon indicating copy to clipboard operation
frigate copied to clipboard

[Support]: Proper way to copy events recordings to a different location to be picked up by something like plex

Open bughattiveyron opened this issue 1 year ago • 8 comments

Describe the problem you are having

I currently have the frigate_media set to a location that is monitored via plex. I noticed that every 10 seconds in the folder it is saving recordings, but compared to the events tab in frigate, they do not match up. Meaning, in the Events tab in frigate I see all events it captures, but just the events, cars, people, animals. But in the recordings folder, I see hundreds of recordings for video in between events. I remember reading in another document from you all that the recordings folder is not really meant to be monitored in a way that 3rd party apps try to read the data.

Is there a proper way in the config file to save off just the event recordings to a different location for pickup by 3rd party apps?

Version

0.12.0-12D51D3

Frigate config file

mqtt:
  host: 10.xx.xx.240
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: liquidmosq
  password: secure

birdseye:
  enabled: True
  width: 1280
  height: 720
  quality: 8
  mode: objects

cameras:
  Front_Garage:
    ffmpeg:
      output_args:
        record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -ar 44100 -c:a aac
        rtmp: -c:v copy -f flv -ar 44100 -c:a aac
      inputs:
        - path: rtsp://liquid:[email protected]:554/s0
          roles:
            - detect
            - rtmp
      hwaccel_args: preset-nvidia-h264
    objects:
      track:
        - person
        - car
        - truck
        - bicycle
        - motorcycle
        - dog
        - cat
    snapshots:
      enabled: True
    record:
      enabled: True
  Back_Alley:
    ffmpeg:
      output_args:
        record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -ar 44100 -c:a aac
        rtmp: -c:v copy -f flv -ar 44100 -c:a aac
      inputs:
        - path: rtsp://rtsp:[email protected]:554/av_stream/ch0
          roles:
            - detect
            - rtmp
      hwaccel_args: preset-nvidia-h264
    objects:
      track:
        - person
        - car
        - truck
        - bicycle
        - motorcycle
        - dog
        - cat
    snapshots:
      enabled: True
    record:
      enabled: True

Relevant log output

2023-01-26 16:14:39.008337695  [2023-01-26 16:14:39] frigate.app                    INFO    : Starting Frigate (0.12.0-edbdbb7)
2023-01-26 16:14:39.037213368  [2023-01-26 16:14:39] peewee_migrate                 INFO    : Starting migrations
2023-01-26 16:14:39.165991693  [2023-01-26 16:14:39] peewee_migrate                 INFO    : There is nothing to migrate
2023-01-26 16:14:39.168824602  [2023-01-26 16:14:39] ws4py                          INFO    : Using epoll
2023-01-26 16:14:39.184188628  [2023-01-26 16:14:39] frigate.app                    INFO    : Output process started: 279
2023-01-26 16:14:39.191785447  [2023-01-26 16:14:39] frigate.app                    INFO    : Camera processor started for Front_Garage: 282
2023-01-26 16:14:39.205573208  [2023-01-26 16:14:39] ws4py                          INFO    : Using epoll
2023-01-26 16:14:39.206144898  [2023-01-26 16:14:39] frigate.app                    INFO    : Camera processor started for Back_Alley: 285
2023-01-26 16:14:39.206341787  [2023-01-26 16:14:39] frigate.app                    INFO    : Capture process started for Front_Garage: 286
2023-01-26 16:14:39.206412118  [2023-01-26 16:14:39] frigate.app                    INFO    : Capture process started for Back_Alley: 288
2023-01-26 16:14:39.238773408  [2023-01-26 16:14:39] detector.cpu                   INFO    : Starting detection process: 278
2023-01-26 16:14:39.240092973  [2023-01-26 16:14:39] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.

FFprobe output from your camera

"[\n  {\n    \"return_code\": 0,\n    \"stderr\": {},\n    \"stdout\": {\n      \"programs\": [],\n      \"streams\": [\n        {\n          \"avg_frame_rate\": \"0/0\",\n          \"codec_long_name\": \"AAC (Advanced Audio Coding)\"\n        },\n        {\n          \"avg_frame_rate\": \"25/1\",\n          \"codec_long_name\": \"H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10\",\n          \"display_aspect_ratio\": \"16:9\",\n          \"height\": 1080,\n          \"width\": 1920\n        }\n      ]\n    }\n  }\n]"

Frigate stats

No response

Operating system

Other Linux

Install method

Docker CLI

Coral version

CPU (no coral)

Network connection

Wired

Camera make and model

UVC G3 Flex

Any other information that may be helpful

No response

bughattiveyron avatar Jan 26 '23 17:01 bughattiveyron

Is there a proper way in the config file to save off just the event recordings to a different location for pickup by 3rd party apps?

there's no such thing as an event recording. The events recordings are created dynamically from the 10 second segments. Also with your config 24/7 recording is disabled so only recording segments that are part of relevant events are saved.

You could either use the events API to generate a playlist manually or maybe could download all events mp4 clips to a different file location but that would not be recommended at all

NickM-27 avatar Jan 26 '23 17:01 NickM-27

recording files saved in media folder https://imgur.com/Md1fwDG

event files showing in event tab of frigate https://imgur.com/S9mIYcB

So am I misunderstanding what frigate is doing? Is it saving video recordings every 10 seconds of all cameras to its media folders and then scanning for events of those recordings and with what it finds, it shows the events on frigates dashboard?

bughattiveyron avatar Jan 26 '23 17:01 bughattiveyron

recording files saved in media folder https://imgur.com/Md1fwDG

event files showing in event tab of frigate https://imgur.com/S9mIYcB

So am I misunderstanding what frigate is doing? Is it saving video recordings every 10 seconds of all cameras to its media folders and then scanning for events of those recordings and with what it finds, it shows the events on frigates dashboard?

yes you are misunderstanding. With your config (that has 24/7 recording disabled) frigate writes 10 seconds recordings to cache (RAM). Then when that 10 second file is done being written, frigate will either move that file to the recordings dir if an event occurred during that time or it will discard it.

frigate runs event detection on the stream itself, not these recordings files. However, when you click to watch an event clip in the webUI this is just a collection of those 10 second segments which are relevant for that event being streamed. There is no single file that contains all this footage. There is an endpoint to get that file created dynamically but this is not recommended.

NickM-27 avatar Jan 26 '23 17:01 NickM-27

https://youtu.be/NXyzFg6yQdo

So then all those clips in the recordings folder that keep showing up are only events that frigate detects? If this is the case, are my cameras set to sensitive because about 90% of the videos in my recordings folder have no objects in them that I have set in the config file.

bughattiveyron avatar Jan 26 '23 17:01 bughattiveyron

you probably have false positives, check the debug live view of the camera with bounding boxes enabled

NickM-27 avatar Jan 26 '23 17:01 NickM-27

https://imgur.com/uRs6Tt8

So frigate will continue to capture an object that is stationary over and over?

bughattiveyron avatar Jan 26 '23 17:01 bughattiveyron

So frigate will continue to capture an object that is stationary over and over?

It depends how you configure it, please read the docs https://docs.frigate.video/configuration/record#what-do-the-different-retain-modes-mean

NickM-27 avatar Jan 26 '23 17:01 NickM-27

Got it, that calmed down the recordings. Will try to go back through the docs to see what all I missed. Thank you

bughattiveyron avatar Jan 26 '23 18:01 bughattiveyron

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Feb 26 '23 00:02 github-actions[bot]