Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ONVIF Camera Connections Behind NAT and Routers #15885

Open
tibacher opened this issue Jan 8, 2025 · 2 comments · May be fixed by #15886
Open

Support for ONVIF Camera Connections Behind NAT and Routers #15885

tibacher opened this issue Jan 8, 2025 · 2 comments · May be fixed by #15886
Labels
enhancement New feature or request

Comments

@tibacher
Copy link

tibacher commented Jan 8, 2025

I have encountered an issue when using ONVIF cameras that are located behind a router with NAT (Network Address Translation) in Frigate. When these cameras are queried, they respond with their private IP addresses and internal ports, making it impossible to access them from outside the local network. This is particularly problematic for users with cameras installed behind routers.

This issue has already been effectively addressed in the python-onvif-zeep package by rewriting the xaddrs in the ONVIF response to utilize the external IP address and port provided during the connection setup.

To resolve this in Frigate, I propose implementing a similar solution. I will submit a pull request that rewrites the ONVIF response to ensure the correct external IP address and port are used, especially for cameras behind routers. This will significantly improve connectivity for users in NAT environments, ensuring seamless access to their cameras from outside the local network.

I have tested this solution successfully in Frigate version 14.1, and it works as expected.

This fix will enhance Frigate's ability to handle cameras behind NAT and routers, bringing it in line with the proven solution from the python-onvif-zeep package.

Reference: FalkTannhaeuser/python-onvif-zeep#75

@tibacher tibacher added the enhancement New feature or request label Jan 8, 2025
@tibacher tibacher linked a pull request Jan 8, 2025 that will close this issue
10 tasks
@tibacher
Copy link
Author

tibacher commented Jan 8, 2025

I have created a draft pull request that addresses this issue. It includes the changes necessary to fix ONVIF camera connectivity behind NAT and routers, following the solution already implemented in the python-onvif-zeep package.

Please note that the final formatting with Ruff and the passing of tests have not yet been done. These will be completed before the pull request is finalized.

You can view the draft pull request here: Fix ONVIF Camera Connectivity Behind NAT and Routers #15886.

Let me know if you have any feedback!

@piciuok
Copy link

piciuok commented Jan 10, 2025

Great! waiting for that! I am using frigate for remote cameras and have that issue too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants