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):
|
def __init__(self, config):
|
||||||
self.config = config
|
self.config = config
|
||||||
|
|
||||||
def video_info(self, select, source_file):
|
@staticmethod
|
||||||
|
def video_info(select, source_file):
|
||||||
command_info = [
|
command_info = [
|
||||||
"ffprobe", "-v",
|
"ffprobe", "-v",
|
||||||
"error",
|
"error",
|
||||||
|
|
@ -18,8 +19,9 @@ class Ffmpeg:
|
||||||
]
|
]
|
||||||
|
|
||||||
return command_info
|
return command_info
|
||||||
|
|
||||||
def video_convert(self, config, obj):
|
@staticmethod
|
||||||
|
def video_convert(config, obj):
|
||||||
command_convert = [
|
command_convert = [
|
||||||
"ffmpeg", "-y", "-i", obj.source_file,
|
"ffmpeg", "-y", "-i", obj.source_file,
|
||||||
"-map", "0:0",
|
"-map", "0:0",
|
||||||
|
|
|
||||||
14
app/main.py
14
app/main.py
|
|
@ -1,4 +1,3 @@
|
||||||
import asyncio
|
|
||||||
import os.path
|
import os.path
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
@ -16,15 +15,14 @@ from fastapi.responses import HTMLResponse
|
||||||
from fastapi.templating import Jinja2Templates
|
from fastapi.templating import Jinja2Templates
|
||||||
from starlette.websockets import WebSocketState
|
from starlette.websockets import WebSocketState
|
||||||
|
|
||||||
import video_class as vc
|
import app.video_class as vc
|
||||||
from ffmpeg_class import Ffmpeg as fc
|
from app.ffmpeg_class import Ffmpeg as Fc
|
||||||
from config_class import Config as c
|
from app.config_class import Config as Cfg
|
||||||
|
|
||||||
# Globale Variablen
|
# Globale Variablen
|
||||||
cfg = c()
|
config = Cfg().config
|
||||||
config = cfg.config
|
|
||||||
|
|
||||||
ffmpeg: ffmpeg = fc(config)
|
ffmpeg = Fc(config)
|
||||||
queue: queue = queue.Queue()
|
queue: queue = queue.Queue()
|
||||||
semaphore = threading.Semaphore(config["convert"]["max_process"])
|
semaphore = threading.Semaphore(config["convert"]["max_process"])
|
||||||
|
|
||||||
|
|
@ -111,7 +109,7 @@ def video_convert(obj):
|
||||||
|
|
||||||
semaphore.acquire()
|
semaphore.acquire()
|
||||||
|
|
||||||
result: str = None
|
result: str = ""
|
||||||
obj.convert_start = time.time()
|
obj.convert_start = time.time()
|
||||||
|
|
||||||
command = ffmpeg.video_convert(config, obj)
|
command = ffmpeg.video_convert(config, obj)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue