A neat script that turns your videos into geometric primitives.
Make sure you have ffmpeg
and node
installed!
- Clone the repository
- Run
npm install
- Configure
settings.json
(See Settings) - Run
node index.js
Here are keys and values you can put into your settings.json
file:
Argument | Description | Expected Value |
---|---|---|
shapes | What shapes to use for geometrizing | One or more of: rectangle, rotated_rectangle, triangle, ellipse, rotated_ellipse, circle, line, quadratic_bezier, polyline (separated by space) |
shapeAmount | How many shapes per frame | number higher than 0 (100-1000 recommended) |
candidates | Number of candidate shapes added to image output | number higher than 0 (20-500 recommended) |
mutations | Number of mutations per candidate | number higher than 0 (20-200 recommended) |
alpha | Alpha value of shapes | number between 1-255 (128 recommended) |
fps | Target fps of geometrized video | number higher than 0 |
workers | How many concurrent scripts/threads that compute a section of the video each | number between 0-16 (4-8 recommended) |
Left half: Geometrized
Right half: Original
seagulls.mp4
Resolution | FPS | Length / Time to render | |
---|---|---|---|
Original | 3840x2160 | 60 | 25s long |
Geometrized | 1920x1080 | 24 | took 47m to render |
Settings:
"shapes": "triangle rotated_ellipse circle",
"shapeAmount": 500,
"candidates": 200,
"mutations": 50,
"alpha": 128,
"fps": 24,
"workers": 8
Left half: Original
Right half: Geometrized
wildlife.mp4
Resolution | FPS | Length / Time to render | |
---|---|---|---|
Original | 1920x1080 | 30 | 27s long |
Geometrized | 1920x1080 | 5 | took 10m 27s to render |
Settings:
"shapes": "triangle",
"shapeAmount": 500,
"candidates": 500,
"mutations": 100,
"alpha": 128,
"fps": 5,
"workers": 4