improved video naming
This commit is contained in:
18
videos.txt
18
videos.txt
@@ -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("..")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user