This commit is contained in:
stirelshka8
2026-03-15 18:53:28 +03:00
parent 324fa7440a
commit 6b9042bee1
11 changed files with 87 additions and 7 deletions
+10 -1
View File
@@ -1,7 +1,9 @@
import os
import subprocess
import sys
import tempfile
import warnings
import glob
from moviepy import VideoFileClip, concatenate_videoclips
from moviepy.video.fx import Resize
from datetime import datetime
@@ -53,7 +55,14 @@ warnings.filterwarnings(
def _get_ffmpeg_exe():
"""Путь к FFmpeg (тот же, что использует MoviePy/imageio)."""
"""Путь к FFmpeg (тот же, что использует MoviePy/imageio). В exe (PyInstaller) — из папки сборки."""
if getattr(sys, "frozen", False) and getattr(sys, "_MEIPASS", None):
base = sys._MEIPASS
for folder in ("imageio_ffmpeg", "."):
search = os.path.join(base, folder, "*.exe")
for path in glob.glob(search):
if "ffmpeg" in os.path.basename(path).lower():
return path
try:
import imageio_ffmpeg
return imageio_ffmpeg.get_ffmpeg_exe()