Closed fyrstyk closed 1 year ago
I would suggest updating to 0.12, looks like your cameras record process is having some issues and that is most likely the problem. RTMP is causing the stream to crash
Hi NickM-27
Would that error cause the clips to be missing?
I've only had the issue with clips since adding:
required_zones:
Otherwise, clips are generated without issue, and there are no issues with recordings either. All my events earlier today had clips, and the issue has only arisen since adding required_zones.
I've had difficulty with required zones previously and may be missing something in the config.
we can see at least one of the cameras failed here: ffmpeg.West.record_rtmp ERROR : Error writing trailer of rtmp://127.0.0.1/live/West: Connection reset by peer
and these logs are from after the event you are showing.
You're also saying you have issues with person_west / car_west but your screenshot is showing the east camera.
in general your required_zones looks like from what I can see
Apologies
The clips issue is on all my cameras, east, west, and south.
West is a new camera, and I have noted the issues with that, and was going to investigate further.
Even with east and south cameras only I get the same behaviour regarding clips.
I tried setting up required zones late last year to reduce false triggers from areas I was not interested in and gave up as I had the same issue with clips.
I would suggest reducing your config to this:
# yaml-language-server: $schema=http://battersea:5000/api/config/schema
mqtt:
host: mosquitto
user: u32-1
password:
detectors:
coral:
type: edgetpu
device: usb
birdseye:
enabled: True
mode: continuous
width: 1920
height: 1080
quality: 1
ffmpeg:
# input_args:
# - -avoid_negative_ts
# - make_zero
hwaccel_args: -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p
output_args:
record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
#logger:
# Optional: default log level (default: shown below)
#default: debug
# Optional: module by module log level configuration
#logs:
# frigate.mqtt: error
cameras:
East: # <------ Name the camera
ui:
order: 1
ffmpeg:
inputs:
- path: rtsp://u321cctv:xxx@10.10.10.240:554/stream1 # <----- Update for your camera
roles:
- record
- rtmp
- path: rtsp://u321cctv:xxx@10.10.10.240:554/stream2 # <----- Update for your camera
roles:
- detect
rtmp:
enabled: True # <-- RTMP should be disabled if your stream is not H264
detect:
width: 640 # <---- update for your camera's resolution
height: 360 # <---- update for your camera's resolution
fps: 5
stationary:
interval: 5
threshold: 50
motion:
mask:
# Cable and timestamp
- 0,175,224,30,228,0,0,0
# - 2560,0,2560,141,2051,61,1533,62,639,258,650,319,552,376,178,655,0,801,0,0
# 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. 25 default
threshold: 25
# Optional: Minimum size in pixels in the resized motion image that counts as motion (default: 30)
# Increasing this value will prevent smaller areas of motion from being detected. Decreasing will
# make motion detection more sensitive to smaller moving objects. 30 default
# As a rule of thumb:
# - 15 - high sensitivity
# - 30 - medium sensitivity
# - 50 - low sensitivity
contour_area: 15
# 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: 50)
# 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: 50
improve_contrast: True
objects:
track:
- person
- dog
- cat
- sheep
- cow
- horse
- umbrella
filters:
person:
mask:
- 0,0,380,0,214,36,0,179
snapshots:
enabled: True
bounding_box: True
height: 360
retain:
default: 14
required_zones:
- doorbell_east
record:
enabled: True
retain:
mode: motion
days: 14
events:
retain:
default: 14
pre_capture: 5
post_capture: 120
required_zones:
- doorbell_east
zones:
doorbell_east:
coordinates: 640,360,0,360,0,319,460,68,640,103
objects:
- person
- umbrella
South: # <------ Name the camera
ui:
order: 0
ffmpeg:
inputs:
- path: rtsp://u321cctv:xxx@10.10.10.241:554/stream1 # <----- Update for your camera
roles:
- record
# - detect
- rtmp
- path: rtsp://u321cctv:xxx@10.10.10.241:554/stream2 # <----- Update for your camera
roles:
- detect
rtmp:
enabled: True # <-- RTMP should be disabled if your stream is not H264
detect:
width: 640 # <---- update for your camera's resolution
height: 360 # <---- update for your camera's resolution
fps: 5
stationary:
interval: 5
threshold: 50
motion:
mask:
- 0,21,231,21,228,0,0,0
# - 2560,233,2560,0,1966,0
# - 2560,1440,2560,633,2097,1440
# - 789,0,791,59,0,61,0,0
# 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. 25 default
threshold: 25
# Optional: Minimum size in pixels in the resized motion image that counts as motion (default: 30)
# Increasing this value will prevent smaller areas of motion from being detected. Decreasing will
# make motion detection more sensitive to smaller moving objects. 30 default
# As a rule of thumb:
# - 15 - high sensitivity
# - 30 - medium sensitivity
# - 50 - low sensitivity
contour_area: 15
# 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: 50)
# 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: 50
improve_contrast: True
objects:
track:
- person
- sheep
- dog
- cat
- sheep
- cow
- horse
- umbrella
snapshots:
enabled: True
bounding_box: True
height: 360
retain:
default: 7
required_zones:
- doorbell_south
record:
enabled: True
retain:
mode: motion
days: 7
events:
retain:
default: 7
pre_capture: 5
post_capture: 120
required_zones:
- doorbell_south
zones:
doorbell_south:
coordinates: 0,360,195,360,61,107,0,131
objects:
- person
- umbrella
West: # <------ Name the camera
ui:
order: 3
ffmpeg:
inputs:
- path: rtsp://u321cctv:xxx@10.10.10.242:554/Streaming/Channels/101/ # <----- Update for your camera
roles:
- record
- rtmp
- path: rtsp://u321cctv:xxx@10.10.10.242:554/Streaming/Channels/103/ # <----- Update for your camera
roles:
- detect
rtmp:
enabled: True # <-- RTMP should be disabled if your stream is not H264
detect:
width: 1280 # <---- update for your camera's resolution
height: 720 # <---- update for your camera's resolution
fps: 6
stationary:
interval: 5
threshold: 50
max_frames:
objects:
car: 750
motion:
mask:
# Timestamp
- 30,24,335,24,335,2,30,2
# Cable
- 957,720,1020,720,932,58,902,63
#- 59,94,672,95,672,38,57,39
# 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. 25 default
threshold: 25
# Optional: Minimum size in pixels in the resized motion image that counts as motion (default: 30)
# Increasing this value will prevent smaller areas of motion from being detected. Decreasing will
# make motion detection more sensitive to smaller moving objects. 30 default
# As a rule of thumb:
# - 15 - high sensitivity
# - 30 - medium sensitivity
# - 50 - low sensitivity
contour_area: 15
# 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: 50)
# 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: 50
improve_contrast: True
objects:
track:
- person
- car
- dog
- cat
- sheep
- cow
- horse
- umbrella
filters:
person:
mask:
- 0,0,743,0,1280,0,1280,155,915,114,348,122,0,204
snapshots:
enabled: True
bounding_box: True
height: 720
retain:
default: 14
required_zones:
- person_west
- car_west
record:
enabled: True
retain:
mode: motion
days: 14
events:
retain:
default: 14
pre_capture: 5
post_capture: 120
required_zones:
- person_west
- car_west
zones:
person_west:
coordinates: 0,720,1280,720,1280,311,1176,225,147,395,147,503,0,549
objects:
- person
- umbrella
car_west:
coordinates: 170,664,848,607,1280,487,1280,347,718,438,179,485
objects:
- car
That seems to have done the trick, thank you very much!
Will frigate still record the other objects in the track list outside the required zones?
What I was trying to achieve was to record all the objects in my track list, but only cars/people in the required zones.
Can you explain where I went wrong?
Thanks again :)
it depends what you mean by record. You have 24/7 recording enabled so it will of course record and track all objects, but you will not get events for any objects that are not listed in the zones
I would like to see events for the other objects, sheep, dog, cat etc but anywhere in the image.
I would like to see events for the other objects, sheep, dog, cat etc but anywhere in the image.
then you need to create a separate zone that covers the entire image with only those objects
Ok, thanks.
Very much appreciate your help.
Feel free to create a new issue if something else comes up
Describe the problem you are having
I have configured frigate today with required zones as I only want to see recordings/events when there is a person in a zone.
Zones appear to be working, and I can see snapshots from the camera, but I now no longer have any clips. Recordings are being made, and have confirmed by looking at local storage, but no clips available in the GUI and it is greyed out.
Version
0.11.1-2EADA21
Frigate config file
Relevant log output
Frigate stats
Operating system
Other Linux
Install method
Docker Compose
Coral version
USB
Any other information that may be helpful
No response