added utility to print recording durations from metadata

Commit 7e42f83aab1f · Nicolas Saunier · 2025-07-10 16:15 -0400

Changeset
7e42f83aab1f175df2eb1401b504a2c0ee06c94a

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/trafficintelligence/metadata.py b/trafficintelligence/metadata.py
--- a/trafficintelligence/metadata.py
+++ b/trafficintelligence/metadata.py
@@ -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