Closed aforch closed 2 years ago
It should be saving 10s segments in the /tmp/cache
folder first and moving them to /media/frigate/recordings
based on your config. Also, can you post the json compiled version of your config from the debug page?
Sure, thanks for the response, here you go:
{
"birdseye": {
"enabled": true,
"height": 720,
"mode": "objects",
"quality": 8,
"width": 1280
},
"cameras": {
"doorbell": {
"best_image_timeout": 60,
"detect": {
"enabled": true,
"fps": 5,
"height": 1080,
"max_disappeared": 25,
"stationary_interval": 50,
"width": 1920
},
"ffmpeg": {
"global_args": [
"-hide_banner",
"-loglevel",
"warning"
],
"hwaccel_args": [],
"input_args": [
"-avoid_negative_ts",
"make_zero",
"-fflags",
"+genpts+discardcorrupt",
"-rtsp_transport",
"tcp",
"-stimeout",
"5000000",
"-use_wallclock_as_timestamps",
"1"
],
"inputs": [
{
"global_args": [],
"hwaccel_args": [],
"input_args": [],
"path": "rtsp://admin:<password>@192.168.3.27:554",
"roles": [
"record",
"rtmp",
"detect"
]
}
],
"output_args": {
"detect": [
"-f",
"rawvideo",
"-pix_fmt",
"yuv420p"
],
"record": [
"-f",
"segment",
"-segment_time",
"10",
"-segment_format",
"mp4",
"-reset_timestamps",
"1",
"-strftime",
"1",
"-c",
"copy",
"-an"
],
"rtmp": [
"-c",
"copy",
"-f",
"flv"
]
}
},
"ffmpeg_cmds": [
{
"cmd": "ffmpeg -hide_banner -loglevel warning -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://admin:q2U3UJ5fdNSgjTBh73@192.168.3.27:554 -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an /tmp/cache/doorbell-%Y%m%d%H%M%S.mp4 -c copy -f flv rtmp://127.0.0.1/live/doorbell -r 5 -s 1920x1080 -f rawvideo -pix_fmt yuv420p pipe:",
"roles": [
"record",
"rtmp",
"detect"
]
}
],
"live": {
"height": 720,
"quality": 8
},
"motion": {
"contour_area": 30,
"delta_alpha": 0.2,
"frame_alpha": 0.2,
"frame_height": 50,
"mask": "1920,0,1920,134,1314,312,1314,907,980,994,0,1009,0,0",
"threshold": 25
},
"mqtt": {
"bounding_box": true,
"crop": true,
"enabled": true,
"height": 270,
"quality": 70,
"required_zones": [],
"timestamp": true
},
"name": "doorbell",
"objects": {
"filters": {
"person": {
"mask": "0,438,1312,345,1319,841,0,1004",
"max_area": 24000000,
"min_area": 0,
"min_score": 0.5,
"threshold": 0.7
}
},
"mask": "",
"track": [
"person"
]
},
"record": {
"enabled": true,
"events": {
"max_seconds": 300,
"objects": null,
"post_capture": 5,
"pre_capture": 5,
"required_zones": [],
"retain": {
"default": 10,
"objects": {}
}
},
"retain_days": 0
},
"rtmp": {
"enabled": true
},
"snapshots": {
"bounding_box": true,
"clean_copy": true,
"crop": false,
"enabled": true,
"height": null,
"quality": 70,
"required_zones": [],
"retain": {
"default": 10,
"objects": {}
},
"timestamp": false
},
"timestamp_style": {
"color": {
"blue": 255,
"green": 255,
"red": 255
},
"effect": null,
"format": "%m/%d/%Y %H:%M:%S",
"position": "tl",
"thickness": 2
},
"zones": {}
}
},
"database": {
"path": "/db/frigate.db"
},
"detect": {
"enabled": true,
"fps": 5,
"height": 720,
"max_disappeared": null,
"stationary_interval": null,
"width": 1280
},
"detectors": {
"cpu": {
"device": "usb",
"num_threads": 3,
"type": "cpu"
}
},
"environment_vars": {},
"ffmpeg": {
"global_args": [
"-hide_banner",
"-loglevel",
"warning"
],
"hwaccel_args": [],
"input_args": [
"-avoid_negative_ts",
"make_zero",
"-fflags",
"+genpts+discardcorrupt",
"-rtsp_transport",
"tcp",
"-stimeout",
"5000000",
"-use_wallclock_as_timestamps",
"1"
],
"output_args": {
"detect": [
"-f",
"rawvideo",
"-pix_fmt",
"yuv420p"
],
"record": [
"-f",
"segment",
"-segment_time",
"10",
"-segment_format",
"mp4",
"-reset_timestamps",
"1",
"-strftime",
"1",
"-c",
"copy",
"-an"
],
"rtmp": [
"-c",
"copy",
"-f",
"flv"
]
}
},
"live": {
"height": 720,
"quality": 8
},
"logger": {
"default": "info",
"logs": {
"frigate.record": "debug"
}
},
"model": {
"height": 320,
"labelmap": {},
"labelmap_path": null,
"path": null,
"width": 320
},
"motion": null,
"mqtt": {
"client_id": "frigate",
"host": "192.168.3.9",
"password": "<password>",
"port": 1883,
"stats_interval": 60,
"tls_ca_certs": null,
"tls_client_cert": null,
"tls_client_key": null,
"tls_insecure": null,
"topic_prefix": "frigate",
"user": "frigate"
},
"objects": {
"filters": null,
"mask": "",
"track": [
"person"
]
},
"record": {
"enabled": false,
"events": {
"max_seconds": 300,
"objects": null,
"post_capture": 5,
"pre_capture": 5,
"required_zones": [],
"retain": {
"default": 10,
"objects": {}
}
},
"retain_days": 0
},
"rtmp": {
"enabled": true
},
"snapshots": {
"bounding_box": true,
"clean_copy": true,
"crop": false,
"enabled": false,
"height": null,
"quality": 70,
"required_zones": [],
"retain": {
"default": 10,
"objects": {}
},
"timestamp": false
},
"timestamp_style": {
"color": {
"blue": 255,
"green": 255,
"red": 255
},
"effect": null,
"format": "%m/%d/%Y %H:%M:%S",
"position": "tl",
"thickness": 2
}
}
In /tmp/cache only one file is being created
root@8117ee5eb1a3:/tmp/cache# ls -lh
total 5.9G
-rw-r--r-- 1 root root 5.9G Dec 2 08:41 doorbell-20211201145826.mp4
Nothing is getting written to /media/frigate/recordings
root@8117ee5eb1a3:/media/frigate/recordings# ls -lh
total 0
Tested write permissions in the /media/frigate/recordings directory
root@8117ee5eb1a3:/media/frigate/recordings# touch test
root@8117ee5eb1a3:/media/frigate/recordings# ls
test
root@8117ee5eb1a3:/media/frigate/recordings# echo "this is a test" >> test
root@8117ee5eb1a3:/media/frigate/recordings# cat test
this is a test
I don't see an obvious reason why, but something about your stream is preventing ffmpeg from properly segmenting. You should have many small files in the cache, not one giant file. I would suggest checking your camera settings to see if you can switch to constant bit rate (CBR) and/or disable anything like variable I-frame rates. If that doesn't work, I can suggest some ffmpeg commands to test with.
I took a look at the settings, but there are no options like what you mention. This is an Amcrest AD110 doorbell, so I guess they don't figure you need much customization ability for the video stream.
I just found that this is a duplicate of issue 2068. I looks like I need to remove "low_delay" from ffmpeg input args. How do I specify the input args removing only "low_delay"? I tried the below but then the stream fails and ffmpeg crashes:
doorbell:
ffmpeg:
inputs:
- path: rtsp://admin:q2U3UJ5fdNSgjTBh73@192.168.3.27:554/cam/realmonitor?channel=1&subtype=0
roles:
- detect
- record
input_args:
- -avoid_negative_ts
- make_zero
- -fflags
- nobuffer
- -flags
- -strict
- experimental
- -fflags
- +genpts
- +discardcorrupt
- -rw_timeout
- 5000000
- -use_wallclock_as_timestamp
- 1
detect:
width: 1920
height: 1080
objects:
track:
- person
filters:
person:
mask: 0,438,1312,345,1319,841,0,1004
snapshots:
enabled: True
motion:
mask: 1920,0,1920,134,1314,312,1314,907,980,994,0,1009,0,0
record:
enabled: True
retain_days: 0
events:
max_seconds: 300
# pre_capture: 15
#post_capture: 15
retain:
default: 10
The default args no longer include the low latency flag, so it must be something else.
For the record I have the same problem with my array. I have seven cameras and Frigate (0.9.4-26AE608) seems to work well with all of them. However, I analyzed the last 41 clips "captured" by Frigate and this was the result:
From 12/03/21-12/04/21
CASE#1 1111111111111111111111 <-- 22 ==> ~53% CASE#2 1111111111 <-- 10 ==> ~24% CASE#3 111111111 <-- 9 ==> ~22%
I noticed was that there were some duplicates in the last day of clips too but that's less of a concern. @blakeblackshear, I'm not sure how best to help debug this kind of thing but I'm definitely willing to help. I think Frigate is awesome and, for me, this missing/wrong recording problem is the biggest hole in the app at the moment. I have it integrated with HA and regularly I'll get notification of a clip that was created (with the snapshot image), I'll click to view the clip and it is broken, no video captured. :( If there's any way I can help just let me know.
Party on! -Greg
I added a second CPU core to the VM on which docker/frigate is running, as utilization was overall about double what it was from before I installed frigate, and rebooted. I didn't notice right away, but now recording from the Amcrest AD110 is working.
Describe the problem you are having
Single camera (so far) installation, recording for events never generates a recording/clip. Event snapshots are created, but clicking on clip results in "The media could not be loaded, either because the server or network failed or because the format is not supported."
Download of event recording results in a broken clip.htm download. Detection is currently working great by CPU.
Deployment details:
Proxmox hypervisor, Ubuntu 18.04.3 LTS
Storage is NFS mounted FreeNAS store. Database stored locally on SSD. Docker compose:
Version
0.9.1, 0.9.4, 0.10.0 problem persists across all 3 tried
Frigate config file
Relevant log output
FFprobe output from your camera
Frigate stats
Operating system
Debian
Install method
Docker Compose
Coral version
CPU (no coral)
Network connection
Mixed
Camera make and model
Amcrest AD110
Any other information that may be helpful
No response