| from fastapi import FastAPI | |
| import subprocess | |
| app = FastAPI() | |
| def greet_json(): | |
| return {"Hello": "World!"} | |
| def get_ffmpeg_version(): | |
| try: | |
| result = subprocess.run(["ffmpeg", "-version"], capture_output=True, text=True) | |
| return {"ffmpeg_version": result.stdout.splitlines()[0]} # Return only the first line | |
| except FileNotFoundError: | |
| return {"error": "FFmpeg is not installed or not found in PATH"} | |