diff trafficintelligence/metadata.py @ 1301:7e42f83aab1f

added utility to print recording durations from metadata
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 10 Jul 2025 16:15:55 -0400
parents c4c50678c856
children
line wrap: on
line diff
--- a/trafficintelligence/metadata.py	Fri Apr 11 16:14:51 2025 -0400
+++ b/trafficintelligence/metadata.py	Thu Jul 10 16:15:55 2025 -0400
@@ -441,6 +441,17 @@
         points.append(Point(al, i, p.x, p.y))
     session.add_all(points)
     session.commit()
+
+def reportSiteVideoDurations(sites):
+    for s in sites:
+        print(s.name)
+        for cv in s.cameraViews:
+            startTime = cv.videoSequences[0].startTime
+            duration = cv.videoSequences[0].duration
+            for vs in cv.videoSequences:
+                duration += vs.duration
+            print(cv.description, startTime, duration)
+
     
 # management
 # TODO need to be able to copy everything from a site from one sqlite to another, and delete everything attached to a site