Skip to content

Commit 11e0134

Browse files
committed
Skip intermediate image step on extracting video frame from target
1 parent 7524962 commit 11e0134

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/flitter/render/window/target.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ def video_frame(self):
120120
if self._release_time is not None:
121121
return None
122122
if self._video_frame is None:
123-
self._video_frame = av.VideoFrame.from_image(self.image)
123+
data = self._image_framebuffer.read(components=4, dtype='f1')
124+
self._video_frame = av.VideoFrame.from_bytes(data, width=self.width, height=self.height, format='rgba', flip_vertical=True)
124125
return self._video_frame
125126

126127
@property

0 commit comments

Comments
 (0)