(video_path)
| 118 | image.save(save_path) |
| 119 | |
| 120 | def read_frames(video_path): |
| 121 | container = av.open(video_path) |
| 122 | |
| 123 | video_stream = next(s for s in container.streams if s.type == "video") |
| 124 | frames = [] |
| 125 | for packet in container.demux(video_stream): |
| 126 | for frame in packet.decode(): |
| 127 | image = Image.frombytes( |
| 128 | "RGB", |
| 129 | (frame.width, frame.height), |
| 130 | frame.to_rgb().to_ndarray(), |
| 131 | ) |
| 132 | frames.append(image) |
| 133 | |
| 134 | return frames |
| 135 | |
| 136 | |
| 137 | def get_fps(video_path): |
nothing calls this directly
no outgoing calls
no test coverage detected