mirror of
https://github.com/k4yt3x/video2x.git
synced 2024-12-28 23:19:11 +00:00
bumped year to 2023
This commit is contained in:
parent
66f4c17294
commit
b4570cc106
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,5 @@
|
|||||||
# PDM
|
# PDM
|
||||||
.pdm.toml
|
.pdm-python
|
||||||
__pypackages__/
|
__pypackages__/
|
||||||
|
|
||||||
# test videos
|
# test videos
|
||||||
|
2
NOTICE
2
NOTICE
@ -1,5 +1,5 @@
|
|||||||
Video2X
|
Video2X
|
||||||
Copyright (c) 2018-2022 K4YT3X and contributors.
|
Copyright (c) 2018-2023 K4YT3X and contributors.
|
||||||
|
|
||||||
This product depends on FFmpeg, which is available under
|
This product depends on FFmpeg, which is available under
|
||||||
the GNU Lesser General Public License 2.1. The source code can be found at
|
the GNU Lesser General Public License 2.1. The source code can be found at
|
||||||
|
@ -76,7 +76,7 @@ Copyright of this clip belongs to 株式会社アニプレックス.
|
|||||||
## License
|
## 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)\
|
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)
|
![AGPLv3](https://www.gnu.org/graphics/agplv3-155x51.png)
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- 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
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as
|
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"""
|
Contact:\ti@k4yt3x.com"""
|
||||||
|
|
||||||
# algorithms available for upscaling tasks
|
# algorithms available for upscaling tasks
|
||||||
UPSCALING_ALGORITHMS = [
|
UPSCALING_ALGORITHMS = ["waifu2x", "srmd", "realsr", "realcugan", "anime4k"]
|
||||||
"waifu2x",
|
|
||||||
"srmd",
|
|
||||||
"realsr",
|
|
||||||
"realcugan",
|
|
||||||
]
|
|
||||||
|
|
||||||
# algorithms available for frame interpolation tasks
|
# algorithms available for frame interpolation tasks
|
||||||
INTERPOLATION_ALGORITHMS = ["rife"]
|
INTERPOLATION_ALGORITHMS = ["rife"]
|
||||||
@ -194,7 +189,7 @@ def main() -> int:
|
|||||||
# print package version and copyright notice
|
# print package version and copyright notice
|
||||||
logger.opt(colors=True).info(f"<magenta>Video2X {__version__}</magenta>")
|
logger.opt(colors=True).info(f"<magenta>Video2X {__version__}</magenta>")
|
||||||
logger.opt(colors=True).info(
|
logger.opt(colors=True).info(
|
||||||
"<magenta>Copyright (C) 2018-2022 K4YT3X and contributors.</magenta>"
|
"<magenta>Copyright (C) 2018-2023 K4YT3X and contributors.</magenta>"
|
||||||
)
|
)
|
||||||
|
|
||||||
# initialize video2x object
|
# initialize video2x object
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- 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
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as
|
it under the terms of the GNU Affero General Public License as
|
||||||
@ -102,14 +102,12 @@ class VideoDecoder:
|
|||||||
self.pipe_printer.start()
|
self.pipe_printer.start()
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
|
|
||||||
# continue yielding while FFmpeg continues to produce output
|
# continue yielding while FFmpeg continues to produce output
|
||||||
# it is possible to use := for this block to be more concise
|
# it is possible to use := for this block to be more concise
|
||||||
# but it is purposefully avoided to remain compatible with Python 3.7
|
# but it is purposefully avoided to remain compatible with Python 3.7
|
||||||
buffer = self.decoder.stdout.read(3 * self.input_width * self.input_height)
|
buffer = self.decoder.stdout.read(3 * self.input_width * self.input_height)
|
||||||
|
|
||||||
while len(buffer) > 0:
|
while len(buffer) > 0:
|
||||||
|
|
||||||
# convert raw bytes into image object
|
# convert raw bytes into image object
|
||||||
frame = Image.frombytes(
|
frame = Image.frombytes(
|
||||||
"RGB", (self.input_width, self.input_height), buffer
|
"RGB", (self.input_width, self.input_height), buffer
|
||||||
@ -128,7 +126,6 @@ class VideoDecoder:
|
|||||||
self.decoder.send_signal(signal.SIGKILL)
|
self.decoder.send_signal(signal.SIGKILL)
|
||||||
|
|
||||||
def join(self):
|
def join(self):
|
||||||
|
|
||||||
# close PIPEs to prevent process from getting stuck
|
# close PIPEs to prevent process from getting stuck
|
||||||
self.decoder.stdout.close()
|
self.decoder.stdout.close()
|
||||||
self.decoder.stderr.close()
|
self.decoder.stderr.close()
|
||||||
@ -156,9 +153,7 @@ class VideoDecoderThread(Thread):
|
|||||||
self.running = True
|
self.running = True
|
||||||
previous_frame = None
|
previous_frame = None
|
||||||
for frame_index, frame in enumerate(self.decoder):
|
for frame_index, frame in enumerate(self.decoder):
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|
||||||
# check for the stop signal
|
# check for the stop signal
|
||||||
if self.running is False:
|
if self.running is False:
|
||||||
self.decoder.join()
|
self.decoder.join()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- 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
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as
|
it under the terms of the GNU Affero General Public License as
|
||||||
@ -57,7 +57,6 @@ class VideoEncoder:
|
|||||||
copy_data: bool = False,
|
copy_data: bool = False,
|
||||||
copy_attachments: bool = False,
|
copy_attachments: bool = False,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
||||||
# create FFmpeg input for the original input video
|
# create FFmpeg input for the original input video
|
||||||
original = ffmpeg.input(input_path)
|
original = ffmpeg.input(input_path)
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- 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
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as
|
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
|
# if the difference is lower than threshold
|
||||||
# process the interpolation
|
# process the interpolation
|
||||||
if difference_ratio < difference_threshold:
|
if difference_ratio < difference_threshold:
|
||||||
|
|
||||||
# select a processor object with the required settings
|
# select a processor object with the required settings
|
||||||
# create a new object if none are available
|
# create a new object if none are available
|
||||||
processor_object = self.processor_objects.get(algorithm)
|
processor_object = self.processor_objects.get(algorithm)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- 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
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- 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
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU Affero General Public License as
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
Loading…
Reference in New Issue
Block a user