fixed error
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -56,7 +56,7 @@ class Handler:
|
|||||||
self.filepath += self.letter
|
self.filepath += self.letter
|
||||||
|
|
||||||
# Determining filetype
|
# Determining filetype
|
||||||
if str(filepath)[len(filepath) - 4:] == ".mp4" or str(filepath)[len(filepath) - 4:] == ".mkv":
|
if str(filepath)[len(filepath) - 4:] == ".mp4" or str(filepath)[len(filepath) - 4:] == ".mkv" or str(filepath)[len(filepath) - 4:] == ".MP4":
|
||||||
print("upscaling video")
|
print("upscaling video")
|
||||||
self.video_scaling(fsrpath, filepath, quality_mode, quality_setting, output_path)
|
self.video_scaling(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":
|
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":
|
||||||
@@ -70,9 +70,9 @@ class Handler:
|
|||||||
# DO NOT CALL THIS! Use Handler().handler() instead!
|
# DO NOT CALL THIS! Use Handler().handler() instead!
|
||||||
if quality_mode == "default":
|
if quality_mode == "default":
|
||||||
if self.os_type == "linux":
|
if self.os_type == "linux":
|
||||||
self.command = f"wine {fsrpath} -QualityMode {quality_setting} {self.filepath} {output_path}"
|
self.command = f"wine {fsrpath} -QualityMode {quality_setting} {quality_setting} {self.filepath} {output_path}"
|
||||||
elif self.os_type == "win32":
|
elif self.os_type == "win32":
|
||||||
self.command = f"FidelityFX_CLI -QualityMode {quality_setting} {self.filepath} {output_path}"
|
self.command = f"FidelityFX_CLI -QualityMode {quality_setting} {quality_setting} {self.filepath} {output_path}"
|
||||||
else:
|
else:
|
||||||
print("OS CURRENTLY UNSUPPORTED!")
|
print("OS CURRENTLY UNSUPPORTED!")
|
||||||
return False
|
return False
|
||||||
@@ -94,7 +94,6 @@ class Handler:
|
|||||||
# if ( sys.platform == 'win32' ):
|
# if ( sys.platform == 'win32' ):
|
||||||
# self.videometa = ffmpeg.probe(str(filepath))["streams"].pop(0)
|
# self.videometa = ffmpeg.probe(str(filepath))["streams"].pop(0)
|
||||||
# else:
|
# else:
|
||||||
print("\n\n\nupscaling video\n\n\n")
|
|
||||||
self.videometa = ffmpeg.probe(str(filepath))["streams"].pop(0)
|
self.videometa = ffmpeg.probe(str(filepath))["streams"].pop(0)
|
||||||
# Retrieving Video metadata
|
# Retrieving Video metadata
|
||||||
self.duration = self.videometa.get("duration")
|
self.duration = self.videometa.get("duration")
|
||||||
@@ -134,7 +133,7 @@ class Handler:
|
|||||||
self.files = ""
|
self.files = ""
|
||||||
self.filelist = os.listdir(self.tmppath)
|
self.filelist = os.listdir(self.tmppath)
|
||||||
self.filelist.pop(0)
|
self.filelist.pop(0)
|
||||||
self.filelist.reverse()
|
self.filelist.sort()
|
||||||
self.number = 0
|
self.number = 0
|
||||||
for self.file in self.filelist:
|
for self.file in self.filelist:
|
||||||
self.number += 1
|
self.number += 1
|
||||||
@@ -206,21 +205,20 @@ class Handler:
|
|||||||
self.files_handle = self.fileout.pop(0)
|
self.files_handle = self.fileout.pop(0)
|
||||||
if quality_mode == "default":
|
if quality_mode == "default":
|
||||||
if self.os_type == "linux":
|
if self.os_type == "linux":
|
||||||
self.command_us = f"wine {fsrpath} -QualityMode {quality_setting} {self.files_handle}"
|
self.command_us = f"wine {fsrpath} -QualityMode {quality_setting} {quality_setting} {self.files_handle}"
|
||||||
elif self.os_type == "win32":
|
elif self.os_type == "win32":
|
||||||
self.command_us = f"FidelityFX_CLI -QualityMode {quality_setting} {self.files_handle}"
|
self.command_us = f"FidelityFX_CLI -QualityMode {quality_setting} {quality_setting} {self.files_handle}"
|
||||||
else:
|
else:
|
||||||
print("OS CURRENTLY UNSUPPORTED!")
|
print("OS CURRENTLY UNSUPPORTED!")
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
if self.os_type == "linux":
|
if self.os_type == "linux":
|
||||||
self.command_us = f"wine {fsrpath} -Scale {quality_setting} {self.files_handle} {self.tmppath}"
|
self.command_us = f"wine {fsrpath} -Scale {quality_setting} {quality_setting} {self.files_handle} {self.tmppath}"
|
||||||
elif self.os_type == "win32":
|
elif self.os_type == "win32":
|
||||||
self.command_us = f"FidelityFX_CLI -Scale {quality_setting} {self.files_handle} {self.tmppath}"
|
self.command_us = f"FidelityFX_CLI -Scale {quality_setting} {quality_setting} {self.files_handle} {self.tmppath}"
|
||||||
else:
|
else:
|
||||||
print("OS CURRENTLY UNSUPPORTED!")
|
print("OS CURRENTLY UNSUPPORTED!")
|
||||||
return False
|
return False
|
||||||
print(self.command_us)
|
|
||||||
os.system(self.command_us)
|
os.system(self.command_us)
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from collections.abc import Iterable
|
from collections.abc import Iterable
|
||||||
@@ -47,7 +48,10 @@ def probe(filename, cmd='ffprobe', timeout=None, **kwargs):
|
|||||||
args += convert_kwargs_to_cmd_line_args(kwargs)
|
args += convert_kwargs_to_cmd_line_args(kwargs)
|
||||||
args += [filename]
|
args += [filename]
|
||||||
|
|
||||||
|
if ( sys.platform == 'win32' ):
|
||||||
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||||
|
else:
|
||||||
|
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
communicate_kwargs = {}
|
communicate_kwargs = {}
|
||||||
if timeout is not None:
|
if timeout is not None:
|
||||||
communicate_kwargs['timeout'] = timeout
|
communicate_kwargs['timeout'] = timeout
|
||||||
|
|||||||
Reference in New Issue
Block a user