Closed protocol6v closed 1 year ago
A few things:
detectors:
# Required: name of the detector
coral:
# Required: type of the detector
# Valid values are 'edgetpu' (requires device property below) and 'cpu'.
type: edgetpu
# Optional: device name as defined here: https://coral.ai/docs/edgetpu/multiple-edgetpu/#using-the-tensorflow-lite-python-api
device: usb
# Optional: num_threads value passed to the tflite.Interpreter (default: shown below)
# This value is only used for CPU types
num_threads: 4
there is no need for you to set num_threads as that option is not used for the USB coral.
I also noticed you haven't set detect -> height / width
for any of your cameras which means if those streams don't have a native size of 720x1080 then frigate is spending CPU resources resizing all streams to that size, so I'd recommend setting the actual sizes of those streams for each camera.
As far as the actual issues goes, what does the debug page show for camera, process, detection fps for the camera? What happens when you view the debug live view with bounding boxes enabled, do you see objects being tagged?
Thanks for the input! I have made those adjustments as recommended. Only downside now is the preview/live views for some cameras as stretched. Is there any fix for this to set the aspect ratio?
Back on the original issue: The debug page shows nearly identical statistics for the non-functioning camera as all the other cameras (Camera in issue is 10 Basement)...
In debug live view with bounding boxes, it says displaying at 5.0 fps but does not show anything, and does not display boxes when objects enter view, nor does it log a new detection event.
If I remove any one camera, 10 Basement starts working fine again. Seems to just be after adding an eleventh.
Only downside now is the preview/live views for some cameras as stretched. Is there any fix for this to set the aspect ratio?
If you set the size same as the native stream then it won't be stretched / resized at all, maybe an example of what you're talking about and the stream / config would be helpful.
What is your CPU usage at? Sounds like it or your hardware acceleration might be maxed out and not working for the extra camera. You might try setting
11_office:
ffmpeg:
hwaccel_args: []
for that camera and see if it works
That did the trick, but im not seeing very high CPU (Averages 45% highest) or GPU usage (Radeontop showing spikes of ~10% but generally running around 5%). Any ideas on what may be wrong there? It is a AMD w4100 for the hwaccel.
For the stretching, i changed the global detect config to this, as this is the dimension of the majority of the cameras:
detect:
# Optional: width of the frame for the input with the detect role (default: shown below)
width: 704
# Optional: height of the frame for the input with the detect role (default: shown below)
height: 480
# Optional: desired fps for your camera for the input with the detect role (default: shown below)
# NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
fps: 15
and for the other cameras, I specified their dimension in their individual configs such as:
11_Office:
detect:
width: 640
height: 480
ffmpeg:
hwaccel_args: []
Did I do this wrong?
an example of where you see the sretching might be helpful, you should also set the live -> height
individually for the cameras that don't match the global size.
That did the trick, but im not seeing very high CPU (Averages 45% highest) or GPU usage (Radeontop showing spikes of ~10% but generally running around 5%). Any ideas on what may be wrong there? It is a AMD w4100 for the hwaccel.
A GPU only has so many stream processors, it is not the case that it can go all the way to 100% use with as many streams as it takes to get there. Also depends where you're looking in radeontop, as that is more aggregated of different parts of the GPU meanwhile the stream processing is handled by a very specific hardware component.
Makes sense, thanks for explaining. I guess I will limit HW accell to 10 until I get a better card!
When not stretched (But yes, otherwise terrible quality)
When stretched:
And also birdseye has black bars on all camera sides now:
Whats throwing me off is that the height is the same on all cameras, it is the width that varies (either 704 or 640). I tried setting live dimension on them but didnt help.
I think you might be misunderstanding. 640x480 is not 16:9 it is 4:3 so actually the top image is the one that is stretched and the second image is what the camera is actually presenting. This is very common with dahua, amcrest, etc. cameras where the main stream is 16:9 and the sub stream is 4:3
assuming that the detect -> width / height are correct, frigate will not adjust the aspect ratio of the camera feed anywhere in the UI
Oh, i'm sure i am the problem here. So is there any way to "fix" this, or should I just revert back to how it was? It seems like the Detect is set correctly for each cameras substream resolution.
I mean if you prefer them all to be 16:9 you are more than welcome to set the resolution to 720x1080 (I'd still recommend setting it explicitly so it is clear how things are working when you view in the future). You only need to be aware that doing so will increase the CPU usage somewhat.
What I am not understanding is why when the resolution is set to the "correct" substream resolution, lets use the yardnortheast camera as an example, the image appears to be squished width wise or stretched vertically, but when the resolutions are not set, it displays properly? Even for cameras whos substream is 4:3, they display properly when the resolution is not explicitly set.
the image appears to be squished width wise or stretched vertically, but when the resolutions are not set, it displays properly? Even for cameras whos substream is 4:3, they display properly when the resolution is not explicitly set.
your definition of properly is incorrect in this context. If a stream is 4:3 and the detect resolution is set to the native value then it is showing exactly as the stream is coming from the camera. I'd encourage you to use VLC or some other RTSP viewer to view the sub stream and main stream directly, you'll notice the difference in aspect ratio because the camera is giving the substream to frigate with that squished view, frigate is not introducing it.
this of course makes sense, because the camera is presenting the sub stream as a 16:9 image frame that is 4:3 (in this case 640x480)
Here is an example directly from my amcrest camera
It seems like the issue is on what the camera is sending, as in the amcrest settings page, for the substream, it is set fto 640x480, but when I connected to it with VLC it is 16:9 not 4:3.
EDIT: yep, exactly what you showed.
So you can stretch the substream out by setting the resolution to something that is 16:9 (returning it to looking normal) but it will just use more CPU, unfortunately that is a camera issue if it doesn't offer a substream with 16:9 aspect ratio
This is definitely seems to be a camera issue, I'm just not wrapping my head around why its acting this way, as when I connect to either the main stream or substream with VLC, they both display (what i call "properly") in 16:9, even though the substream settings on the camera are supposed to be 640x480.
That's fine, but what does the media info in VLC show the resolution as for the sub stream? Odds are VLC is just stretching it back out for you
It does show as 640x480, actually. I'm going to keep digging into this to try to understand. VLC does seem to be "fixing" it, and if I scale the window up to the size of the main stream it matches up perfectly. If I set it to 4:3 it is squished.
Thank you for all your help!
Will go ahead and close this then as the frigate side seems to be resolved. Feel free to create a new issue if something else comes up
Describe the problem you are having
Added an eleventh camera, and the preview box, live view, and birdseye view all are blank/black. It does not create new detections/events, but does still perform full recordings.
Version
0.11.1-2eada21
Frigate config file
Relevant log output
FFprobe output from your camera
Frigate stats
No response
Operating system
Other Linux
Install method
Docker Compose
Coral version
USB
Network connection
Wired
Camera make and model
Amcrest IP4M
Any other information that may be helpful
Ubuntu 22.04, HW accel with AMD W4100