Last active
May 12, 2022 19:10
-
-
Save nestarz/b16df127373420ff41b434b8a942ff29 to your computer and use it in GitHub Desktop.
ffmpeg xstack javascript layout tool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const range = (N) => [...Array(N).keys()]; | |
const outer = ([v1, v2]) => v1.map((x) => v2.map((y) => `${x}_${y}`)); | |
const tile = (N, fn) => | |
range(N).map((i, _, arr) => arr.slice(0, i).map(fn).join("+") || 0); | |
const layout = (N) => | |
outer([tile(N, (k) => `w${k * N}`), tile(N, (k) => `h${k}`)]) | |
.flat() | |
.join("|"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment