fixed ffmpeg errors and added cli
This commit is contained in:
Binary file not shown.
@@ -71,17 +71,18 @@ class Handler:
|
|||||||
else:
|
else:
|
||||||
print("OS CURRENTLY UNSUPPORTED!")
|
print("OS CURRENTLY UNSUPPORTED!")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
os.system(self.command)
|
os.system(self.command)
|
||||||
print("photo upscaled")
|
print("photo upscaled")
|
||||||
else:
|
else:
|
||||||
if self.os_type == "linux":
|
if self.os_type == "linux":
|
||||||
self.command = f"wine {fsrpath} -Scale {quality_setting} {self.filepath} {output_path}"
|
self.command = f"wine {fsrpath} -Scale {quality_setting} {quality_setting} {self.filepath} {output_path}"
|
||||||
elif self.os_type == "win32":
|
elif self.os_type == "win32":
|
||||||
self.command = f"{fsrpath} -Scale {quality_setting} {self.filepath} {output_path}"
|
self.command = f"{fsrpath} -Scale {quality_setting} {quality_setting} {self.filepath} {output_path}"
|
||||||
else:
|
else:
|
||||||
print("OS CURRENTLY UNSUPPORTED!")
|
print("OS CURRENTLY UNSUPPORTED!")
|
||||||
return False
|
return False
|
||||||
|
print( self.command )
|
||||||
|
|
||||||
os.system(self.command)
|
os.system(self.command)
|
||||||
print("photo upscaled")
|
print("photo upscaled")
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
15
bin/lib/ffmpeg/pyproject.toml
Normal file
15
bin/lib/ffmpeg/pyproject.toml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
[tool.black]
|
||||||
|
skip-string-normalization = true
|
||||||
|
target_version = ['py27'] # TODO: drop Python 2 support (... "Soon").
|
||||||
|
include = '\.pyi?$'
|
||||||
|
exclude = '''
|
||||||
|
(
|
||||||
|
/(
|
||||||
|
\.eggs
|
||||||
|
| \.git
|
||||||
|
| \.tox
|
||||||
|
| \venv
|
||||||
|
| dist
|
||||||
|
)/
|
||||||
|
)
|
||||||
|
'''
|
||||||
2
bin/lib/ffmpeg/pytest.ini
Normal file
2
bin/lib/ffmpeg/pytest.ini
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[pytest]
|
||||||
|
testpaths = ffmpeg/tests
|
||||||
2
bin/lib/ffmpeg/setup.cfg
Normal file
2
bin/lib/ffmpeg/setup.cfg
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[aliases]
|
||||||
|
test=pytest
|
||||||
100
bin/lib/ffmpeg/setup.py
Normal file
100
bin/lib/ffmpeg/setup.py
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
from setuptools import setup
|
||||||
|
from textwrap import dedent
|
||||||
|
|
||||||
|
version = '0.2.0'
|
||||||
|
download_url = 'https://github.com/kkroening/ffmpeg-python/archive/v{}.zip'.format(
|
||||||
|
version
|
||||||
|
)
|
||||||
|
|
||||||
|
long_description = dedent(
|
||||||
|
'''\
|
||||||
|
ffmpeg-python: Python bindings for FFmpeg
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
:Github: https://github.com/kkroening/ffmpeg-python
|
||||||
|
:API Reference: https://kkroening.github.io/ffmpeg-python/
|
||||||
|
'''
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
file_formats = [
|
||||||
|
'aac',
|
||||||
|
'ac3',
|
||||||
|
'avi',
|
||||||
|
'bmp',
|
||||||
|
'flac',
|
||||||
|
'gif',
|
||||||
|
'mov',
|
||||||
|
'mp3',
|
||||||
|
'mp4',
|
||||||
|
'png',
|
||||||
|
'raw',
|
||||||
|
'rawvideo',
|
||||||
|
'wav',
|
||||||
|
]
|
||||||
|
file_formats += ['.{}'.format(x) for x in file_formats]
|
||||||
|
|
||||||
|
misc_keywords = [
|
||||||
|
'-vf',
|
||||||
|
'a/v',
|
||||||
|
'audio',
|
||||||
|
'dsp',
|
||||||
|
'FFmpeg',
|
||||||
|
'ffmpeg',
|
||||||
|
'ffprobe',
|
||||||
|
'filtering',
|
||||||
|
'filter_complex',
|
||||||
|
'movie',
|
||||||
|
'render',
|
||||||
|
'signals',
|
||||||
|
'sound',
|
||||||
|
'streaming',
|
||||||
|
'streams',
|
||||||
|
'vf',
|
||||||
|
'video',
|
||||||
|
'wrapper',
|
||||||
|
]
|
||||||
|
|
||||||
|
keywords = misc_keywords + file_formats
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name='ffmpeg-python',
|
||||||
|
packages=['ffmpeg'],
|
||||||
|
version=version,
|
||||||
|
description='Python bindings for FFmpeg - with complex filtering support',
|
||||||
|
author='Karl Kroening',
|
||||||
|
author_email='karlk@kralnet.us',
|
||||||
|
url='https://github.com/kkroening/ffmpeg-python',
|
||||||
|
download_url=download_url,
|
||||||
|
keywords=keywords,
|
||||||
|
long_description=long_description,
|
||||||
|
install_requires=['future'],
|
||||||
|
extras_require={
|
||||||
|
'dev': [
|
||||||
|
'future==0.17.1',
|
||||||
|
'numpy==1.16.4',
|
||||||
|
'pytest-mock==1.10.4',
|
||||||
|
'pytest==4.6.1',
|
||||||
|
'Sphinx==2.1.0',
|
||||||
|
'tox==3.12.1',
|
||||||
|
]
|
||||||
|
},
|
||||||
|
classifiers=[
|
||||||
|
'Intended Audience :: Developers',
|
||||||
|
'License :: OSI Approved :: Apache Software License',
|
||||||
|
'Natural Language :: English',
|
||||||
|
'Operating System :: OS Independent',
|
||||||
|
'Programming Language :: Python',
|
||||||
|
'Programming Language :: Python :: 2',
|
||||||
|
'Programming Language :: Python :: 2.7',
|
||||||
|
'Programming Language :: Python :: 3',
|
||||||
|
'Programming Language :: Python :: 3.3',
|
||||||
|
'Programming Language :: Python :: 3.4',
|
||||||
|
'Programming Language :: Python :: 3.5',
|
||||||
|
'Programming Language :: Python :: 3.6',
|
||||||
|
'Programming Language :: Python :: 3.7',
|
||||||
|
'Programming Language :: Python :: 3.8',
|
||||||
|
'Programming Language :: Python :: 3.9',
|
||||||
|
'Programming Language :: Python :: 3.10',
|
||||||
|
],
|
||||||
|
)
|
||||||
24
bin/lib/ffmpeg/tox.ini
Normal file
24
bin/lib/ffmpeg/tox.ini
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Tox (https://tox.readthedocs.io/) is a tool for running tests
|
||||||
|
# in multiple virtualenvs. This configuration file will run the
|
||||||
|
# test suite on all supported python versions. To use it, "pip install tox"
|
||||||
|
# and then run "tox" from this directory.
|
||||||
|
|
||||||
|
[tox]
|
||||||
|
envlist = py27, py35, py36, py37, py38, py39, py310
|
||||||
|
|
||||||
|
[gh-actions]
|
||||||
|
python =
|
||||||
|
2.7: py27
|
||||||
|
3.5: py35
|
||||||
|
3.6: py36
|
||||||
|
3.7: py37
|
||||||
|
3.8: py38
|
||||||
|
3.9: py39
|
||||||
|
3.10: py310
|
||||||
|
|
||||||
|
[testenv]
|
||||||
|
commands = py.test -vv
|
||||||
|
deps =
|
||||||
|
future
|
||||||
|
pytest
|
||||||
|
pytest-mock
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
[PathSettings]
|
[PathSettings]
|
||||||
defaultOutputPath = $HOME/FSRImageVideoUpscaler/
|
defaultOutputPath = $HOME/FSRImageVideoUpscaler/
|
||||||
tmpPathLinux = /tmp/
|
tmpPathLinux = /tmp/
|
||||||
tmpPathWindows = %TEMP%
|
tmpPathWindows = temp
|
||||||
ffmpeg = ./bin/lib/ffmpeg.exe
|
ffmpeg = ./bin/lib/ffmpeg.exe
|
||||||
|
|
||||||
[DevSettings]
|
[DevSettings]
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import ffmpeg
|
import bin.lib.ffmpeg
|
||||||
|
|
||||||
|
ffmpeg = bin.lib.ffmpeg
|
||||||
|
|
||||||
|
|
||||||
class MetaDataParser:
|
class MetaDataParser:
|
||||||
|
|||||||
@@ -11,9 +11,11 @@ import argparse
|
|||||||
import bin.handler
|
import bin.handler
|
||||||
|
|
||||||
ap = argparse.ArgumentParser(description="FSRImageVideoUpscaler - CLI")
|
ap = argparse.ArgumentParser(description="FSRImageVideoUpscaler - CLI")
|
||||||
ap.add_argument("Input file", help="Path to txt file containing the testdata")
|
ap.add_argument("inputfile", help="File path for the video / image to be upscaled")
|
||||||
|
ap.add_argument("outputfile", help="File path for the video / image that was upscaled")
|
||||||
|
ap.add_argument('-s', '--scalefactor', help="Scale factor for the video / image")
|
||||||
args = ap.parse_args()
|
args = ap.parse_args()
|
||||||
|
|
||||||
handler = bin.handler.Handler()
|
handler = bin.handler.Handler()
|
||||||
|
|
||||||
handler.handler( 'bin/lib/FidelityFX_CLI.exe', )
|
handler.handler( 'bin/lib/FidelityFX_CLI.exe', args.inputfile, 'custom', '2x', args.outputfile )
|
||||||
Reference in New Issue
Block a user