Replies: 6 comments 7 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.
-
|
Hi @JosephPtn , |
Beta Was this translation helpful? Give feedback.
-
|
Can you add an example Url and which Axis OS version you are testing against? |
Beta Was this translation helpful? Give feedback.
-
|
I have similar findings as your test in VLC, my OS is 12.4.59. While when testing with ffplay, it can seek even the recoding ID is still recording. URL as following: Not sure whether it is limitation in VLC or camera side. |
Beta Was this translation helpful? Give feedback.
-
|
just for reference with this script, you can export all recordinds, just if any body needs it. I had made it for a customer, may it helps others to. =) import argparse
import os
import sys
import requests
from requests.auth import HTTPDigestAuth
from urllib.parse import urljoin
from datetime import datetime
import xml.etree.ElementTree as ET
import time
def parse_arguments():
parser = argparse.ArgumentParser(description='Export Axis camera recordings from SD card.')
parser.add_argument('--ip', required=True, help='Camera IP address')
parser.add_argument('--username', required=True, help='Camera username')
parser.add_argument('--password', required=True, help='Camera password')
parser.add_argument('--start', required=True, help='Start datetime in ISO 8601 format (e.g., 2025-05-01T00:00:00Z)')
parser.add_argument('--end', required=True, help='End datetime in ISO 8601 format (e.g., 2025-05-21T23:59:59Z)')
parser.add_argument('--output', default='recordings', help='Output directory for recordings')
return parser.parse_args()
def list_recordings(base_url, auth, start_time, end_time):
list_url = urljoin(base_url, '/axis-cgi/record/list.cgi')
params = {
'starttime': start_time,
'endtime': end_time
}
response = requests.get(list_url, auth=auth, params=params)
if response.status_code != 200:
print(f"Failed to list recordings: {response.status_code}")
sys.exit(1)
return response.text
def parse_recordings(xml_data):
recordings = []
try:
root = ET.fromstring(xml_data)
recordings_node = root.find('recordings')
if recordings_node is None:
print("No <recordings> node found.")
return recordings
for recording in recordings_node.findall('recording'):
recording_id = recording.attrib['recordingid']
start_time = recording.attrib['starttime']
end_time = recording.attrib['stoptime']
recordings.append({
'recording_id': recording_id,
'start_time': start_time,
'end_time': end_time
})
except ET.ParseError as e:
print(f"Error parsing XML: {e}")
sys.exit(1)
return recordings
def export_recording(base_url, auth, recording, output_dir):
export_url = urljoin(base_url, '/axis-cgi/record/export/exportrecording.cgi')
params = {
'schemaversion': '1',
'recordingid': recording['recording_id'],
'diskid': 'SD_DISK',
'exportformat': 'matroska'
}
filename = f"{recording['recording_id']}.mkv"
filepath = os.path.join(output_dir, filename)
for attempt in range(1, 4): # Try up to 3 times
try:
response = requests.get(export_url, auth=auth, params=params, stream=True, timeout=60)
if response.status_code == 200:
with open(filepath, 'wb') as f:
for chunk in response.iter_content(chunk_size=8192):
f.write(chunk)
print(f"[SUCCESS] Exported recording to {filepath}")
return True
else:
print(f"[Attempt {attempt}] Failed to export {recording['recording_id']}: {response.status_code}")
except Exception as e:
print(f"[Attempt {attempt}] Error exporting {recording['recording_id']}: {e}")
time.sleep(2) # wait before retry
print(f"[FAILED] Recording {recording['recording_id']} failed after 3 attempts.")
return False
def main():
args = parse_arguments()
base_url = f"http://{args.ip}"
auth = HTTPDigestAuth(args.username, args.password)
if not os.path.exists(args.output):
os.makedirs(args.output)
print("Listing recordings...")
xml_data = list_recordings(base_url, auth, args.start, args.end)
recordings = parse_recordings(xml_data)
if not recordings:
print("No recordings found in the specified date range.")
return
print(f"Found {len(recordings)} recordings. Starting export...")
success_list = []
failed_list = []
for recording in recordings:
success = export_recording(base_url, auth, recording, args.output)
if success:
success_list.append(recording['recording_id'])
else:
failed_list.append(recording['recording_id'])
if success_list:
print("\nSuccessful Exports:")
for r in success_list:
print(f" - {r}")
if failed_list:
print("\nFailed Exports:")
for r in failed_list:
print(f" - {r}")
print("\n==== EXPORT SUMMARY ====")
print(f"Total recordings found: {len(recordings)}")
print(f"Succeeded: {len(success_list)}")
print(f"Failed: {len(failed_list)}")
if __name__ == '__main__':
main() |
Beta Was this translation helpful? Give feedback.
-
|
Feel free to re-open it OR share the solution/alternative/comment if already resolved👁️🗨️ |
Beta Was this translation helpful? Give feedback.




Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I am developing an application for viewing camera recordings, as a library for playing rtsp streams I use vlc (I am writing an application for Android and IOS). I encountered a problem with playing a recording not from the beginning when it is not yet finished. Cameras ignore the parameter that I pass through VLC — start-time (offset in seconds relative to the beginning of the recording), but if the recording is finished, everything works correctly. Tell me, is this a limitation of the camera? (the inability to play a recording not from the beginning of the recording if it is still in progress)
Beta Was this translation helpful? Give feedback.
All reactions