[Config Support]: How to crop a stream #19917
-
Describe the problem you are havingI have a Hikvision 4K H.265 stream (3840x2160) and I want to try running LPR on a rather small part of the stream (in order to preserve CPU and gain better resolution). Using #raw=-vf crop=687:1181:3157:350 I semi-successfully cropped the video:
I'm attaching JSON with the result of go2rtc probe, if it might be helpful. Any help would be appreciated. Version0.16.1 Frigate config filego2rtc:
streams:
stream4K:
- rtsp://user:[email protected]:554/Streaming/channels/101
cropped:
- ffmpeg:stream4K#video=h264#raw=-vf crop=687:1181:3157:350
cameras:
cropped:
enabled: true
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/cropped
roles:
- detect
detect:
enabled: true
width: 687
height: 1181
fps: 6
lpr:
enabled: true
mqtt:
enabled: false
ffmpeg:
hwaccel_args: preset-vaapi
detectors:
ov:
type: openvino
device: GPU
model:
model_type: yolonas
width: 320
height: 320
input_tensor: nchw
input_pixel_format: bgr
path: /config/yolo_nas_s.onnx
labelmap_path: /config/coco-80.txt
record:
enabled: true
retain:
days: 0
mode: motion
alerts:
retain:
days: 30
detections:
retain:
days: 30
review:
alerts:
labels:
- car
- motorcycle
- person
- bicycle
- dog
- cat
objects:
track:
- car
- motorcycle
- person
- bicycle
- dog
- cat
snapshots:
enabled: true
retain:
default: 30
version: 0.16-0
detect:
enabled: true
lpr:
enabled: true
device: GPU
debug_save_plates: trueRelevant Frigate log output2025-09-04 21:28:59.582488957 ERROR: Exception in ASGI application
2025-09-04 21:28:59.582492479 + Exception Group Traceback (most recent call last):
2025-09-04 21:28:59.582494123 | File "/usr/local/lib/python3.11/dist-packages/starlette/_utils.py", line 76, in collapse_excgroups
2025-09-04 21:28:59.582495264 | yield
2025-09-04 21:28:59.582496684 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 186, in __call__
2025-09-04 21:28:59.582497796 | async with anyio.create_task_group() as task_group:
2025-09-04 21:28:59.582499196 | File "/usr/local/lib/python3.11/dist-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
2025-09-04 21:28:59.582502387 | raise BaseExceptionGroup(
2025-09-04 21:28:59.582503534 | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
2025-09-04 21:28:59.582504477 +-+---------------- 1 ----------------
2025-09-04 21:28:59.582505381 | Traceback (most recent call last):
2025-09-04 21:28:59.582506693 | File "/usr/local/lib/python3.11/dist-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
2025-09-04 21:28:59.582507770 | result = await app( # type: ignore[func-returns-value]
2025-09-04 21:28:59.582508854 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582510235 | File "/usr/local/lib/python3.11/dist-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
2025-09-04 21:28:59.582511230 | return await self.app(scope, receive, send)
2025-09-04 21:28:59.582512156 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582513493 | File "/usr/local/lib/python3.11/dist-packages/fastapi/applications.py", line 1054, in __call__
2025-09-04 21:28:59.582514502 | await super().__call__(scope, receive, send)
2025-09-04 21:28:59.582515844 | File "/usr/local/lib/python3.11/dist-packages/starlette/applications.py", line 113, in __call__
2025-09-04 21:28:59.582516898 | await self.middleware_stack(scope, receive, send)
2025-09-04 21:28:59.582518240 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/errors.py", line 187, in __call__
2025-09-04 21:28:59.582519024 | raise exc
2025-09-04 21:28:59.582520383 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/errors.py", line 165, in __call__
2025-09-04 21:28:59.582521450 | await self.app(scope, receive, _send)
2025-09-04 21:28:59.582522783 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 185, in __call__
2025-09-04 21:28:59.582523703 | with collapse_excgroups():
2025-09-04 21:28:59.582524825 | File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__
2025-09-04 21:28:59.582525779 | self.gen.throw(typ, value, traceback)
2025-09-04 21:28:59.582527123 | File "/usr/local/lib/python3.11/dist-packages/starlette/_utils.py", line 82, in collapse_excgroups
2025-09-04 21:28:59.582527963 | raise exc
2025-09-04 21:28:59.582529310 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 187, in __call__
2025-09-04 21:28:59.582530403 | response = await self.dispatch_func(request, call_next)
2025-09-04 21:28:59.582531422 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582532654 | File "/usr/local/lib/python3.11/dist-packages/slowapi/middleware.py", line 124, in dispatch
2025-09-04 21:28:59.582533645 | return await call_next(request)
2025-09-04 21:28:59.582534609 | ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582535907 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 163, in call_next
2025-09-04 21:28:59.582536732 | raise app_exc
2025-09-04 21:28:59.582537986 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 149, in coro
2025-09-04 21:28:59.582539043 | await self.app(scope, receive_or_disconnect, send_no_error)
2025-09-04 21:28:59.582540376 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 185, in __call__
2025-09-04 21:28:59.582541371 | with collapse_excgroups():
2025-09-04 21:28:59.582542509 | File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__
2025-09-04 21:28:59.582543383 | self.gen.throw(typ, value, traceback)
2025-09-04 21:28:59.582544667 | File "/usr/local/lib/python3.11/dist-packages/starlette/_utils.py", line 82, in collapse_excgroups
2025-09-04 21:28:59.582545482 | raise exc
2025-09-04 21:28:59.582546821 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 187, in __call__
2025-09-04 21:28:59.582547876 | response = await self.dispatch_func(request, call_next)
2025-09-04 21:28:59.582548944 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582550120 | File "/opt/frigate/frigate/api/fastapi_app.py", line 89, in frigate_middleware
2025-09-04 21:28:59.582551031 | response = await call_next(request)
2025-09-04 21:28:59.582551934 | ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582553218 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 163, in call_next
2025-09-04 21:28:59.582554091 | raise app_exc
2025-09-04 21:28:59.582555378 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 149, in coro
2025-09-04 21:28:59.582556468 | await self.app(scope, receive_or_disconnect, send_no_error)
2025-09-04 21:28:59.582557791 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 185, in __call__
2025-09-04 21:28:59.582558646 | with collapse_excgroups():
2025-09-04 21:28:59.582559714 | File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__
2025-09-04 21:28:59.582560595 | self.gen.throw(typ, value, traceback)
2025-09-04 21:28:59.582561884 | File "/usr/local/lib/python3.11/dist-packages/starlette/_utils.py", line 82, in collapse_excgroups
2025-09-04 21:28:59.582562639 | raise exc
2025-09-04 21:28:59.582563921 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 187, in __call__
2025-09-04 21:28:59.582564993 | response = await self.dispatch_func(request, call_next)
2025-09-04 21:28:59.582566008 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582567431 | File "/usr/local/lib/python3.11/dist-packages/starlette_context/middleware/context_middleware.py", line 78, in dispatch
2025-09-04 21:28:59.582568329 | response = await call_next(request)
2025-09-04 21:28:59.582569190 | ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582570467 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 163, in call_next
2025-09-04 21:28:59.582571231 | raise app_exc
2025-09-04 21:28:59.582572520 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 149, in coro
2025-09-04 21:28:59.582573624 | await self.app(scope, receive_or_disconnect, send_no_error)
2025-09-04 21:28:59.582574935 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/exceptions.py", line 62, in __call__
2025-09-04 21:28:59.582576122 | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2025-09-04 21:28:59.582577456 | File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2025-09-04 21:28:59.582578234 | raise exc
2025-09-04 21:28:59.582579531 | File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-09-04 21:28:59.582580461 | await app(scope, receive, sender)
2025-09-04 21:28:59.582581731 | File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 715, in __call__
2025-09-04 21:28:59.582582704 | await self.middleware_stack(scope, receive, send)
2025-09-04 21:28:59.582583909 | File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 735, in app
2025-09-04 21:28:59.582584829 | await route.handle(scope, receive, send)
2025-09-04 21:28:59.582586009 | File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 288, in handle
2025-09-04 21:28:59.582586937 | await self.app(scope, receive, send)
2025-09-04 21:28:59.582588271 | File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 76, in app
2025-09-04 21:28:59.582589421 | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2025-09-04 21:28:59.582590834 | File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2025-09-04 21:28:59.582591594 | raise exc
2025-09-04 21:28:59.582592883 | File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-09-04 21:28:59.582593817 | await app(scope, receive, sender)
2025-09-04 21:28:59.582595072 | File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 73, in app
2025-09-04 21:28:59.582595979 | response = await f(request)
2025-09-04 21:28:59.582596821 | ^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582598013 | File "/usr/local/lib/python3.11/dist-packages/fastapi/routing.py", line 301, in app
2025-09-04 21:28:59.582598961 | raw_response = await run_endpoint_function(
2025-09-04 21:28:59.582599884 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582601186 | File "/usr/local/lib/python3.11/dist-packages/fastapi/routing.py", line 214, in run_endpoint_function
2025-09-04 21:28:59.582602217 | return await run_in_threadpool(dependant.call, **values)
2025-09-04 21:28:59.582603247 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582604555 | File "/usr/local/lib/python3.11/dist-packages/starlette/concurrency.py", line 39, in run_in_threadpool
2025-09-04 21:28:59.582605569 | return await anyio.to_thread.run_sync(func, *args)
2025-09-04 21:28:59.582606593 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582607804 | File "/usr/local/lib/python3.11/dist-packages/anyio/to_thread.py", line 56, in run_sync
2025-09-04 21:28:59.582608875 | return await get_async_backend().run_sync_in_worker_thread(
2025-09-04 21:28:59.582609884 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582611240 | File "/usr/local/lib/python3.11/dist-packages/anyio/_backends/_asyncio.py", line 2476, in run_sync_in_worker_thread
2025-09-04 21:28:59.582612055 | return await future
2025-09-04 21:28:59.582612819 | ^^^^^^^^^^^^
2025-09-04 21:28:59.582614024 | File "/usr/local/lib/python3.11/dist-packages/anyio/_backends/_asyncio.py", line 967, in run
2025-09-04 21:28:59.582614918 | result = context.run(func, *args)
2025-09-04 21:28:59.582615788 | ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582616863 | File "/opt/frigate/frigate/api/media.py", line 154, in latest_frame
2025-09-04 21:28:59.582617981 | frame = frame_processor.get_current_frame(camera_name, draw_options)
2025-09-04 21:28:59.582667888 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582669676 | File "/opt/frigate/frigate/track/object_processing.py", line 324, in get_current_frame
2025-09-04 21:28:59.582670982 | return self.camera_states[camera].get_current_frame(draw_options)
2025-09-04 21:28:59.582672096 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582673346 | File "/opt/frigate/frigate/camera/state.py", line 65, in get_current_frame
2025-09-04 21:28:59.582674432 | frame_copy = cv2.cvtColor(frame_copy, cv2.COLOR_YUV2BGR_I420)
2025-09-04 21:28:59.582675489 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582677304 | cv2.error: OpenCV(4.11.0) /io/opencv/modules/imgproc/src/color.simd_helpers.hpp:108: error: (-215:Assertion failed) sz.width % 2 == 0 && sz.height % 3 == 0 in function 'CvtHelper'
2025-09-04 21:28:59.582677985 |
2025-09-04 21:28:59.582678897 +------------------------------------
2025-09-04 21:28:59.582679490
2025-09-04 21:28:59.582680542 During handling of the above exception, another exception occurred:
2025-09-04 21:28:59.582681191
2025-09-04 21:28:59.582682038 Traceback (most recent call last):
2025-09-04 21:28:59.582683372 File "/usr/local/lib/python3.11/dist-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
2025-09-04 21:28:59.582684366 result = await app( # type: ignore[func-returns-value]
2025-09-04 21:28:59.582685333 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582686555 File "/usr/local/lib/python3.11/dist-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
2025-09-04 21:28:59.582687427 return await self.app(scope, receive, send)
2025-09-04 21:28:59.582688317 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582689521 File "/usr/local/lib/python3.11/dist-packages/fastapi/applications.py", line 1054, in __call__
2025-09-04 21:28:59.582690508 await super().__call__(scope, receive, send)
2025-09-04 21:28:59.582691742 File "/usr/local/lib/python3.11/dist-packages/starlette/applications.py", line 113, in __call__
2025-09-04 21:28:59.582692761 await self.middleware_stack(scope, receive, send)
2025-09-04 21:28:59.582694029 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/errors.py", line 187, in __call__
2025-09-04 21:28:59.582694767 raise exc
2025-09-04 21:28:59.582696025 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/errors.py", line 165, in __call__
2025-09-04 21:28:59.582696911 await self.app(scope, receive, _send)
2025-09-04 21:28:59.582698172 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 185, in __call__
2025-09-04 21:28:59.582698986 with collapse_excgroups():
2025-09-04 21:28:59.582699958 File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__
2025-09-04 21:28:59.582700768 self.gen.throw(typ, value, traceback)
2025-09-04 21:28:59.582702017 File "/usr/local/lib/python3.11/dist-packages/starlette/_utils.py", line 82, in collapse_excgroups
2025-09-04 21:28:59.582702779 raise exc
2025-09-04 21:28:59.582704032 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 187, in __call__
2025-09-04 21:28:59.582705036 response = await self.dispatch_func(request, call_next)
2025-09-04 21:28:59.582706001 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582707185 File "/usr/local/lib/python3.11/dist-packages/slowapi/middleware.py", line 124, in dispatch
2025-09-04 21:28:59.582708066 return await call_next(request)
2025-09-04 21:28:59.582708896 ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582710125 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 163, in call_next
2025-09-04 21:28:59.582710888 raise app_exc
2025-09-04 21:28:59.582712109 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 149, in coro
2025-09-04 21:28:59.582713109 await self.app(scope, receive_or_disconnect, send_no_error)
2025-09-04 21:28:59.582714342 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 185, in __call__
2025-09-04 21:28:59.582715237 with collapse_excgroups():
2025-09-04 21:28:59.582716282 File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__
2025-09-04 21:28:59.582717127 self.gen.throw(typ, value, traceback)
2025-09-04 21:28:59.582718345 File "/usr/local/lib/python3.11/dist-packages/starlette/_utils.py", line 82, in collapse_excgroups
2025-09-04 21:28:59.582719055 raise exc
2025-09-04 21:28:59.582720290 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 187, in __call__
2025-09-04 21:28:59.582721288 response = await self.dispatch_func(request, call_next)
2025-09-04 21:28:59.582722252 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582723346 File "/opt/frigate/frigate/api/fastapi_app.py", line 89, in frigate_middleware
2025-09-04 21:28:59.582724210 response = await call_next(request)
2025-09-04 21:28:59.582725058 ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582726299 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 163, in call_next
2025-09-04 21:28:59.582727054 raise app_exc
2025-09-04 21:28:59.582728230 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 149, in coro
2025-09-04 21:28:59.582729179 await self.app(scope, receive_or_disconnect, send_no_error)
2025-09-04 21:28:59.582730426 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 185, in __call__
2025-09-04 21:28:59.582731281 with collapse_excgroups():
2025-09-04 21:28:59.582732298 File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__
2025-09-04 21:28:59.582733155 self.gen.throw(typ, value, traceback)
2025-09-04 21:28:59.582734382 File "/usr/local/lib/python3.11/dist-packages/starlette/_utils.py", line 82, in collapse_excgroups
2025-09-04 21:28:59.582735122 raise exc
2025-09-04 21:28:59.582736368 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 187, in __call__
2025-09-04 21:28:59.582737334 response = await self.dispatch_func(request, call_next)
2025-09-04 21:28:59.582738292 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582739642 File "/usr/local/lib/python3.11/dist-packages/starlette_context/middleware/context_middleware.py", line 78, in dispatch
2025-09-04 21:28:59.582740500 response = await call_next(request)
2025-09-04 21:28:59.582741340 ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582742590 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 163, in call_next
2025-09-04 21:28:59.582743326 raise app_exc
2025-09-04 21:28:59.582744529 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 149, in coro
2025-09-04 21:28:59.582745560 await self.app(scope, receive_or_disconnect, send_no_error)
2025-09-04 21:28:59.582746838 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/exceptions.py", line 62, in __call__
2025-09-04 21:28:59.582747934 await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2025-09-04 21:28:59.582749158 File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2025-09-04 21:28:59.582749867 raise exc
2025-09-04 21:28:59.582751150 File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-09-04 21:28:59.582751994 await app(scope, receive, sender)
2025-09-04 21:28:59.582753163 File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 715, in __call__
2025-09-04 21:28:59.582754087 await self.middleware_stack(scope, receive, send)
2025-09-04 21:28:59.582755225 File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 735, in app
2025-09-04 21:28:59.582756127 await route.handle(scope, receive, send)
2025-09-04 21:28:59.582757270 File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 288, in handle
2025-09-04 21:28:59.582758142 await self.app(scope, receive, send)
2025-09-04 21:28:59.582759291 File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 76, in app
2025-09-04 21:28:59.582760391 await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2025-09-04 21:28:59.582761622 File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2025-09-04 21:28:59.582762343 raise exc
2025-09-04 21:28:59.582763664 File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-09-04 21:28:59.582764553 await app(scope, receive, sender)
2025-09-04 21:28:59.582765696 File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 73, in app
2025-09-04 21:28:59.582766520 response = await f(request)
2025-09-04 21:28:59.582767313 ^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582768470 File "/usr/local/lib/python3.11/dist-packages/fastapi/routing.py", line 301, in app
2025-09-04 21:28:59.582769413 raw_response = await run_endpoint_function(
2025-09-04 21:28:59.582770312 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582771575 File "/usr/local/lib/python3.11/dist-packages/fastapi/routing.py", line 214, in run_endpoint_function
2025-09-04 21:28:59.582772567 return await run_in_threadpool(dependant.call, **values)
2025-09-04 21:28:59.582773540 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582774781 File "/usr/local/lib/python3.11/dist-packages/starlette/concurrency.py", line 39, in run_in_threadpool
2025-09-04 21:28:59.582775763 return await anyio.to_thread.run_sync(func, *args)
2025-09-04 21:28:59.582776692 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582777855 File "/usr/local/lib/python3.11/dist-packages/anyio/to_thread.py", line 56, in run_sync
2025-09-04 21:28:59.582778842 return await get_async_backend().run_sync_in_worker_thread(
2025-09-04 21:28:59.582779826 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582781131 File "/usr/local/lib/python3.11/dist-packages/anyio/_backends/_asyncio.py", line 2476, in run_sync_in_worker_thread
2025-09-04 21:28:59.582781886 return await future
2025-09-04 21:28:59.582782604 ^^^^^^^^^^^^
2025-09-04 21:28:59.582783789 File "/usr/local/lib/python3.11/dist-packages/anyio/_backends/_asyncio.py", line 967, in run
2025-09-04 21:28:59.582784681 result = context.run(func, *args)
2025-09-04 21:28:59.582785500 ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582786502 File "/opt/frigate/frigate/api/media.py", line 154, in latest_frame
2025-09-04 21:28:59.582787600 frame = frame_processor.get_current_frame(camera_name, draw_options)
2025-09-04 21:28:59.582788691 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582789839 File "/opt/frigate/frigate/track/object_processing.py", line 324, in get_current_frame
2025-09-04 21:28:59.582790872 return self.camera_states[camera].get_current_frame(draw_options)
2025-09-04 21:28:59.582791868 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582792941 File "/opt/frigate/frigate/camera/state.py", line 65, in get_current_frame
2025-09-04 21:28:59.582794007 frame_copy = cv2.cvtColor(frame_copy, cv2.COLOR_YUV2BGR_I420)
2025-09-04 21:28:59.582808807 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.582811033 cv2.error: OpenCV(4.11.0) /io/opencv/modules/imgproc/src/color.simd_helpers.hpp:108: error: (-215:Assertion failed) sz.width % 2 == 0 && sz.height % 3 == 0 in function 'CvtHelper'
2025-09-04 21:28:59.582811736
2025-09-04 21:28:59.662871523 ERROR: Exception in ASGI application
2025-09-04 21:28:59.662877441 + Exception Group Traceback (most recent call last):
2025-09-04 21:28:59.662879127 | File "/usr/local/lib/python3.11/dist-packages/starlette/_utils.py", line 76, in collapse_excgroups
2025-09-04 21:28:59.662880122 | yield
2025-09-04 21:28:59.662881577 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 186, in __call__
2025-09-04 21:28:59.662882649 | async with anyio.create_task_group() as task_group:
2025-09-04 21:28:59.662883943 | File "/usr/local/lib/python3.11/dist-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
2025-09-04 21:28:59.662884795 | raise BaseExceptionGroup(
2025-09-04 21:28:59.662885849 | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
2025-09-04 21:28:59.662886777 +-+---------------- 1 ----------------
2025-09-04 21:28:59.662887654 | Traceback (most recent call last):
2025-09-04 21:28:59.662888980 | File "/usr/local/lib/python3.11/dist-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
2025-09-04 21:28:59.662889982 | result = await app( # type: ignore[func-returns-value]
2025-09-04 21:28:59.662890990 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.662892353 | File "/usr/local/lib/python3.11/dist-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
2025-09-04 21:28:59.662893336 | return await self.app(scope, receive, send)
2025-09-04 21:28:59.662894291 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.662895605 | File "/usr/local/lib/python3.11/dist-packages/fastapi/applications.py", line 1054, in __call__
2025-09-04 21:28:59.662896535 | await super().__call__(scope, receive, send)
2025-09-04 21:28:59.662897780 | File "/usr/local/lib/python3.11/dist-packages/starlette/applications.py", line 113, in __call__
2025-09-04 21:28:59.662898771 | await self.middleware_stack(scope, receive, send)
2025-09-04 21:28:59.662900073 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/errors.py", line 187, in __call__
2025-09-04 21:28:59.662900807 | raise exc
2025-09-04 21:28:59.662902111 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/errors.py", line 165, in __call__
2025-09-04 21:28:59.662903099 | await self.app(scope, receive, _send)
2025-09-04 21:28:59.662904421 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 185, in __call__
2025-09-04 21:28:59.662905263 | with collapse_excgroups():
2025-09-04 21:28:59.662906343 | File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__
2025-09-04 21:28:59.662907213 | self.gen.throw(typ, value, traceback)
2025-09-04 21:28:59.662908535 | File "/usr/local/lib/python3.11/dist-packages/starlette/_utils.py", line 82, in collapse_excgroups
2025-09-04 21:28:59.662909297 | raise exc
2025-09-04 21:28:59.662910704 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 187, in __call__
2025-09-04 21:28:59.662911788 | response = await self.dispatch_func(request, call_next)
2025-09-04 21:28:59.662912887 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.662914105 | File "/usr/local/lib/python3.11/dist-packages/slowapi/middleware.py", line 124, in dispatch
2025-09-04 21:28:59.662915014 | return await call_next(request)
2025-09-04 21:28:59.662915906 | ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.662917158 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 163, in call_next
2025-09-04 21:28:59.662917941 | raise app_exc
2025-09-04 21:28:59.662919127 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 149, in coro
2025-09-04 21:28:59.662920208 | await self.app(scope, receive_or_disconnect, send_no_error)
2025-09-04 21:28:59.662921497 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 185, in __call__
2025-09-04 21:28:59.662922408 | with collapse_excgroups():
2025-09-04 21:28:59.662923474 | File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__
2025-09-04 21:28:59.662924349 | self.gen.throw(typ, value, traceback)
2025-09-04 21:28:59.662925621 | File "/usr/local/lib/python3.11/dist-packages/starlette/_utils.py", line 82, in collapse_excgroups
2025-09-04 21:28:59.662926422 | raise exc
2025-09-04 21:28:59.662927868 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 187, in __call__
2025-09-04 21:28:59.662928843 | response = await self.dispatch_func(request, call_next)
2025-09-04 21:28:59.662929880 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.662931059 | File "/opt/frigate/frigate/api/fastapi_app.py", line 89, in frigate_middleware
2025-09-04 21:28:59.662931964 | response = await call_next(request)
2025-09-04 21:28:59.662932827 | ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.662934175 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 163, in call_next
2025-09-04 21:28:59.662934992 | raise app_exc
2025-09-04 21:28:59.662936315 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 149, in coro
2025-09-04 21:28:59.662937337 | await self.app(scope, receive_or_disconnect, send_no_error)
2025-09-04 21:28:59.662938612 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 185, in __call__
2025-09-04 21:28:59.662939479 | with collapse_excgroups():
2025-09-04 21:28:59.662940544 | File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__
2025-09-04 21:28:59.662941393 | self.gen.throw(typ, value, traceback)
2025-09-04 21:28:59.662942615 | File "/usr/local/lib/python3.11/dist-packages/starlette/_utils.py", line 82, in collapse_excgroups
2025-09-04 21:28:59.662943377 | raise exc
2025-09-04 21:28:59.662944576 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 187, in __call__
2025-09-04 21:28:59.662945623 | response = await self.dispatch_func(request, call_next)
2025-09-04 21:28:59.662946613 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.662948064 | File "/usr/local/lib/python3.11/dist-packages/starlette_context/middleware/context_middleware.py", line 78, in dispatch
2025-09-04 21:28:59.662948977 | response = await call_next(request)
2025-09-04 21:28:59.662949898 | ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.662951212 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 163, in call_next
2025-09-04 21:28:59.662951912 | raise app_exc
2025-09-04 21:28:59.662953149 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 149, in coro
2025-09-04 21:28:59.662954243 | await self.app(scope, receive_or_disconnect, send_no_error)
2025-09-04 21:28:59.662955864 | File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/exceptions.py", line 62, in __call__
2025-09-04 21:28:59.662957033 | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2025-09-04 21:28:59.662958397 | File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2025-09-04 21:28:59.662959131 | raise exc
2025-09-04 21:28:59.662960461 | File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-09-04 21:28:59.662961358 | await app(scope, receive, sender)
2025-09-04 21:28:59.662962604 | File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 715, in __call__
2025-09-04 21:28:59.662963628 | await self.middleware_stack(scope, receive, send)
2025-09-04 21:28:59.662964838 | File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 735, in app
2025-09-04 21:28:59.662966492 | await route.handle(scope, receive, send)
2025-09-04 21:28:59.662967841 | File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 288, in handle
2025-09-04 21:28:59.662968849 | await self.app(scope, receive, send)
2025-09-04 21:28:59.662970139 | File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 76, in app
2025-09-04 21:28:59.662971334 | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2025-09-04 21:28:59.662972717 | File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2025-09-04 21:28:59.662973511 | raise exc
2025-09-04 21:28:59.662974839 | File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-09-04 21:28:59.662975765 | await app(scope, receive, sender)
2025-09-04 21:28:59.662977053 | File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 73, in app
2025-09-04 21:28:59.662977911 | response = await f(request)
2025-09-04 21:28:59.662978734 | ^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.662979879 | File "/usr/local/lib/python3.11/dist-packages/fastapi/routing.py", line 301, in app
2025-09-04 21:28:59.662980860 | raw_response = await run_endpoint_function(
2025-09-04 21:28:59.662981844 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.662983222 | File "/usr/local/lib/python3.11/dist-packages/fastapi/routing.py", line 214, in run_endpoint_function
2025-09-04 21:28:59.662984254 | return await run_in_threadpool(dependant.call, **values)
2025-09-04 21:28:59.662985359 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.662986762 | File "/usr/local/lib/python3.11/dist-packages/starlette/concurrency.py", line 39, in run_in_threadpool
2025-09-04 21:28:59.662987903 | return await anyio.to_thread.run_sync(func, *args)
2025-09-04 21:28:59.662988971 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.662990212 | File "/usr/local/lib/python3.11/dist-packages/anyio/to_thread.py", line 56, in run_sync
2025-09-04 21:28:59.662991374 | return await get_async_backend().run_sync_in_worker_thread(
2025-09-04 21:28:59.662992357 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.662993648 | File "/usr/local/lib/python3.11/dist-packages/anyio/_backends/_asyncio.py", line 2476, in run_sync_in_worker_thread
2025-09-04 21:28:59.662994452 | return await future
2025-09-04 21:28:59.662995211 | ^^^^^^^^^^^^
2025-09-04 21:28:59.662996472 | File "/usr/local/lib/python3.11/dist-packages/anyio/_backends/_asyncio.py", line 967, in run
2025-09-04 21:28:59.662997315 | result = context.run(func, *args)
2025-09-04 21:28:59.662998181 | ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.662999220 | File "/opt/frigate/frigate/api/media.py", line 154, in latest_frame
2025-09-04 21:28:59.663000985 | frame = frame_processor.get_current_frame(camera_name, draw_options)
2025-09-04 21:28:59.663069473 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663071675 | File "/opt/frigate/frigate/track/object_processing.py", line 324, in get_current_frame
2025-09-04 21:28:59.663072817 | return self.camera_states[camera].get_current_frame(draw_options)
2025-09-04 21:28:59.663073873 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663075050 | File "/opt/frigate/frigate/camera/state.py", line 65, in get_current_frame
2025-09-04 21:28:59.663076111 | frame_copy = cv2.cvtColor(frame_copy, cv2.COLOR_YUV2BGR_I420)
2025-09-04 21:28:59.663077081 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663078823 | cv2.error: OpenCV(4.11.0) /io/opencv/modules/imgproc/src/color.simd_helpers.hpp:108: error: (-215:Assertion failed) sz.width % 2 == 0 && sz.height % 3 == 0 in function 'CvtHelper'
2025-09-04 21:28:59.663079508 |
2025-09-04 21:28:59.663080356 +------------------------------------
2025-09-04 21:28:59.663080957
2025-09-04 21:28:59.663081963 During handling of the above exception, another exception occurred:
2025-09-04 21:28:59.663082564
2025-09-04 21:28:59.663083392 Traceback (most recent call last):
2025-09-04 21:28:59.663084706 File "/usr/local/lib/python3.11/dist-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
2025-09-04 21:28:59.663085673 result = await app( # type: ignore[func-returns-value]
2025-09-04 21:28:59.663086598 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663087813 File "/usr/local/lib/python3.11/dist-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
2025-09-04 21:28:59.663088701 return await self.app(scope, receive, send)
2025-09-04 21:28:59.663089590 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663090770 File "/usr/local/lib/python3.11/dist-packages/fastapi/applications.py", line 1054, in __call__
2025-09-04 21:28:59.663091717 await super().__call__(scope, receive, send)
2025-09-04 21:28:59.663093020 File "/usr/local/lib/python3.11/dist-packages/starlette/applications.py", line 113, in __call__
2025-09-04 21:28:59.663094006 await self.middleware_stack(scope, receive, send)
2025-09-04 21:28:59.663095140 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/errors.py", line 187, in __call__
2025-09-04 21:28:59.663095841 raise exc
2025-09-04 21:28:59.663097002 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/errors.py", line 165, in __call__
2025-09-04 21:28:59.663097849 await self.app(scope, receive, _send)
2025-09-04 21:28:59.663099075 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 185, in __call__
2025-09-04 21:28:59.663099885 with collapse_excgroups():
2025-09-04 21:28:59.663100822 File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__
2025-09-04 21:28:59.663101656 self.gen.throw(typ, value, traceback)
2025-09-04 21:28:59.663102817 File "/usr/local/lib/python3.11/dist-packages/starlette/_utils.py", line 82, in collapse_excgroups
2025-09-04 21:28:59.663103533 raise exc
2025-09-04 21:28:59.663104746 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 187, in __call__
2025-09-04 21:28:59.663105757 response = await self.dispatch_func(request, call_next)
2025-09-04 21:28:59.663106640 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663107820 File "/usr/local/lib/python3.11/dist-packages/slowapi/middleware.py", line 124, in dispatch
2025-09-04 21:28:59.663108597 return await call_next(request)
2025-09-04 21:28:59.663109395 ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663110574 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 163, in call_next
2025-09-04 21:28:59.663111316 raise app_exc
2025-09-04 21:28:59.663112466 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 149, in coro
2025-09-04 21:28:59.663113430 await self.app(scope, receive_or_disconnect, send_no_error)
2025-09-04 21:28:59.663114636 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 185, in __call__
2025-09-04 21:28:59.663115457 with collapse_excgroups():
2025-09-04 21:28:59.663116433 File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__
2025-09-04 21:28:59.663117232 self.gen.throw(typ, value, traceback)
2025-09-04 21:28:59.663118392 File "/usr/local/lib/python3.11/dist-packages/starlette/_utils.py", line 82, in collapse_excgroups
2025-09-04 21:28:59.663119078 raise exc
2025-09-04 21:28:59.663120253 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 187, in __call__
2025-09-04 21:28:59.663121204 response = await self.dispatch_func(request, call_next)
2025-09-04 21:28:59.663122158 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663123263 File "/opt/frigate/frigate/api/fastapi_app.py", line 89, in frigate_middleware
2025-09-04 21:28:59.663124092 response = await call_next(request)
2025-09-04 21:28:59.663124906 ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663126084 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 163, in call_next
2025-09-04 21:28:59.663126794 raise app_exc
2025-09-04 21:28:59.663127967 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 149, in coro
2025-09-04 21:28:59.663128925 await self.app(scope, receive_or_disconnect, send_no_error)
2025-09-04 21:28:59.663130102 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 185, in __call__
2025-09-04 21:28:59.663131020 with collapse_excgroups():
2025-09-04 21:28:59.663131982 File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__
2025-09-04 21:28:59.663132837 self.gen.throw(typ, value, traceback)
2025-09-04 21:28:59.663134002 File "/usr/local/lib/python3.11/dist-packages/starlette/_utils.py", line 82, in collapse_excgroups
2025-09-04 21:28:59.663134667 raise exc
2025-09-04 21:28:59.663135833 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 187, in __call__
2025-09-04 21:28:59.663136817 response = await self.dispatch_func(request, call_next)
2025-09-04 21:28:59.663137708 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663139018 File "/usr/local/lib/python3.11/dist-packages/starlette_context/middleware/context_middleware.py", line 78, in dispatch
2025-09-04 21:28:59.663139828 response = await call_next(request)
2025-09-04 21:28:59.663140655 ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663141845 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 163, in call_next
2025-09-04 21:28:59.663142531 raise app_exc
2025-09-04 21:28:59.663143670 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/base.py", line 149, in coro
2025-09-04 21:28:59.663169009 await self.app(scope, receive_or_disconnect, send_no_error)
2025-09-04 21:28:59.663170392 File "/usr/local/lib/python3.11/dist-packages/starlette/middleware/exceptions.py", line 62, in __call__
2025-09-04 21:28:59.663171471 await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2025-09-04 21:28:59.663172662 File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2025-09-04 21:28:59.663173347 raise exc
2025-09-04 21:28:59.663174558 File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-09-04 21:28:59.663175360 await app(scope, receive, sender)
2025-09-04 21:28:59.663176495 File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 715, in __call__
2025-09-04 21:28:59.663177411 await self.middleware_stack(scope, receive, send)
2025-09-04 21:28:59.663178504 File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 735, in app
2025-09-04 21:28:59.663179390 await route.handle(scope, receive, send)
2025-09-04 21:28:59.663180515 File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 288, in handle
2025-09-04 21:28:59.663181337 await self.app(scope, receive, send)
2025-09-04 21:28:59.663182477 File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 76, in app
2025-09-04 21:28:59.663183555 await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2025-09-04 21:28:59.663184840 File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2025-09-04 21:28:59.663185566 raise exc
2025-09-04 21:28:59.663186773 File "/usr/local/lib/python3.11/dist-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-09-04 21:28:59.663187555 await app(scope, receive, sender)
2025-09-04 21:28:59.663188667 File "/usr/local/lib/python3.11/dist-packages/starlette/routing.py", line 73, in app
2025-09-04 21:28:59.663189435 response = await f(request)
2025-09-04 21:28:59.663190167 ^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663191269 File "/usr/local/lib/python3.11/dist-packages/fastapi/routing.py", line 301, in app
2025-09-04 21:28:59.663192184 raw_response = await run_endpoint_function(
2025-09-04 21:28:59.663193041 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663194242 File "/usr/local/lib/python3.11/dist-packages/fastapi/routing.py", line 214, in run_endpoint_function
2025-09-04 21:28:59.663195182 return await run_in_threadpool(dependant.call, **values)
2025-09-04 21:28:59.663196126 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663197320 File "/usr/local/lib/python3.11/dist-packages/starlette/concurrency.py", line 39, in run_in_threadpool
2025-09-04 21:28:59.663198231 return await anyio.to_thread.run_sync(func, *args)
2025-09-04 21:28:59.663199130 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663200298 File "/usr/local/lib/python3.11/dist-packages/anyio/to_thread.py", line 56, in run_sync
2025-09-04 21:28:59.663201255 return await get_async_backend().run_sync_in_worker_thread(
2025-09-04 21:28:59.663202207 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663203486 File "/usr/local/lib/python3.11/dist-packages/anyio/_backends/_asyncio.py", line 2476, in run_sync_in_worker_thread
2025-09-04 21:28:59.663204218 return await future
2025-09-04 21:28:59.663204896 ^^^^^^^^^^^^
2025-09-04 21:28:59.663206016 File "/usr/local/lib/python3.11/dist-packages/anyio/_backends/_asyncio.py", line 967, in run
2025-09-04 21:28:59.663206822 result = context.run(func, *args)
2025-09-04 21:28:59.663207603 ^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663208549 File "/opt/frigate/frigate/api/media.py", line 154, in latest_frame
2025-09-04 21:28:59.663209589 frame = frame_processor.get_current_frame(camera_name, draw_options)
2025-09-04 21:28:59.663210620 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663211728 File "/opt/frigate/frigate/track/object_processing.py", line 324, in get_current_frame
2025-09-04 21:28:59.663212687 return self.camera_states[camera].get_current_frame(draw_options)
2025-09-04 21:28:59.663213663 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663214683 File "/opt/frigate/frigate/camera/state.py", line 65, in get_current_frame
2025-09-04 21:28:59.663215704 frame_copy = cv2.cvtColor(frame_copy, cv2.COLOR_YUV2BGR_I420)
2025-09-04 21:28:59.663232928 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-04 21:28:59.663234835 cv2.error: OpenCV(4.11.0) /io/opencv/modules/imgproc/src/color.simd_helpers.hpp:108: error: (-215:Assertion failed) sz.width % 2 == 0 && sz.height % 3 == 0 in function 'CvtHelper'
2025-09-04 21:28:59.663235521Relevant go2rtc log outputnoneFrigate statsNo response Operating systemHome Assistant OS Install methodHome Assistant Add-on docker-compose file or Docker CLI command-Object DetectorOpenVino Screenshots of the Frigate UI's System metrics pagesNo response Any other information that may be helpful |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
The error you're encountering is related to OpenCV's color conversion requirements. The error For proper cropping with go2rtc, you can use FFmpeg parameters in your stream configuration. The documentation shows how to re-encode video using FFmpeg parameters, which supports rotating and resizing video feeds (1). Here's the correct approach for cropping streams: go2rtc:
streams:
stream4K:
- rtsp://user:[email protected]:554/Streaming/channels/101
cropped:
- "ffmpeg:stream4K#video=h264#raw=-vf crop=687:1181:3157:350#hardware"The key issue is that your cropped dimensions need to be compatible with OpenCV's color space conversion. For YUV420 format, the width must be even and the height must be divisible by 3. Your current dimensions (687x1181) don't meet these requirements:
You should adjust your crop parameters to use compatible dimensions. For example, you could crop to 686x1182 or 688x1179 to meet the requirements. Additionally, when using FFmpeg for transcoding, keep in mind that this is a resource-intensive task (1). For LPR purposes, you might also want to ensure your detect stream resolution matches your cropped dimensions (2): cameras:
cropped:
detect:
width: 686 # Adjusted to be even
height: 1182 # Adjusted to be divisible by 3📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
The error you're encountering is related to OpenCV's color conversion requirements. The error
sz.width % 2 == 0 && sz.height % 3 == 0indicates that your cropped dimensions (687x1181) don't meet OpenCV's requirements for YUV420 to BGR conversion (1).For proper cropping with go2rtc, you can use FFmpeg parameters in your stream configuration. The documentation shows how to re-encode video using FFmpeg parameters, which supports rotating and resizing video feeds (1).
Here's the correct approach for cropping streams: