File size: 440 Bytes
99fdb5f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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