MCPcopy Create free account
hub / github.com/DenOfEquity/ersatzForge / getVideoFPS

Function getVideoFPS

modules/postprocessing.py:41–57  ·  view source on GitHub ↗
(video_path)

Source from the content-addressed store, hash-verified

39
40
41def getVideoFPS(video_path):
42 name = os.path.splitext(video_path)
43 ext = name[1].lower()
44
45 if ext == '.webp' or ext == '.apng' or ext == '.png':
46 #from gif2gif extension
47 with Image.open(video_path) as im:
48 if 'duration' in im.info:
49 fps = round (1000 / im.info["duration"], 3)
50 else:
51 fps = 'unknown'
52 else:
53 video = cv2.VideoCapture(video_path)
54 fps = round(video.get(cv2.CAP_PROP_FPS), 3)
55 video.release()
56
57 return fps
58
59def save_video(frames_dir, fps, original, output_path, interpolate):
60 if original != '': # order of parameters is fussy

Callers 1

run_postprocessingFunction · 0.85

Calls 2

getMethod · 0.80
releaseMethod · 0.80

Tested by

no test coverage detected