improved video naming

This commit is contained in:
1MalcolmS
2026-03-27 16:39:54 -07:00
parent ce6479be42
commit a574a77a4b
70 changed files with 110 additions and 43 deletions

View File

@@ -1,5 +1,6 @@
import subprocess
import os
from datetime import datetime
video = ["Centerm in gate - videos", "Clark Drive overpass - videos", "Columbia Container - crossing - videos",
@@ -18,18 +19,27 @@ folder = ["Centerm in gate", "Clark Drive overpass", "Columbia Container - cross
"Terminal dock", "Vanterm Alliance Grain Terminal crossing", "Vanterm in gate", "Waterfront_road Centerm crossing"]
folderpair = list(zip(video, folder))
print(folderpair)
#increment video number
def imageToVideo(folder_name, videopath):
v = os.path.join("..", "Videos", videopath, "video.mp4")
v = str(v)
os.chdir(folder_name)
t = os.path.getmtime("image0001.jpg")
t = int(t)
dt = datetime.fromtimestamp(t)
print(dt)
name = dt.strftime("%Y-%m-%d %H.%M.%S")
name = name + ".mp4"
print(name)
v = os.path.join("..", "Videos", videopath, name)
v = str(v)
print(v)
subprocess.run(["ffmpeg",
"-f", "image2",
"-framerate", "2",
"-i", "image%04d.jpg",
"-c:v", "libx265",
"-c:v", "libx265",
v])
os.chdir("..")