mirror of
https://github.com/TMElyralab/MuseTalk.git
synced 2026-02-04 17:39:20 +08:00
* fix: windows infer * docs: update readme * docs: update readme * feat: v1.5 gradio for windows&linux * fix: dependencies * feat: windows infer & gradio --------- Co-authored-by: NeRF-Factory <zzhizhou66@gmail.com>
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
import os
|
|
import subprocess
|
|
import sys
|
|
|
|
def test_ffmpeg(ffmpeg_path):
|
|
print(f"Testing ffmpeg path: {ffmpeg_path}")
|
|
|
|
# Choose path separator based on operating system
|
|
path_separator = ';' if sys.platform == 'win32' else ':'
|
|
|
|
# Add ffmpeg path to environment variable
|
|
os.environ["PATH"] = f"{ffmpeg_path}{path_separator}{os.environ['PATH']}"
|
|
|
|
try:
|
|
# Try to run ffmpeg
|
|
result = subprocess.run(["ffmpeg", "-version"], capture_output=True, text=True)
|
|
print("FFmpeg test successful!")
|
|
print("FFmpeg version information:")
|
|
print(result.stdout)
|
|
return True
|
|
except Exception as e:
|
|
print("FFmpeg test failed!")
|
|
print(f"Error message: {str(e)}")
|
|
return False
|
|
|
|
if __name__ == "__main__":
|
|
# Default ffmpeg path, can be modified as needed
|
|
default_path = r"ffmpeg-master-latest-win64-gpl-shared\bin"
|
|
|
|
# Use command line argument if provided, otherwise use default path
|
|
ffmpeg_path = sys.argv[1] if len(sys.argv) > 1 else default_path
|
|
|
|
test_ffmpeg(ffmpeg_path) |