-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvideointerpolater.py
30 lines (25 loc) · 1005 Bytes
/
videointerpolater.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import subprocess
# Header
print("")
print("Video Interpolater. Philipp Wachowitz 2023")
print("Takes an input video and stretches it in time with optical flow applied")
print("WARNING: Very slow. Use only on short clips. High stretch values produce nice glitches")
print("--------------------------------------------------------------------------------------")
print("")
input_file = input("Input File: ")
stretch_factor = input("Stretch factor: ")
output_file = input_file + "-minterpolate.mp4"
# Array für den finalen ffmpeg Befehl
ffmpeg_command = [
"ffmpeg",
"-i",
input_file,
"-filter:v",
f"setpts={int(stretch_factor)}*PTS,minterpolate='fps=25:scd=none:me_mode=bidir:vsbmc=1:search_param=400'",
output_file
]
# Jetzt muss man nur noch den eigentlichen Befehl ausführen und Zackfeddisch.
subprocess.run(ffmpeg_command)
# Wartet auf input damit sich das Fenster nicht automatisch schließt
print("Finished!")
input("Press Enter to exit.")