diff --git a/.gitignore b/.gitignore index e6e4765..8f71194 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # PDM -.pdm.toml +.pdm-python __pypackages__/ # test videos diff --git a/NOTICE b/NOTICE index 4bd3981..0a49a2e 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Video2X -Copyright (c) 2018-2022 K4YT3X and contributors. +Copyright (c) 2018-2023 K4YT3X and contributors. This product depends on FFmpeg, which is available under the GNU Lesser General Public License 2.1. The source code can be found at diff --git a/README.md b/README.md index a4df2a6..4d40190 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Copyright of this clip belongs to 株式会社アニプレックス. ## License This project is licensed under the [GNU Affero General Public License Version 3 (GNU AGPL v3)](https://www.gnu.org/licenses/agpl-3.0.txt)\ -Copyright (c) 2018-2022 K4YT3X and contributors. +Copyright (c) 2018-2023 K4YT3X and contributors. ![AGPLv3](https://www.gnu.org/graphics/agplv3-155x51.png) diff --git a/video2x/__main__.py b/video2x/__main__.py index 0c6e510..b279fc5 100755 --- a/video2x/__main__.py +++ b/video2x/__main__.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ -Copyright (C) 2018-2022 K4YT3X and contributors. +Copyright (C) 2018-2023 K4YT3X and contributors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -40,12 +40,7 @@ Github Page:\thttps://github.com/k4yt3x/video2x Contact:\ti@k4yt3x.com""" # algorithms available for upscaling tasks -UPSCALING_ALGORITHMS = [ - "waifu2x", - "srmd", - "realsr", - "realcugan", -] +UPSCALING_ALGORITHMS = ["waifu2x", "srmd", "realsr", "realcugan", "anime4k"] # algorithms available for frame interpolation tasks INTERPOLATION_ALGORITHMS = ["rife"] @@ -194,7 +189,7 @@ def main() -> int: # print package version and copyright notice logger.opt(colors=True).info(f"Video2X {__version__}") logger.opt(colors=True).info( - "Copyright (C) 2018-2022 K4YT3X and contributors." + "Copyright (C) 2018-2023 K4YT3X and contributors." ) # initialize video2x object diff --git a/video2x/decoder.py b/video2x/decoder.py index 28d99a8..c551ee2 100755 --- a/video2x/decoder.py +++ b/video2x/decoder.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ -Copyright (C) 2018-2022 K4YT3X and contributors. +Copyright (C) 2018-2023 K4YT3X and contributors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -102,14 +102,12 @@ class VideoDecoder: self.pipe_printer.start() def __iter__(self): - # continue yielding while FFmpeg continues to produce output # it is possible to use := for this block to be more concise # but it is purposefully avoided to remain compatible with Python 3.7 buffer = self.decoder.stdout.read(3 * self.input_width * self.input_height) while len(buffer) > 0: - # convert raw bytes into image object frame = Image.frombytes( "RGB", (self.input_width, self.input_height), buffer @@ -128,7 +126,6 @@ class VideoDecoder: self.decoder.send_signal(signal.SIGKILL) def join(self): - # close PIPEs to prevent process from getting stuck self.decoder.stdout.close() self.decoder.stderr.close() @@ -156,9 +153,7 @@ class VideoDecoderThread(Thread): self.running = True previous_frame = None for frame_index, frame in enumerate(self.decoder): - while True: - # check for the stop signal if self.running is False: self.decoder.join() diff --git a/video2x/encoder.py b/video2x/encoder.py index 671df9f..ead0f50 100755 --- a/video2x/encoder.py +++ b/video2x/encoder.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ -Copyright (C) 2018-2022 K4YT3X and contributors. +Copyright (C) 2018-2023 K4YT3X and contributors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -57,7 +57,6 @@ class VideoEncoder: copy_data: bool = False, copy_attachments: bool = False, ) -> None: - # create FFmpeg input for the original input video original = ffmpeg.input(input_path) diff --git a/video2x/interpolator.py b/video2x/interpolator.py index 41e55d0..f414962 100755 --- a/video2x/interpolator.py +++ b/video2x/interpolator.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ -Copyright (C) 2018-2022 K4YT3X and contributors. +Copyright (C) 2018-2023 K4YT3X and contributors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -91,7 +91,6 @@ class Interpolator(multiprocessing.Process): # if the difference is lower than threshold # process the interpolation if difference_ratio < difference_threshold: - # select a processor object with the required settings # create a new object if none are available processor_object = self.processor_objects.get(algorithm) diff --git a/video2x/pipe_printer.py b/video2x/pipe_printer.py index a6cd22a..16e55a1 100755 --- a/video2x/pipe_printer.py +++ b/video2x/pipe_printer.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ -Copyright (C) 2018-2022 K4YT3X and contributors. +Copyright (C) 2018-2023 K4YT3X and contributors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/video2x/processor.py b/video2x/processor.py index 5e8569a..0ab3aa9 100755 --- a/video2x/processor.py +++ b/video2x/processor.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ -Copyright (C) 2018-2022 K4YT3X and contributors. +Copyright (C) 2018-2023 K4YT3X and contributors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as