comparison 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
comparison
equal deleted inserted replaced
1300:f3574e43c238 1301:7e42f83aab1f
439 points = [] 439 points = []
440 for i,p in enumerate(t): 440 for i,p in enumerate(t):
441 points.append(Point(al, i, p.x, p.y)) 441 points.append(Point(al, i, p.x, p.y))
442 session.add_all(points) 442 session.add_all(points)
443 session.commit() 443 session.commit()
444
445 def reportSiteVideoDurations(sites):
446 for s in sites:
447 print(s.name)
448 for cv in s.cameraViews:
449 startTime = cv.videoSequences[0].startTime
450 duration = cv.videoSequences[0].duration
451 for vs in cv.videoSequences:
452 duration += vs.duration
453 print(cv.description, startTime, duration)
454
444 455
445 # management 456 # management
446 # TODO need to be able to copy everything from a site from one sqlite to another, and delete everything attached to a site 457 # TODO need to be able to copy everything from a site from one sqlite to another, and delete everything attached to a site