From 4c5a1f2f09f6906bf26a783d2fa345a5886a2335 Mon Sep 17 00:00:00 2001
From: wangzhibo <wangzhibo@shsening.com>
Date: 星期三, 04 十二月 2024 09:49:30 +0800
Subject: [PATCH] modified split using cv2

---
 videosplitorV0.1.spec |   42 ++++++++++++++----------------------------
 1 files changed, 14 insertions(+), 28 deletions(-)

diff --git a/videosplitorV0.1.spec b/videosplitorV0.1.spec
index ee534d0..ba98d2c 100644
--- a/videosplitorV0.1.spec
+++ b/videosplitorV0.1.spec
@@ -3,9 +3,11 @@
 import os
 import shutil
 from PyInstaller.utils.hooks import collect_all
+import zipfile
+import time
 
 a = Analysis(
-    ['tkv.py'],
+    ['video-splitor.py'],
     pathex=[],
     binaries=[],
     datas=[],
@@ -43,21 +45,14 @@
 
 # 瀹氫箟棰濆鎷疯礉鐨勬枃浠�
 path_ffmpeg = os.path.join(os.getcwd(), 'ffmpeg.exe')
-path_thumb = os.path.join(os.getcwd(), 'mp4_generate_thumbnails.bat')
 path_checkmark = os.path.join(os.getcwd(), 'checkmark.png')
-path_libvlc = os.path.join(os.getcwd(), 'libvlc.dll')
-path_libvlccore = os.path.join(os.getcwd(), 'libvlccore.dll')
-
-plugins_path = os.path.join(os.getcwd(), 'plugins')
+path_vlc_plugins = os.path.join(os.getcwd(), 'VLC.zip')
 
 # 灏� ffmpeg.exe 鍜� plugins 鏂囦欢澶规坊鍔犲埌 EXE 鐨勫悓绾х洰褰�
 datas = [
     (path_ffmpeg, '.'), 
-    (path_thumb, '.'),  
-    (path_checkmark, '.'),  
-    (path_libvlc, '.'),  
-    (path_libvlccore, '.'),  
-    (plugins_path, 'plugins') 
+    (path_checkmark, '.'),
+    (path_vlc_plugins, '.')
 ]
 
 
@@ -67,27 +62,18 @@
     # 鑾峰彇鐢熸垚鐨� dist 鐩綍
     dist_dir = os.path.join(os.getcwd(), 'dist')
     
-    # 閫掑綊鎷疯礉 plugins 鐩綍
-    if os.path.exists(plugins_path):
-        destination_plugins = os.path.join(dist_dir, 'plugins')
-        shutil.copytree(plugins_path, destination_plugins)
-    
     if os.path.exists(path_ffmpeg):
         shutil.copy(path_ffmpeg, dist_dir)
     
-    if os.path.exists(path_thumb):
-        shutil.copy(path_thumb, dist_dir)
-    
     if os.path.exists(path_checkmark):
         shutil.copy(path_checkmark, dist_dir)
-    
-    if os.path.exists(path_libvlc):
-        shutil.copy(path_libvlc, dist_dir)
-    
-    if os.path.exists(path_libvlccore):
-        shutil.copy(path_libvlccore, dist_dir)
+
+    if os.path.exists(path_vlc_plugins):
+        copied_file_path = shutil.copy(path_vlc_plugins, dist_dir)
+        with zipfile.ZipFile(copied_file_path, 'r') as zip_ref:
+            zip_ref.extractall(dist_dir)
+        time.sleep(1)  # 绛夊緟璧勬簮閲婃斁
+        os.remove(copied_file_path)
 
 # 鍦ㄦ墦鍖呭悗鐨勫簲鐢ㄤ腑鎵ц鏂囦欢鎷疯礉鎿嶄綔
-post_processing_hook(exe)
-
-
+post_processing_hook(exe)
\ No newline at end of file

--
Gitblit v1.9.1