Closed lcasale closed 2 years ago
Thanks for using the template! Can you share the log output of the proxy with the verbose flag enabled when the vehicle enters and exits the scene?
So I've done a little playing around and made some progress but still not finding what's causing the crash.
In frigate.py, I added one more condition to look for "vehicle" since I combined car, truck, motorcycle, etc objects as "vehicle" in frigate. This is to pickup the event from Frigate and shouldn't have any impact to Unifi Protect.
frigate.py
@classmethod
def label_to_object_type(cls, label: str) -> Optional[SmartDetectObjectType]:
if label == "person":
return SmartDetectObjectType.PERSON
elif label == "car":
return SmartDetectObjectType.CAR
elif label == "vehicle":
return SmartDetectObjectType.CAR
My frigate config
model:
labelmap:
2: vehicle
3: vehicle
5: vehicle
7: vehicle
15: animal
16: animal
17: animal
18: animal
19: animal
22: animal
I also modified base.py to change the SmartDetectObjectType enum CAR from "car" to "vehicle". When I did this, Unifi Protect picked up the correct vehicle event but still crashes on Android.
class SmartDetectObjectType(Enum):
PERSON = "person"
CAR = "vehicle"
I captured verbose logs with both CAR = "car" and CAR = "vehicle". _unifi-driveway_logs_CAR.txt _unifi-driveway_logs_VEHICLE.txt
Can you test out the newest version of the development docker image (keshavdv/unifi-cam-proxy:dev)? It has a few of the fixes you called out, but for me, the detection seems to work without crashing the app even for vehicles (version 1.4.8)
Confirmed vehicle detection is working and it's no longer crashing. I also updated my UNVR to 2.3.10 so not sure if that was the root cause. Thanks!
Describe the bug Does not seem vehicle detection is working properly. From the web client, it shows as a basic motion event. The Android app will crash if you try to view the camera timeline and the vehicle event is on the timeline (either by scrolling to the event or immediately if the event was recent enough.
To Reproduce Steps to reproduce the behavior:
Expected behavior The event should show as a vehicle event on all channels and Android should not crash
Screenshots
![Screenshot_20211231-100955](https://user-images.githubusercontent.com/2325106/147830050-c2e4d94b-8032-4d05-9ae7-064939b8447f.png)
Camera (please complete the following information):
ffmpeg -nostdin -y -stimeout 15000000 -rtsp_transport tcp -i "rtsp://xx.xx.xx.xx:554/cam/realmonitor?channel=1&subtype=0" -c:v copy -r 20 -g 40 -loglevel debug -bsf:v "h264_metadata=tick_rate=40" -c:a copy -metadata streamname=xPg5zFrxgcfAGpVw -f flv - | /usr/local/bin/python -m unifi.clock_sync | nc xx.xx.xx.xx 7550
Additional context Unifi OS: 2.2.12 Unifi Protect: 1.20.3 Android Unifi Protect: 1.4.8 Edit: Person smart detection events work fine across all channels.