Getested und ein Berechnungsfehler beseitigt in Time to sec
This commit is contained in:
parent
274c20449e
commit
0a259732ca
2 changed files with 11 additions and 11 deletions
|
|
@ -2,7 +2,8 @@ class Ffmpeg:
|
|||
def __init__(self, config):
|
||||
self.config = config
|
||||
|
||||
def video_info(self, select, source_file):
|
||||
@staticmethod
|
||||
def video_info(select, source_file):
|
||||
command_info = [
|
||||
"ffprobe", "-v",
|
||||
"error",
|
||||
|
|
@ -18,8 +19,9 @@ class Ffmpeg:
|
|||
]
|
||||
|
||||
return command_info
|
||||
|
||||
def video_convert(self, config, obj):
|
||||
|
||||
@staticmethod
|
||||
def video_convert(config, obj):
|
||||
command_convert = [
|
||||
"ffmpeg", "-y", "-i", obj.source_file,
|
||||
"-map", "0:0",
|
||||
|
|
|
|||
14
app/main.py
14
app/main.py
|
|
@ -1,4 +1,3 @@
|
|||
import asyncio
|
||||
import os.path
|
||||
import re
|
||||
import subprocess
|
||||
|
|
@ -16,15 +15,14 @@ from fastapi.responses import HTMLResponse
|
|||
from fastapi.templating import Jinja2Templates
|
||||
from starlette.websockets import WebSocketState
|
||||
|
||||
import video_class as vc
|
||||
from ffmpeg_class import Ffmpeg as fc
|
||||
from config_class import Config as c
|
||||
import app.video_class as vc
|
||||
from app.ffmpeg_class import Ffmpeg as Fc
|
||||
from app.config_class import Config as Cfg
|
||||
|
||||
# Globale Variablen
|
||||
cfg = c()
|
||||
config = cfg.config
|
||||
config = Cfg().config
|
||||
|
||||
ffmpeg: ffmpeg = fc(config)
|
||||
ffmpeg = Fc(config)
|
||||
queue: queue = queue.Queue()
|
||||
semaphore = threading.Semaphore(config["convert"]["max_process"])
|
||||
|
||||
|
|
@ -111,7 +109,7 @@ def video_convert(obj):
|
|||
|
||||
semaphore.acquire()
|
||||
|
||||
result: str = None
|
||||
result: str = ""
|
||||
obj.convert_start = time.time()
|
||||
|
||||
command = ffmpeg.video_convert(config, obj)
|
||||
|
|
|
|||
Loading…
Reference in a new issue