Spaces:
Runtime error
Runtime error
Download utils/ffmpeg_utils.py from cloudaiRambo/cloudairambo: direct link, hf CLI and curl.
- Browser
- Download file 440 Bytes
-
https://huggingface.co/spaces/cloudaiRambo/cloudairambo/resolve/main/utils/ffmpeg_utils.py
- Command line
-
hf download hf://spaces/cloudaiRambo/cloudairambo/utils/ffmpeg_utils.py
-
curl -L -o ffmpeg_utils.py https://huggingface.co/spaces/cloudaiRambo/cloudairambo/resolve/main/utils/ffmpeg_utils.py
440 Bytes
| import subprocess | |
| import uuid | |
| import os | |
| from core.config import settings | |
| def run_ffmpeg(input_path: str, output_ext: str): | |
| output_filename = f"{uuid.uuid4()}.{output_ext}" | |
| output_path = os.path.join(settings.OUTPUT_DIR, output_filename) | |
| cmd = [ | |
| "ffmpeg", | |
| "-y", | |
| "-i", input_path, | |
| output_path | |
| ] | |
| subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
| return output_path | |