mirror of
				https://github.com/k4yt3x/video2x.git
				synced 2025-11-03 22:21:37 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			583 B
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			583 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.interpolate(
 | 
						|
    pathlib.Path("input.mp4"),   # input video path
 | 
						|
    pathlib.Path("output.mp4"),  # another
 | 
						|
    3,                           # processes: number of parallel processors
 | 
						|
    10,                          # threshold: adjacent frames with > n% diff won't be processed (100 == process all)
 | 
						|
    "rife",                      # algorithm: the algorithm to use to process the video
 | 
						|
)
 |