full plugin support in cli

This commit is contained in:
2023-05-24 21:02:58 +02:00
parent db32279e6c
commit fc8f027a1c
2 changed files with 8 additions and 4 deletions

View File

@@ -13,9 +13,10 @@ import sys
import bin.probe import bin.probe
ffmpeg = bin.probe ffmpeg = bin.probe
import configparser import configparser
import time import json
import shutil
import importlib import importlib
import shutil
import time
importedModules = {} importedModules = {}
@@ -82,6 +83,7 @@ class Handler:
pass pass
def video_scaling( self, input_path, output_path, scalefactor, threads, sharpening, filetype, mode, engine ): def video_scaling( self, input_path, output_path, scalefactor, threads, sharpening, filetype, mode, engine ):
self.engineSetting = json.load( open( 'bin/engines/' + engine + '/config.json' ) )
# DO NOT CALL THIS! Use Handler().handler() instead! # DO NOT CALL THIS! Use Handler().handler() instead!
# Splitting video into frames # Splitting video into frames
@@ -155,12 +157,14 @@ class Handler:
return False return False
os.system( self.command ) os.system( self.command )
# reassemble Video # reassemble Video
print( '\n\n==> Reassembling Video... with framerate @', self.framerate, '\n\n' ) print( '\n\n==> Reassembling Video... with framerate @', self.framerate, '\n\n' )
if self.os_type == 'linux': if self.os_type == 'linux':
self.command = f'ffmpeg -framerate {self.framerate} -i {self.tmppath}sc/ig%08d.{filetype} {output_path} -i {self.tmppath}audio.aac' self.command = f'ffmpeg -framerate {self.framerate} -i {self.tmppath}{self.engineSetting[ "lastUsedFilePath" ]}/{self.engineSetting[ "fileNameBeginning" ]}%08d.{filetype} {output_path} -i {self.tmppath}audio.aac'
elif self.os_type == 'win32': elif self.os_type == 'win32':
self.command = f'ffmpeg -framerate {self.framerate} -i \'{self.tmppath}sc\\ig%08d.{filetype}\' {output_path} -i {self.tmppath}audio.aac' self.command = f'ffmpeg -framerate {self.framerate} -i \'{self.tmppath}{self.engineSetting[ "lastUsedFilePath" ]}\\{self.engineSetting[ "fileNameBeginning" ]}%08d.{filetype}\' {output_path} -i {self.tmppath}audio.aac'
else: else:
print( 'OS CURRENTLY UNSUPPORTED!' ); print( 'OS CURRENTLY UNSUPPORTED!' );
return False return False