Skip to content

Commit f0e0cf8

Browse files
authored
Merge pull request #286 from amiaopensource/life
adds game of life to test files
2 parents d717935 + 5c1c336 commit f0e0cf8

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

img/life.gif

574 KB
Loading

index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,6 +1894,31 @@ <h3>Makes a broken test file</h3>
18941894
</div>
18951895
<!-- ends Broken File -->
18961896

1897+
<!-- Game of Life -->
1898+
<label class="recipe" for="game_of_life">Conway's Game of Life</label>
1899+
<input type="checkbox" id="game_of_life">
1900+
<div class="hiding">
1901+
<h3>Conway's Game of Life</h3>
1902+
<p>Simulates <a href="https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Conway's Game of Life</a></p>
1903+
<p><code>ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800</code></p>
1904+
<dl>
1905+
<dt>ffplay</dt><dd>starts the command</dd>
1906+
<dt>-f lavfi</dt><dd>tells ffplay to use the <a href="http://ffmpeg.org/ffmpeg-devices.html#lavfi" target="_blank">Libavfilter</a> input virtual device</dd>
1907+
<dt>life=s=300x200</dt><dd>use the life filter and set the size of the video to 300x200</dd>
1908+
<dt>:</dt><dd>indicates there’s another parameter coming</dd>
1909+
<dt>mold=10:r=60:ratio=0.1</dt><dd>sets up the rules of the game: cell mold speed, video rate, and random fill ratio</dd>
1910+
<dt>:</dt><dd>indicates there’s another parameter coming</dd>
1911+
<dt>death_color=#C83232:life_color=#00ff00</dt><dd>specifies color for cell death and cell life; mold_color can also be set</dd>
1912+
<dt>,</dt><dd>comma signifies closing of video source assertion and ready for filter assertion</dd>
1913+
<dt>scale=1200:800</dt><dd>scale to 1280 width and 800 height</dd>
1914+
</dl>
1915+
<img src="img/life.gif" alt="GIF of above command">
1916+
<p>To save a portion of the stream instead of playing it back infinitely, use the following command:</p>
1917+
<p><code>ffmpeg -f lavfi -i life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800 -t 5 <i>output_file</i></code></p>
1918+
<p class="link"></p>
1919+
</div>
1920+
<!-- ends Game of Life -->
1921+
18971922
</div>
18981923
<div class="well">
18991924
<h2 id="ocr">Use OCR</h2>

0 commit comments

Comments
 (0)