From 157720d1d5493e3a9d7ae91f0805617b29282ba2 Mon Sep 17 00:00:00 2001 From: janis Date: Mon, 12 Sep 2022 15:49:54 +0200 Subject: [PATCH] added ffmpeg-path settings. The exe will be installed by the installer --- bin/handler.py | 6 +++--- config/settings.ini | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/handler.py b/bin/handler.py index d88abff..ea12757 100644 --- a/bin/handler.py +++ b/bin/handler.py @@ -26,7 +26,7 @@ class Handler: self.tmppath = "" self.videometa = {} - def handler(self, fsrpath, filepath, quality_mode, quality_setting, output_path, ffmpegpath): + def handler(self, fsrpath, filepath, quality_mode, quality_setting, output_path): # Function to be called when using this class as this function automatically determines if file is video or image if self.os_type == "linux": self.tmppath = config["PathSettings"]["tmpPathLinux"] @@ -36,7 +36,7 @@ class Handler: print("OS CURRENTLY UNSUPPORTED!") return False self.tmppath += "fsru/" - print(self.tmppath) + self.ffmpegpath = config["PathSettings"]["ffmpeg"] # checking for spaces in filepath (for use with terminal commands) self.filepath = "" for self.letter in filepath: @@ -48,7 +48,7 @@ class Handler: # Determining filetype if str(filepath)[len(filepath) - 4:] == ".mp4" or str(filepath)[len(filepath) - 4:] == ".mkv": print("upscaling video") - self.video_scaling(ffmpegpath, fsrpath, filepath, quality_mode, quality_setting, output_path) + self.video_scaling(self.ffmpegpath, fsrpath, filepath, quality_mode, quality_setting, output_path) elif str(filepath)[len(filepath) - 4:] == ".JPG" or str(filepath)[len(filepath) - 4:] == ".png" or str(filepath)[len(filepath) - 4:] == ".jpg" or str(filepath)[len(filepath) - 5:] == ".jpeg": print("upscaling image") self.photo_scaling(fsrpath, filepath, quality_mode, quality_setting, output_path) diff --git a/config/settings.ini b/config/settings.ini index a59de6b..51a5087 100644 --- a/config/settings.ini +++ b/config/settings.ini @@ -2,6 +2,7 @@ defaultOutputPath = $HOME/FSRImageVideoUpscaler/ tmpPathLinux = /tmp/ tmpPathWindows = %TEMP% +ffmpeg = ./bin/lib/ffmpeg.exe [DevSettings] loggerReqLevel = DEBUG \ No newline at end of file