diff --git a/app/ffmpeg_class.py b/app/ffmpeg_class.py index ca14a6e..89b5b1b 100644 --- a/app/ffmpeg_class.py +++ b/app/ffmpeg_class.py @@ -1,7 +1,11 @@ +from app.main import video_convert + + class Ffmpeg: def __init__(config): self.config = config + @staticmethod def video_info(): command_info = [ "ffprobe", "-v", @@ -18,7 +22,8 @@ class Ffmpeg: ] return command_info - + + @staticmethod def video_convert(): command_convert = [ "ffmpeg", "-y", "-i", obj.source_file, @@ -52,3 +57,14 @@ class Ffmpeg: command_convert.append(obj.output_file) return command_convert + + @staticmethod + def command_as_string(self, cmd): + command_as_string: str = "" + for para in cmd: + if "/" not in para: + command_as_string += f"{para} " + else: + command_as_string += f"\"{para}\" " + + return command_as_string.strip() \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3e41033 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +uvicorn~=0.34.0 +fastapi~=0.115.11 +starlette~=0.46.0 +PyYAML~=6.0.2 +websockets~=15.0 \ No newline at end of file