Compare commits

..

No commits in common. "796efb20e73a066a858c175ace3289e42511c074" and "3ffba5d92a939d161f17f8c87b2b1ca0ea00f5e1" have entirely different histories.

5 changed files with 7 additions and 10 deletions

View file

@ -77,15 +77,16 @@ class Convert:
logging.error(f"Fehler in video_convert(): {e}")
finally:
logging.info(f"Prozess {result}({obj.process.returncode}): {obj.source_file_name}")
await self.obj_websocket.send_websocket(obj.to_dict())
await self.obj_websocket.send_websocket(self.obj_path.active_path_to_dict())
await self.obj_websocket.send_websocket(self.obj_path.queue_path_to_dict())
self.active_process.discard(obj)
self.active_tasks.discard(obj)
self.obj_path.save_paths()
obj.convert_end = time.time()
obj_stat.save_stat(obj)
obj.convert_end = time.time()
def convert_cmd(self, obj):
command_convert = [

View file

@ -34,10 +34,7 @@ class Process:
self.process_line_extract(obj, line_decoded)
#logging.info(line_decoded)
if obj.source_frames_total > 0:
self.loading = (self.frames / obj.source_frames_total) * 100 > 0
else:
self.loading = 0
self.loading = (self.frames / obj.source_frames_total) * 100
await self.obj_websocket.send_websocket(self.to_dict(obj))

View file

@ -119,7 +119,7 @@ class Path:
"stream=index,channels,codec_name,codec_type,pix_fmt,level,"
"film_grain,r_frame_rate,bit_rate,sample_rate,width,height,size,tags:stream_tags=language,duration",
"-show_entries",
"format=size,bit_rate,nb_streams,duration",
"format=size,bit_rate,nb_streams",
"-of", "json",
path
]

View file

@ -13,7 +13,7 @@ class Media:
self.source_file: str = path
self.source_path: str = os.path.dirname(path)
self.source_file_name: str = os.path.basename(self.source_file)
self.source_duration: int = self.time_in_sec(streams_format[0].get("duration", "00:00:00"))
self.source_duration: int = self.time_in_sec(streams_video[0]["tags"].get("DURATION" or "duration", "00:00:00"))
self.source_size: list = self.size_convert("B", None, "storage", int(streams_format[0].get("size")))
self.source_frame_rate: int = self.frame_rate(streams_video)
self.source_frames_total: int = self.source_frame_rate * self.source_duration

View file

@ -26,7 +26,6 @@ class Stat:
"""
daten = self.read_stat()
daten.setdefault("videos", {})
try:
# Neuen Eintrag hinzufügen
@ -37,7 +36,7 @@ class Stat:
except Exception as e:
logging.error(f"Save Stat Failure: {e}")
def read_stat(self) -> dict[str, any]:
def read_stat(self) -> Dict[str, any]:
"""
Read statistic from YAML file
:return: Dictionary width statistics