txlyre il y a 7 mois
Parent
commit
a5efc0dbe3
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      main.py

+ 3 - 3
main.py

@@ -132,12 +132,12 @@ def read_video(source, duration=60):
 
     with tempfile.TemporaryDirectory() as tmpd:
         run_check(
-            f"ffmpeg -hide_banner -loglevel error -y -i {tmpf.name} -vf mpdecimate -r 1/1 {tmpd.name}/%d.bmp"
+            f"ffmpeg -hide_banner -loglevel error -y -i {tmpf.name} -vf mpdecimate -r 1/1 {tmpd}/%d.bmp"
         )
 
         data = b""
-        for filename in os.listdir(tmpd.name):
-            data += extract_image(os.path.join(tmpd.name, filename))
+        for filename in os.listdir(tmpd):
+            data += extract_image(os.path.join(tmpd, filename))
 
         return data