Skip to content

Commit 25fd9f2

Browse files
Add files via upload
1 parent d168fa5 commit 25fd9f2

5 files changed

Lines changed: 771 additions & 0 deletions

File tree

VideoConverter.spec

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
4+
a = Analysis(
5+
['video_converter_gui.py'],
6+
pathex=[],
7+
binaries=[],
8+
datas=[],
9+
hiddenimports=[],
10+
hookspath=[],
11+
hooksconfig={},
12+
runtime_hooks=[],
13+
excludes=[],
14+
noarchive=False,
15+
optimize=0,
16+
)
17+
pyz = PYZ(a.pure)
18+
19+
exe = EXE(
20+
pyz,
21+
a.scripts,
22+
a.binaries,
23+
a.datas,
24+
[],
25+
name='VideoConverter',
26+
debug=False,
27+
bootloader_ignore_signals=False,
28+
strip=False,
29+
upx=True,
30+
upx_exclude=[],
31+
runtime_tmpdir=None,
32+
console=False,
33+
disable_windowed_traceback=False,
34+
argv_emulation=False,
35+
target_arch=None,
36+
codesign_identity=None,
37+
entitlements_file=None,
38+
)

check_ffmpeg.py

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import subprocess
2+
import sys
3+
import os
4+
5+
def check_command(cmd_name, cmd_path=None):
6+
"""ตรวจสอบว่าคำสั่งมีอยู่ในระบบหรือไม่"""
7+
try:
8+
# ถ้ามี path เฉพาะ ใช้ path นั้น
9+
if cmd_path and os.path.exists(cmd_path):
10+
result = subprocess.run(
11+
[cmd_path, '-version'],
12+
capture_output=True,
13+
text=True,
14+
check=True
15+
)
16+
version_line = result.stdout.split('\n')[0]
17+
print(f"✅ {cmd_name} พบแล้ว (Local): {cmd_path}")
18+
print(f" {version_line}")
19+
return True
20+
21+
# ลองหาจาก PATH
22+
result = subprocess.run(
23+
[cmd_name, '-version'],
24+
capture_output=True,
25+
text=True,
26+
check=True
27+
)
28+
version_line = result.stdout.split('\n')[0]
29+
print(f"✅ {cmd_name} พบแล้ว (System PATH): {version_line}")
30+
return True
31+
except FileNotFoundError:
32+
print(f"❌ {cmd_name} ไม่พบในระบบ!")
33+
return False
34+
except Exception as e:
35+
print(f"⚠️ {cmd_name} มีปัญหา: {e}")
36+
return False
37+
38+
print("=" * 60)
39+
print("ตรวจสอบการติดตั้ง FFmpeg และ FFprobe")
40+
print("=" * 60)
41+
42+
# ตรวจสอบในโฟลเดอร์เดียวกับสคริปต์
43+
script_dir = os.path.dirname(os.path.abspath(__file__))
44+
local_ffmpeg = os.path.join(script_dir, 'ffmpeg.exe')
45+
local_ffprobe = os.path.join(script_dir, 'ffprobe.exe')
46+
47+
print(f"\nตรวจสอบในโฟลเดอร์โปรแกรม: {script_dir}")
48+
print("-" * 60)
49+
50+
ffmpeg_found = check_command('ffmpeg', local_ffmpeg)
51+
ffprobe_found = check_command('ffprobe', local_ffprobe)
52+
53+
print("\n" + "=" * 60)
54+
if ffmpeg_found and ffprobe_found:
55+
print("✅ ระบบพร้อมใช้งาน!")
56+
else:
57+
print("❌ กรุณาติดตั้ง FFmpeg:")
58+
print("\n📋 วิธีที่ 1: วางไฟล์ในโฟลเดอร์โปรแกรม (แนะนำ)")
59+
print(f" 1. ดาวน์โหลดจาก: https://www.gyan.dev/ffmpeg/builds/")
60+
print(f" 2. เลือก 'ffmpeg-release-essentials.zip'")
61+
print(f" 3. แตกไฟล์และคัดลอก ffmpeg.exe, ffprobe.exe")
62+
print(f" 4. วางไฟล์ที่: {script_dir}")
63+
print("\n📋 วิธีที่ 2: เพิ่มใน System PATH")
64+
print(" 1. ดาวน์โหลดและแตกไฟล์ตามด้านบน")
65+
print(" 2. ย้ายโฟลเดอร์ไปที่ C:\\ffmpeg\\")
66+
print(" 3. เพิ่ม C:\\ffmpeg\\bin ใน System PATH")
67+
print(" 4. รีสตาร์ท PowerShell")
68+
print("\n📋 วิธีที่ 3: ใช้ Chocolatey")
69+
print(" choco install ffmpeg")
70+
print("=" * 60)

