txlyre 7 月之前
父節點
當前提交
a5efc0dbe3
共有 1 個文件被更改,包括 3 次插入3 次删除
  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