Skip to content

Instantly share code, notes, and snippets.

@nyanpasu64
Created January 22, 2020 06:31
Show Gist options
  • Save nyanpasu64/da9625ba34f0aa934553930178528ae6 to your computer and use it in GitHub Desktop.
Save nyanpasu64/da9625ba34f0aa934553930178528ae6 to your computer and use it in GitHub Desktop.
import ffmpeg
input = ffmpeg.input('fm spectrum.mp4')
def f():
a = input.audio
v = input.video
height = 250
v = v.crop(x=0, width="in_w", height=height, y=f"in_h-{height}")
vs = v.split()
v = vs.stream(0)
v1 = vs.stream(1)
v = v.filter("pad", h="2*in_h").overlay(v1.vflip(), y="overlay_h")
return (a, v)
out = ffmpeg.output(*f(), 'fm spectrum out.mp4', acodec="copy")
print(out.get_args())
out.run(overwrite_output=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment