-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
109 lines (93 loc) · 3.48 KB
/
setup.py
File metadata and controls
109 lines (93 loc) · 3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/env python3
"""
Setup script for MeetingVideo-Transrecorder audio extraction dependencies
"""
import subprocess
import sys
import os
def check_python_version():
"""Check if Python version is compatible"""
if sys.version_info < (3, 8):
print("❌ Python 3.8 or higher is required")
return False
print(f"✅ Python {sys.version_info.major}.{sys.version_info.minor} detected")
return True
def check_ffmpeg():
"""Check if FFmpeg is installed"""
try:
result = subprocess.run(['ffmpeg', '-version'], capture_output=True, text=True)
if result.returncode == 0:
print("✅ FFmpeg is installed")
return True
else:
print("❌ FFmpeg is not working properly")
return False
except FileNotFoundError:
print("❌ FFmpeg is not installed")
print(" Please install FFmpeg from: https://ffmpeg.org/download.html")
return False
def install_python_dependencies():
"""Install Python dependencies"""
try:
print("📦 Installing Python dependencies...")
result = subprocess.run([sys.executable, '-m', 'pip', 'install', '-r', 'requirements.txt'],
capture_output=True, text=True)
if result.returncode == 0:
print("✅ Python dependencies installed successfully")
return True
else:
print(f"❌ Failed to install dependencies: {result.stderr}")
return False
except Exception as e:
print(f"❌ Error installing dependencies: {e}")
return False
def test_whisper():
"""Test if Whisper is working"""
try:
import whisper
print("✅ Whisper is available")
return True
except ImportError:
print("❌ Whisper is not available")
return False
def test_speech_recognition():
"""Test if SpeechRecognition is working"""
try:
import speech_recognition
print("✅ SpeechRecognition is available")
return True
except ImportError:
print("❌ SpeechRecognition is not available")
return False
def main():
"""Main setup function"""
print("🔧 Setting up MeetingVideo-Transrecorder audio extraction...")
print("=" * 50)
if not check_python_version():
sys.exit(1)
if not check_ffmpeg():
print("\n⚠️ FFmpeg is required for audio extraction")
print(" Please install FFmpeg and run this script again")
sys.exit(1)
if not install_python_dependencies():
print("\n⚠️ Failed to install Python dependencies")
sys.exit(1)
print("\n🧪 Testing dependencies...")
whisper_ok = test_whisper()
speech_ok = test_speech_recognition()
if not whisper_ok and not speech_ok:
print("\n❌ No speech-to-text libraries are available")
print(" Please check the installation and try again")
sys.exit(1)
print("\n✅ Setup completed successfully!")
print("\n📝 Next steps:")
print(" 1. Start your Electron app")
print(" 2. Record a video with audio")
print(" 3. Click 'Extract Transcript & Summary'")
print(" 4. Check the generated files in Desktop/captured-videos/")
if not whisper_ok:
print("\n⚠️ Note: Whisper is not available, will use Google Speech Recognition (requires internet)")
if not speech_ok:
print("\n⚠️ Note: Google Speech Recognition is not available, will use Whisper only")
if __name__ == "__main__":
main()