unix4artists/python/example.py

26 lines
507 B
Python

#!/bin/python3
import sys
import ffmpeg
if len(sys.argv) < 3 :
print("Please provide input and output arguments")
quit()
INPUT = sys.argv[1]
OUTPUT = sys.argv[2]
# API documentation
# https://kkroening.github.io/ffmpeg-python/
# create a stream from your input video
# equivalent of: ffmpeg -i "${INPUT}"
stream = ffmpeg.input(INPUT)
# shift all hue values by 180 degrees
# equivalent of: -vf "hue=h=180"
stream = ffmpeg.hue(stream, h=180)
stream = ffmpeg.output(stream, OUTPUT)
ffmpeg.run(stream)