How to consume radar metadata using ACAP application on Axis Q1656-DLE radar video fusion camera #903
-
Hi, I have built an ACAP application following the steps in the github page here I have built and uploaded the eap file and when i see the logs i find something like this I do not see any metadata from radar like speed and distance here . So I have have changed the source number to 2 in the consume_scene_metadata.c file like below, hoping source="2" would give metadata from radar...
please help me how to build the ACAP application to consume metadata from the radar channel usin axis Q1656 DLE. I am using axis os 12.2.52 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This automatically generated reply acts as a friendly reminder. Answers to your questions will most often come from the community, from developers like yourself. You will, from time to time, find that Axis employees answers some of the questions, but this is not a guarantee. Think of the discussion forum as a complement to other support channels, not a replacement to any of them. If your question remains unanswered for a period of time, please revisit it to see whether it can be improved by following the guidelines listed in Axis support guidelines. |
Beta Was this translation helpful? Give feedback.
-
Just for reference, an example how to consume radar metadatastream via python, import av
def extract_and_parse_metadata(rtsp_url):
"""
Connect to an RTSP stream over TCP, extract XML metadata, and handle potential issues.
"""
try:
# Open the RTSP stream with TCP transport
container = av.open(rtsp_url, 'r', options={'rtsp_transport': 'tcp'})
# Select the data stream
if not container.streams.data:
print("No data stream found in the RTSP container.")
return
data_stream = container.streams.data[0]
print(f"Data stream opened: {data_stream}")
for packet in container.demux(data_stream):
try:
# Decode the packet to an XML string
xml_string = packet.to_bytes().decode('utf-8')
print("Extracted XML Metadata:")
print(xml_string)
except UnicodeDecodeError:
print("Warning: Failed to decode packet as UTF-8. Skipping this packet.")
except Exception as e:
print(f"Error processing packet: {e}")
except av.AVError as e:
print(f"Error reading RTSP stream: {e}")
except Exception as e:
print(f"An unexpected error occurred: {e}")
finally:
print("Processing completed.")
if __name__ == "__main__":
# Replace with your data
user = "root"
password = "blabla"
ip = "195.60.68.14"
rtsp_port = 554
rtsp_url = f"rtsp://{user}:{password}@{ip}:{rtsp_port}/axis-media/media.amp?camera=2&video=0&audio=0&event=on&analytics=polygon"
extract_and_parse_metadata(rtsp_url) |
Beta Was this translation helpful? Give feedback.
Just for reference, an example how to consume radar metadatastream via python,
could also be used for standart metadata stream (just modify url)