Skip to content

Instantly share code, notes, and snippets.

View api-haus's full-sized avatar
:octocat:

georgie api-haus

:octocat:
  • Kyiv, Ukraine
  • 21:39 (UTC +03:00)
View GitHub Profile
@api-haus
api-haus / cf.mjs
Last active December 17, 2023 05:31
Make perfectly looping cross-fading video. Using FFmpeg with transparency support (on .webm and .mov).
#!/usr/bin/env zx
// Establish program arguments
const input = argv.i;
const output = argv.o;
const fadeDuration = parseInt(argv.f);
const useTransparency = argv.t;
// Quality options
const bitRate = argv.b;
const constantRateFactor = argv.crf;