frigate: [Support]: some clips cannot be played or downloaded
Describe the problem you are having
A lot of clips cannot be played. They are listed in the events page but I cannot play or download the clip. Although I see the corresponding image.
This is an example url of a not found clip: https://frigate.k8s-prod.example.com/api/events/1636075753.575614-oqgg2t/clip.mp4?download=true
root@frigate-66db985665-tgpmn:/media# find | grep 57561
./frigate/clips/corridor_downstairs-1636075753.575614-oqgg2t.jpg
./frigate/clips/corridor_downstairs-1636075753.575614-oqgg2t-clean.png
This is an example url of a working clip: https://frigate.k8s-prod.example.com/api/events/1636011205.484664-zu53z7/clip.mp4?download=true
root@frigate-66db985665-tgpmn:/media# find | grep 484664
./frigate/clips/corridor_downstairs-1636011205.484664-zu53z7-clean.png
./frigate/clips/corridor_downstairs-1636011205.484664-zu53z7.jpg
How is frigate able to produce a working clip in the second example? I haven’t found a corresponding file on disk in both cases. Is frigate creating a clip from the recordings?
Version
0.9.4
Frigate config file
{
"birdseye": {
"enabled": false,
"height": 720,
"mode": "objects",
"quality": 8,
"width": 1280
},
"cameras": {
"corridor_downstairs": {
"best_image_timeout": 60,
"detect": {
"enabled": false,
"fps": 10,
"height": 720,
"max_disappeared": 50,
"width": 1280
},
"ffmpeg": {
"global_args": [
"-hide_banner",
"-loglevel",
"warning"
],
"hwaccel_args": [
"-hwaccel",
"vaapi",
"-hwaccel_device",
"/dev/dri/renderD128",
"-hwaccel_output_format",
"yuv420p"
],
"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://10.0.70.100:554/s0",
"roles": [
"detect"
]
},
{
"global_args": [],
"hwaccel_args": [],
"input_args": [],
"path": "rtsp://10.0.70.100:554/s0",
"roles": [
"rtmp",
"record"
]
}
],
"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 -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://10.0.70.100:554/s0 -r 10 -s 1280x720 -f rawvideo -pix_fmt yuv420p pipe:",
"roles": [
"detect"
]
},
{
"cmd": "ffmpeg -hide_banner -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1 -i rtsp://10.0.70.100:554/s0 -c copy -f flv rtmp://127.0.0.1/live/corridor_downstairs",
"roles": [
"rtmp",
"record"
]
}
],
"live": {
"height": 720,
"quality": 8
},
"motion": {
"contour_area": 99,
"delta_alpha": 0.2,
"frame_alpha": 0.2,
"frame_height": 180,
"mask": "",
"threshold": 25
},
"mqtt": {
"bounding_box": true,
"crop": true,
"enabled": true,
"height": 270,
"quality": 70,
"required_zones": [],
"timestamp": true
},
"name": "corridor_downstairs",
"objects": {
"filters": {
"person": {
"mask": null,
"max_area": 100000,
"min_area": 2500,
"min_score": 0.5,
"threshold": 0.7
}
},
"mask": "",
"track": [
"person"
]
},
"record": {
"enabled": false,
"events": {
"max_seconds": 300,
"objects": null,
"post_capture": 5,
"pre_capture": 5,
"required_zones": [],
"retain": {
"default": 14,
"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": 14,
"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": "/data/frigate.db"
},
"detect": {
"enabled": true,
"fps": 5,
"height": 720,
"max_disappeared": null,
"width": 1280
},
"detectors": {
"coral": {
"device": "pci:0",
"num_threads": 3,
"type": "edgetpu"
}
},
"environment_vars": {},
"ffmpeg": {
"global_args": [
"-hide_banner",
"-loglevel",
"warning"
],
"hwaccel_args": [
"-hwaccel",
"vaapi",
"-hwaccel_device",
"/dev/dri/renderD128",
"-hwaccel_output_format",
"yuv420p"
],
"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": {}
},
"model": {
"height": 320,
"labelmap": {},
"labelmap_path": null,
"path": null,
"width": 320
},
"motion": null,
"mqtt": {
"client_id": "frigate",
"host": "mosquitto",
"password": null,
"port": 1883,
"stats_interval": 60,
"tls_ca_certs": null,
"tls_client_cert": null,
"tls_client_key": null,
"tls_insecure": null,
"topic_prefix": "frigate",
"user": null
},
"objects": {
"filters": {
"person": {
"mask": null,
"max_area": 100000,
"min_area": 2500,
"min_score": 0.5,
"threshold": 0.7
}
},
"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
}
}
Relevant log output
none
FFprobe output from your camera
na
Frigate stats
No response
Operating system
Other Linux
Install method
Docker CLI
Coral version
M.2
Network connection
Wired
Camera make and model
Unifi G3 Flex
Any other information that may be helpful
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (4 by maintainers)
Something very similar to this started happening with my instance of Frigate as well.
The root source of the error for me seems to be the host getting overloaded, and Frigate being unable to clear the tmpfs fast enough, once the tmpfs is full, subsequent clips can’t be allocated (lots of zero size clips in the directory), and while mqtt records the event data, and the screenshots are saved, trying to play the clips gives this error as they never get saved.
Perhaps Frigate can recover from this state on it’s own after load subsides, causing it intermittently, but restarting Frigate always (temporarily) solves it as it resets the tmpfs back to empty.
I believe it’s possible that this was introduced in an update, either via a bug or an increase in computational load somewhere, as my Frigate instance had been running stably, but borderline max resources, with it’s current config for quite awhile, and only recently started having this issue.