DEV Community

yohhoy
yohhoy

Posted on

Conway's Game of Life w/ FFmpeg

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!

Top comments (4)

Collapse
 
ben profile image
Ben Halpern

Ah cool!

Collapse
 
maxart2501 profile image
Massimo Artizzu

Is this just an Easter egg?

Collapse
 
yohhoy profile image
yohhoy

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

Collapse
 
yohhoy profile image
yohhoy

RIP John Conway (xkcd.com)