ONVIF and time sync? #8930
Replies: 3 comments 1 reply
-
I'm not sure if this is functionality that frigate or any NVR should provide (as NTP is the standard way that cameras will sync time). However, it shouldn't be too hard to set up a cron job to that does what you're wanting to do. I found this post with some Python code that should probably do what you want. |
Beta Was this translation helpful? Give feedback.
-
I did get this working thanks to your post. I did the following... First we want to create a python virtual environment to store our python libs and code..
Install the required library that does the onvif functionality…
Exit the virtual environment… |
Beta Was this translation helpful? Give feedback.
-
Based on this, I created a small service I add to my If someone has the similar use case, you can use it like this: services:
onvif-time:
image: ghcr.io/alesgenova/onvif-time:dev
volumes:
- /path/to/config.json:/config/config.json
environment:
TZ: "America/New_York"
ONVIF_TIME_SCHEDULE: "0 2 * * *"
ONVIF_TIME_STARTUP_SYNC: True
restart: unless-stopped And the configuration file looks like this: {
"ntp": {
"host": "pool.ntp.org",
"port": 123,
"timeout": 5
},
"cameras": {
"front_camera": {
"host": "10.0.0.2",
"port": 12345,
"user": "user",
"password": "password"
},
"back_camera": {
"host": "10.0.0.3",
"port": 12345,
"user": "user",
"password": "password"
}
}
} Full source: |
Beta Was this translation helpful? Give feedback.
-
So aparently you can perform time syncs using the ONVIF protocol. With the newest beta build, we can setup ONVIF so we can get PTZ control of cameras. With that integration, is there any chance we can also get time sync working as well? Some of the cameras I am using seem to be crap and just plain ignore my DHCP NTP option, so the camera drifts out of sync over time. Time sync over OVNIF would be great and solve this.
Beta Was this translation helpful? Give feedback.
All reactions