You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an ONVIF compliant camera and it generates metadata for each frame. I downloaded the ODM and I was able to see the metadata for each frame on the live feed. The main goal of mine is to download those events in any file format which can be later accessible. I tried several scripts but with no luck. The main error I was getting is with PullMessages, it seems like there is no PullMessages at all. I don't know may be I am doing something wrong. Any help would be much appreciated!!
Note: The metadata generated by my camera is proprietary data but I guess it doesn't matter for ONVIF because if that's the case then, I will not be able to see the metadata in ODM right. So, if I can see the metadata there, then probably I would be able to access them as well.
I see that there are a lot of issues which are unanswered in the "issues" section of this repository. Please I request you to please answer them and for mine as well. If my problem gets solved, I have a little understanding of how things are going with this so, I will also try to answer some questions. Thank you.
One of the scripts which I tried is as follows:
from onvif import ONVIFCamera
import time
# Camera Connection Details
CAMERA_IP = "192.168.1.100" # Replace with your camera's IP address
PORT = 80 # Default ONVIF port
USERNAME = "admin" # Replace with your camera's username
PASSWORD = "password" # Replace with your camera's password
WS_DIR = "/path/to/wsdl" # Path to ONVIF WSDL files
# Initialize ONVIF Camera
camera = ONVIFCamera(CAMERA_IP, PORT, USERNAME, PASSWORD, wsdl_dir=WS_DIR)
# Create the Event Service
event_service = camera.create_events_service()
# Create PullPoint Subscription
pullpoint = event_service.CreatePullPointSubscription()
# Retrieve the Subscription Reference
subscription_reference = pullpoint.SubscriptionReference
# Create the PullPoint Service
pullpoint_service = camera.create_pullpoint_service()
# Function to Pull and Process Messages
def pull_messages():
while True:
try:
# Set Synchronization Point
pullpoint_service.SetSynchronizationPoint()
# Create PullMessages request
req = pullpoint_service.create_type('PullMessages')
req.Timeout = 'PT10S' # Timeout set to 10 seconds
req.MessageLimit = 10 # Limit to 10 messages per pull
# Pull messages
response = pullpoint_service.PullMessages(req)
# Process received messages
if response.NotificationMessage:
for msg in response.NotificationMessage:
# Extract and print message details
print(f"Message: {msg}")
else:
print("No new messages.")
# Wait before next pull
time.sleep(5)
except Exception as e:
print(f"Error: {e}")
break
# Start pulling messages
pull_messages()
# Unsubscribe when done
event_service.Unsubscribe()
After running this script the error which I am getting is:
raise exceptions.LookupError(
zeep.exceptions.LookupError: No element 'PullMessages' in namespace http://docs.oasis-open.org/wsrf/rw-2. Available elements are: -
The text was updated successfully, but these errors were encountered:
Hello Team,
I have an ONVIF compliant camera and it generates metadata for each frame. I downloaded the ODM and I was able to see the metadata for each frame on the live feed. The main goal of mine is to download those events in any file format which can be later accessible. I tried several scripts but with no luck. The main error I was getting is with PullMessages, it seems like there is no PullMessages at all. I don't know may be I am doing something wrong. Any help would be much appreciated!!
Note: The metadata generated by my camera is proprietary data but I guess it doesn't matter for ONVIF because if that's the case then, I will not be able to see the metadata in ODM right. So, if I can see the metadata there, then probably I would be able to access them as well.
I see that there are a lot of issues which are unanswered in the "issues" section of this repository. Please I request you to please answer them and for mine as well. If my problem gets solved, I have a little understanding of how things are going with this so, I will also try to answer some questions. Thank you.
One of the scripts which I tried is as follows:
After running this script the error which I am getting is:
The text was updated successfully, but these errors were encountered: