-
Notifications
You must be signed in to change notification settings - Fork 0
/
paletteuse.py
29 lines (27 loc) · 866 Bytes
/
paletteuse.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
import ffmpeg
from datetime import datetime
import argparse
def paletteuse(_input, _output):
(
ffmpeg
.filter(
[
ffmpeg.input(_input),
ffmpeg.input('nord-palette.png')
],
filter_name='paletteuse',
dither='none'
)
.output(_output, loglevel='quiet')
.run(overwrite_output=True)
)
if __name__ == "__main__":
start_time = datetime.now()
a = argparse.ArgumentParser()
a.add_argument("input", metavar="input", type=str, help="input filename")
a.add_argument("-o", "--output", metavar="output", type=str, help="output filename", default="movie_no_ffmpeg.mp4")
args = a.parse_args()
input = args.input
output = args.output
paletteuse(input, output)
print('Duration: {}'.format(datetime.now() - start_time))