Skip to content

Commit

Permalink
Skip intermediate image step on extracting video frame from target
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanhogg committed Nov 12, 2024
1 parent 7524962 commit 11e0134
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/flitter/render/window/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def video_frame(self):
if self._release_time is not None:
return None
if self._video_frame is None:
self._video_frame = av.VideoFrame.from_image(self.image)
data = self._image_framebuffer.read(components=4, dtype='f1')
self._video_frame = av.VideoFrame.from_bytes(data, width=self.width, height=self.height, format='rgba', flip_vertical=True)
return self._video_frame

@property
Expand Down

0 comments on commit 11e0134

Please sign in to comment.