DEV Community

loading...

Conway's Game of Life w/ FFmpeg

yohhoy profile image yohhoy ・1 min read

You can play "Conway's Game of Life" with FFmpeg command line tool. I'm not kidding.

Let's generate GIF animation with worldsize=60x60 generation=500.

$ ffmpeg -f lavfi -i life=s=60x60 -vframes 500 lifegame.gif
Enter fullscreen mode Exit fullscreen mode

world60x60-500gen-simple

OK, here is decorated version:

$ ffmpeg -f lavfi -i life=s=60x60:life_color=00ff00:ratio=.5 \
  -sws_flags neighbor -vf scale=360:360,drawgrid=w=6:h=6 \
  -vframes 500 lifegame.gif 
Enter fullscreen mode Exit fullscreen mode

world60x60-500gen

Enjoy!

Discussion (4)

Collapse
ben profile image
Collapse
maxart2501 profile image
Massimo Artizzu

Is this just an Easter egg?

Collapse
yohhoy profile image
yohhoy Author

FYI: "life source" was available from anchent version 0.9 (commitlog). The author said "proof of concept" (ml-post) :D

Collapse
yohhoy profile image
Forem Open with the Forem app