mirror of
https://github.com/k4yt3x/video2x.git
synced 2024-12-28 23:19:11 +00:00
25 lines
798 B
Python
Executable File
25 lines
798 B
Python
Executable File
#!/usr/bin/python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# built-in imports
|
|
import pathlib
|
|
|
|
# import video2x
|
|
from video2x import Video2X
|
|
|
|
|
|
# create video2x object
|
|
video2x = Video2X()
|
|
|
|
# run upscale
|
|
video2x.upscale(
|
|
pathlib.Path("input.mp4"), # input video path
|
|
pathlib.Path("output.mp4"), # another
|
|
None, # width: width of output, None == auto
|
|
720, # height: height of output, None == auto
|
|
3, # noise: noise level, algorithm-dependent
|
|
5, # processes: number of parallel processors
|
|
0, # threshold: adjacent frames with < n% diff won't be processed (0 == process all)
|
|
"waifu2x", # algorithm: the algorithm to use to process the video
|
|
)
|