download_ffmpeg.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# วิธีดาวน์โหลดและติดตั้ง FFmpeg
2+
3+
## ⚠️ ปัญหาที่พบ
4+
คุณโหลด **source code** ของ FFmpeg มา ซึ่งยังไม่สามารถใช้งานได้ทันที
5+
ต้องโหลด **pre-compiled binary** (ไฟล์ .exe ที่พร้อมใช้) แทน
6+
7+
---
8+
9+
## 🔧 วิธีแก้ไข (เลือก 1 วิธี)
10+
11+
### วิธีที่ 1: ดาวน์โหลด Manual (แนะนำ)
12+
13+
1. **ดาวน์โหลด FFmpeg**:
14+
- ไปที่: https://www.gyan.dev/ffmpeg/builds/
15+
- คลิก: **ffmpeg-release-essentials.zip** (ประมาณ 80-100 MB)
16+
17+
2. **แตกไฟล์**:
18+
- แตกไฟล์ zip ที่ดาวน์โหลดมา
19+
- จะได้โฟลเดอร์ชื่อ `ffmpeg-7.x-essentials_build`
20+
21+
3. **คัดลอกไฟล์**:
22+
- เข้าไปในโฟลเดอร์ที่แตก → `bin`
23+
- จะเห็นไฟล์ 3 ไฟล์:
24+
- `ffmpeg.exe`
25+
- `ffprobe.exe`
26+
- `ffplay.exe`
27+
- **คัดลอก 3 ไฟล์นี้ไปวางที่**: `D:\Python_VDO_Converter\`
28+
29+
4. **ทดสอบ**:
30+
```powershell
31+
cd D:\Python_VDO_Converter
32+
python check_ffmpeg.py
33+
```
34+
35+
---
36+
37+
### วิธีที่ 2: เพิ่มใน System PATH
38+
39+
หากต้องการให้ใช้งานได้ทุกที่:
40+
41+
1. ทำตามวิธีที่ 1 ข้อ 1-2
42+
2. ย้ายโฟลเดอร์ทั้งหมดไปที่ `C:\ffmpeg\`
43+
3. เพิ่ม PATH:
44+
- กดปุ่ม Windows + R → พิมพ์ `sysdm.cpl` → Enter
45+
- Advanced → Environment Variables
46+
- ที่ System Variables → เลือก `Path` → Edit
47+
- คลิก New → พิมพ์ `C:\ffmpeg\bin`
48+
- กด OK ทุกหน้าต่าง
49+
4. รีสตาร์ท PowerShell
50+
51+
---
52+
53+
### วิธีที่ 3: ใช้ Chocolatey (ต้องติดตั้ง Choco ก่อน)
54+
55+
```powershell
56+
# รัน PowerShell as Administrator
57+
choco install ffmpeg
58+
```
59+
60+
---
61+
62+
## ✅ หลังจากติดตั้งเสร็จ
63+
64+
รันคำสั่งนี้เพื่อทดสอบ:
65+
```powershell
66+
cd D:\Python_VDO_Converter
67+
python check_ffmpeg.py
68+
```
69+
70+
ถ้าเห็น ✅ แสดงว่าพร้อมใช้งานแล้ว!

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pyinstaller==6.11.1

0 commit comments

Comments
 (0)