Okay, now I have the command… but I can’t simulate it locally. Reason: Frigate kills the input RTSP stream and if I stop Frigate then I don’t have an endpoint for the output stream.
Funny part: now I get at least a distorted picture for some seconds, but the process crashes after some frames. Most of the times I just get errors, I have only seen it 1 or 2 times that I got an image.
/api/config/ content:
{
"cameras": {
"camera1": {
"best_image_timeout": 60,
"clips": {
"enabled": false,
"objects": null,
"post_capture": 5,
"pre_capture": 5,
"required_zones": [],
"retain": {
"default": 10,
"objects": {}
}
},
"detect": {
"enabled": true,
"max_disappeared": 75
},
"ffmpeg_cmds": [
{
"cmd": "ffmpeg -hide_banner -loglevel info -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p -rtsp_transport tcp -i rtsp://<ip>:8554/cam1 -c copy -an -f flv rtmp://127.0.0.1/live/cam1 -r 15 -f rawvideo -pix_fmt yuv420p pipe:",
"roles": [
"detect",
"rtmp"
]
}
],
"fps": 15,
"frame_shape": [
1080,
1920
],
"height": 1080,
"motion": {
"contour_area": 100,
"delta_alpha": 0.2,
"frame_alpha": 0.2,
"frame_height": 180,
"mask": null,
"threshold": 25
},
"mqtt": {
"bounding_box": true,
"crop": true,
"enabled": true,
"height": 270,
"required_zones": [],
"timestamp": true
},
"name": "camera1",
"objects": {
"filters": {
"bird": {
"mask": [],
"max_area": 24000000,
"min_area": 0,
"min_score": 0.5,
"threshold": 0.7
},
"cat": {
"mask": [],
"max_area": 24000000,
"min_area": 0,
"min_score": 0.5,
"threshold": 0.7
},
"dog": {
"mask": [],
"max_area": 24000000,
"min_area": 0,
"min_score": 0.5,
"threshold": 0.7
},
"person": {
"mask": [],
"max_area": 100000,
"min_area": 5000,
"min_score": 0.5,
"threshold": 0.7
}
},
"mask": null,
"track": [
"person",
"cat",
"dog",
"bird"
]
},
"record": {
"enabled": false,
"retain_days": 30
},
"rtmp": {
"enabled": true
},
"snapshots": {
"bounding_box": false,
"crop": false,
"enabled": false,
"height": null,
"required_zones": [],
"retain": {
"default": 10,
"objects": {}
},
"timestamp": false
},
"width": 1920,
"zones": {}
}
},
"clips": {
"max_seconds": 300,
"retain": {
"default": 10,
"objects": {}
},
"tmpfs_cache_size": ""
},
"database": {
"path": "/media/frigate/clips/frigate.db"
},
"detectors": {
"coral": {
"device": "usb:0",
"num_threads": 3,
"type": "edgetpu"
}
},
"environment_vars": {},
"logger": {
"default": "INFO",
"logs": {}
},
"model": {
"height": 320,
"width": 320
},
"mqtt": {
"client_id": "frigate",
"host": "<ip>",
"port": 1883,
"stats_interval": 60,
"topic_prefix": "frigate",
"user": "frigate"
},
"snapshots": {
"retain": {
"default": 10,
"objects": {}
}
}
}
Now in the frigate log I get the following entries over and over again:
frigate.video INFO : camera1: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video INFO : camera1: ffmpeg process is not running. exiting capture thread...
ffmpeg.garage.detect ERROR : [h264 @ 0x564bb46bd5c0] missing picture in access unit with size 22
ffmpeg.garage.detect ERROR : [h264 @ 0x564bb46bd5c0] no frame!
ffmpeg.garage.detect ERROR : [rtsp @ 0x564bb46b9940] decoding for stream 0 failed
ffmpeg.garage.detect ERROR : [rtsp @ 0x564bb46b9940] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
ffmpeg.garage.detect ERROR : Consider increasing the value for the 'analyzeduration' and 'probesize' options
ffmpeg.garage.detect ERROR : Guessed Channel Layout for Input Stream #0.1 : stereo
ffmpeg.garage.detect ERROR : Input #0, rtsp, from 'rtsp://<ip>:8554/cam1':
ffmpeg.garage.detect ERROR : Metadata:
ffmpeg.garage.detect ERROR : title : Session streamed with GStreamer
ffmpeg.garage.detect ERROR : comment : rtsp-server
ffmpeg.garage.detect ERROR : Duration: N/A, start: 0.000000, bitrate: 512 kb/s
ffmpeg.garage.detect ERROR : Stream #0:0: Video: h264, none, 90k tbr, 90k tbn, 180k tbc
ffmpeg.garage.detect ERROR : Stream #0:1: Audio: pcm_s16be, 16000 Hz, stereo, s16, 512 kb/s
ffmpeg.garage.detect ERROR : [flv @ 0x564bb46dd500] dimensions not set
ffmpeg.garage.detect ERROR : Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
ffmpeg.garage.detect ERROR : Stream mapping:
ffmpeg.garage.detect ERROR : Stream #0:0 -> #0:0 (copy)
ffmpeg.garage.detect ERROR : Stream #0:0 -> #1:0 (h264 (native) -> rawvideo (native))
ffmpeg.garage.detect ERROR : Last message repeated 1 times