Add an ffmpeg-python example

This commit is contained in:
Matt McWilliams 2021-05-09 11:45:32 -04:00
parent 522751e9f8
commit b682eb0f9c
2 changed files with 29 additions and 0 deletions

26
python/example.py Normal file
View File

@ -0,0 +1,26 @@
#!/bin/python3
import sys
import ffmpeg
if len(sys.argv) < 3 :
print("Please provide input and output arguments")
exit()
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)

View File

@ -0,0 +1,3 @@
#!/bin/bash
python3 -m pip install ffmpeg-python