From 4c8802f30e24c404b8b624779a8b4ca880cf93b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= <joamag@gmail.com>
Date: Tue, 7 Nov 2023 13:15:14 +0000
Subject: [PATCH] chore: better video handling

---
 src/python/boytacean/gb.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/python/boytacean/gb.py b/src/python/boytacean/gb.py
index d9ff5be6..a6f1166e 100644
--- a/src/python/boytacean/gb.py
+++ b/src/python/boytacean/gb.py
@@ -103,12 +103,12 @@ 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) -> Any:
+    def video(self, encoder="avc1", display=True, file_name="output.mp4") -> Any:
         from cv2 import VideoWriter, VideoWriter_fourcc, imread
         from IPython.display import Video, display as _display
 
-        image_paths = glob(f"{self._capture_temp_dir}/*.png")
-        video_path = f"{self._capture_temp_dir}/video.mp4"
+        image_paths = glob(f"{self._capture_temp_dir}/frame_*.png")
+        video_path = f"{self._capture_temp_dir}/{file_name}"
 
         encoder = VideoWriter(
             video_path,
-- 
GitLab