MCPcopy Create free account
hub / github.com/MooreThreads/Moore-AnimateAnyone / read_frames

Function read_frames

src/utils/util.py:106–120  ·  view source on GitHub ↗
(video_path)

Source from the content-addressed store, hash-verified

104
105
106def read_frames(video_path):
107 container = av.open(video_path)
108
109 video_stream = next(s for s in container.streams if s.type == "video")
110 frames = []
111 for packet in container.demux(video_stream):
112 for frame in packet.decode():
113 image = Image.frombytes(
114 "RGB",
115 (frame.width, frame.height),
116 frame.to_rgb().to_ndarray(),
117 )
118 frames.append(image)
119
120 return frames
121
122
123def get_fps(video_path):

Callers 5

log_validationFunction · 0.90
animateMethod · 0.90
process_single_videoFunction · 0.90
vid2pose.pyFile · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected