Skip to content
Snippets Groups Projects
Verified Commit de537427 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

chore: flexible frame glob

parent 473eda85
No related branches found
No related tags found
1 merge request!36Support for Python
Pipeline #3628 passed
......@@ -103,11 +103,17 @@ This is a [Game Boy](https://en.wikipedia.org/wiki/Game_Boy) emulator built usin
image = self.image()
image.save(filename, format=format)
def video(self, encoder="avc1", display=True, file_name="output.mp4") -> Any:
def video(
self,
encoder="avc1",
display=True,
file_name="output.mp4",
frame_glob="frame_*.png",
) -> Any:
from cv2 import VideoWriter, VideoWriter_fourcc, imread
from IPython.display import Video, display as _display
image_paths = glob(f"{self._capture_temp_dir}/frame_*.png")
image_paths = glob(f"{self._capture_temp_dir}/{frame_glob}")
video_path = f"{self._capture_temp_dir}/{file_name}"
encoder = VideoWriter(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment