frigate.mqtt INFO : MQTT connected
watchdog.back INFO : No frames received from back in 20 seconds. Exiting ffmpegā¦
watchdog.back INFO : Waiting for ffmpeg to exit gracefullyā¦
frigate.video INFO : back: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
frigate.video INFO : back: ffmpeg process is not running. exiting capture threadā¦
frigate.watchdog INFO : Detection appears to have stopped. Exiting frigateā¦
frigate.app INFO : Stoppingā¦
frigate.record INFO : Exiting recording maintenanceā¦
frigate.object_processing INFO : Exiting object processorā¦
ffmpeg.back.detect ERROR : [udp @ 0x16111c0] attempted to set receive buffer to size 393216 but it only ended up set as 360448
ffmpeg.back.detect ERROR : [udp @ 0x1621510] attempted to set receive buffer to size 393216 but it only ended up set as 360448
ffmpeg.back.detect ERROR : [rtsp @ 0x16095a0] UDP timeout, retrying with TCP
ffmpeg.back.detect ERROR : [rtsp @ 0x16095a0] Could not find codec parameters for stream 0 (Video: mjpeg, none(bt470bg/unknown/unknown)): unspecified size
ffmpeg.back.detect ERROR : Consider increasing the value for the āanalyzedurationā and āprobesizeā options
ffmpeg.back.detect ERROR : Output file #0 does not contain any stream
frigate.events INFO : Exiting event cleanupā¦
frigate.events INFO : Exiting event processorā¦
frigate.watchdog INFO : Exiting watchdogā¦
I think tweaking the ffmpeg parameters is the way to go but I am clueless which parameters propably work.
In the codec information displayed by VLC it says āDecoded format: Planar 4:2:2 YUV full scaleā.
After that I use the following configuration (frigate.yml):
cameras:
ESP_TTGO_Cam:
ffmpeg:
global_args: -hide_banner -loglevel warning
# Hardware acceleration does not work for me as described in the Frigate documentation on my Raspberry Pi 4 32Bit OS.
hwaccel_args: []
# - -c:v
# - h264_mmal
inputs:
- path: rtsp://192.168.188.139:8554/mjpeg/1
roles:
- detect
# - rtmp # deactivate rtmp, otherwise you only see a green image
width: 800
height: 600
fps: 5
What still not working is that Frigate offers the stream as RTMP and I think itās somehow related to the ffmpeg output parameters that need tweaking.
After that I installed the HACS integration and I am seeing a screenshot of the last event in Lovelace. Pretty nice - EXCACTLY what I need.
Maybe my issues that I had are somehow related to the ESP32 board I used. I switched from a M5-Stack ESP32-CAM to the TTGO Cam-Board which has plenty of PSRAM.
hello @viertausend I guess German ? I am also thinking to attach some ESP32Cam modules to frigate. But without the RTMP stream itās useless. I need the mac showing in my dasboard. But if I am not wrongā¦ The rtsp stram can be added to homeassistant outside frigate right? That might be ok. I will give it a shot an revert with my results
You are right with your assumption about my nationatliy.
Some more information on the topic ESP32-CAM in Frigate:
Using the following arguments for the rtmp option let it āworkā:
ffmpeg:
output_args:
rtmp: -c:v libx264 -f flv
However this slows the whole Raspberry Pi 4 down until the point that the Dashboard isnāt even reacting anymore. It is because the transcoding is done without hardware acceleration (Processor usage is >> 80% with this option). The camera feed can now be seen in the dashboard and itās technically working but with a huge delay that makes it unusable even for the modest users.
Adding the following configuration to use hardware acceleration leads to a huge amount of warnings and errors in the log file:
hwaccel_args:
- -c:v
- h264_mmal
Just a short part of the log-file:
ffmpeg.ESP_TTGO_Cam.detect ERROR : Consider increasing the value for the 'analyzeduration' and 'probesize' options
ffmpeg.ESP_TTGO_Cam.detect ERROR : mmal: mmal_vc_shm_init: could not initialize vc shared memory service
ffmpeg.ESP_TTGO_Cam.detect ERROR : mmal: mmal_vc_component_create: failed to initialise shm for 'vc.ril.video_decode' (7:EIO)
ffmpeg.ESP_TTGO_Cam.detect ERROR : mmal: mmal_component_create_core: could not create component 'vc.ril.video_decode' (7)
ffmpeg.ESP_TTGO_Cam.detect ERROR : Error while opening decoder for input stream #0:0 : Unknown error occurred
Another information:
The integration of the live streams even works without the RTMP mentioned before but the huge delay is there as well. Processor usage is not as high as with RTMP.
Hello,
please help!
I also flashed the firmware on my ESP32 Cam and I am also able to watch the video in VLC and in the webbrowser but in Frigate I see just a green pictures. Not stream is avalible.
my frigate.yaml configuration:
cameras:
esp_cam:
ffmpeg:
global_args: -hide_banner -loglevel warning
hwaccel_args: []
# - -c:v
# - h264_mmal
inputs:
- path: rtsp://192.168.178.44:8554/mjpeg/1
roles:
- detect
- clips
# - rtmp # deactivate rtmp, otherwise you only see a green image
detect:
width: 800
height: 600
fps: 5
Here is the Log Output:
[2022-02-17 17:06:21] frigate.mqtt INFO : MQTT connected
[2022-02-17 17:06:21] frigate.app INFO : Output process started: 219
[2022-02-17 17:06:21] detector.cpu INFO : Starting detection process: 218
[2022-02-17 17:06:21] frigate.app INFO : Camera processor started for esp_cam: 222
[2022-02-17 17:06:21] frigate.edgetpu WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
[2022-02-17 17:06:21] frigate.app INFO : Capture process started for esp_cam: 223
[2022-02-17 17:06:21] ws4py INFO : Using epoll
[2022-02-17 17:06:21] ws4py INFO : Using epoll
[2022-02-17 17:06:26] frigate.video INFO : esp_cam: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2022-02-17 17:06:26] frigate.video INFO : esp_cam: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2022-02-17 17:06:26] frigate.video INFO : esp_cam: ffmpeg process is not running. exiting capture thread...
[2022-02-17 17:06:41] watchdog.esp_cam ERROR : FFMPEG process crashed unexpectedly for esp_cam.
[2022-02-17 17:06:41] watchdog.esp_cam ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
[2022-02-17 17:06:41] watchdog.esp_cam ERROR : You may have invalid args defined for this camera.
[2022-02-17 17:06:41] ffmpeg.esp_cam.detect ERROR : [tcp @ 0x55b2438eb0] Connection to tcp://192.168.178.44:8554?timeout=5000000 failed: Connection timed out
[2022-02-17 17:06:41] ffmpeg.esp_cam.detect ERROR : rtsp://192.168.178.44:8554/mjpeg/1: Connection timed out
[2022-02-17 17:06:46] frigate.video INFO : esp_cam: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structures
[2022-02-17 17:06:46] frigate.video INFO : esp_cam: ffmpeg process is not running. exiting capture thread...
[2022-02-17 17:06:51] watchdog.esp_cam ERROR : FFMPEG process crashed unexpectedly for esp_cam.
[2022-02-17 17:06:51] watchdog.esp_cam ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
What is wrong?
Has anybody an ideas or suggestion?
I see that you use my configuration posted a couple of months ago. What I can say about that is that it worked with an earlier release with Frigate but not with the current release anymore.
Using this configuration the current release produces the exact same error āesp_cam: ffmpeg sent a broken frame. memoryview assignment: lvalue and rvalue have different structuresā in my setup.
I didnāt have the time to troubleshoot this yet. Depending on how desperate you want to get it running you may downgrade your Frigate version. Another way would be to find out which ffmpeg parameters are required to get it running with the current version.
Not sure if you ended up updating the config for the new release of frigate but if not here it is
cameras:
ESP_32_CAM:
ffmpeg:
inputs:
- path: rtsp://Your_IP_Address:8554/mjpeg/1
roles:
- detect
detect:
# Optional: enables detection for the camera (default: True)
# This value can be set via MQTT and will be updated in startup based on retained value
enabled: True
# Optional: Number of frames without a detection before frigate considers an object to be gone. (default: 5x the frame rate)
# max_disappeared: 25
width: 640
height: 360
fps: 5
objects:
track:
- person
snapshots:
enabled: True
timestamp: True
bounding_box: false
retain:
default: 10
objects:
person: 15 # Per object retention days
rtmp:
# Required: Enable the live stream (default: True)
enabled: False
credits to @viertausend, @VijayS and others
I got mine to workā¦HA config and frigate.yml are as follows
HA:
Installed on generic x86-64
Home Assistant 2022.11.4
Supervisor 2022.11.2
Operating System 9.3
Frontend 20221108.0