Compare commits
2 commits
003bfb9f64
...
8901279432
| Author | SHA1 | Date | |
|---|---|---|---|
| 8901279432 | |||
| 96c947a3a3 |
2 changed files with 22 additions and 3 deletions
|
|
@ -1,9 +1,12 @@
|
||||||
|
from app.main import video_convert
|
||||||
|
|
||||||
|
|
||||||
class Ffmpeg:
|
class Ffmpeg:
|
||||||
def __init__(self, config):
|
def __init__(config):
|
||||||
self.config = config
|
self.config = config
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def video_info(select, source_file):
|
def video_info():
|
||||||
command_info = [
|
command_info = [
|
||||||
"ffprobe", "-v",
|
"ffprobe", "-v",
|
||||||
"error",
|
"error",
|
||||||
|
|
@ -21,7 +24,7 @@ class Ffmpeg:
|
||||||
return command_info
|
return command_info
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def video_convert(config, obj):
|
def video_convert():
|
||||||
command_convert = [
|
command_convert = [
|
||||||
"ffmpeg", "-y", "-i", obj.source_file,
|
"ffmpeg", "-y", "-i", obj.source_file,
|
||||||
"-map", "0:0",
|
"-map", "0:0",
|
||||||
|
|
@ -54,3 +57,14 @@ class Ffmpeg:
|
||||||
command_convert.append(obj.output_file)
|
command_convert.append(obj.output_file)
|
||||||
|
|
||||||
return command_convert
|
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()
|
||||||
5
requirements.txt
Normal file
5
requirements.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
uvicorn~=0.34.0
|
||||||
|
fastapi~=0.115.11
|
||||||
|
starlette~=0.46.0
|
||||||
|
PyYAML~=6.0.2
|
||||||
|
websockets~=15.0
|
||||||
Loading…
Reference in a new issue