Download app.py from Pepguy/ffmpeg: direct link, hf CLI and curl.
- Browser
- Download file 477 Bytes
-
https://huggingface.co/spaces/Pepguy/ffmpeg/resolve/main/app.py
- Command line
-
hf download hf://spaces/Pepguy/ffmpeg/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Pepguy/ffmpeg/resolve/main/app.py
477 Bytes
| 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"} | |