Skip to content

How the GIF is Done?

Maxim Zaitsev edited this page Apr 14, 2019 · 2 revisions

I use the method described by Colten Jackson in his article.

Steps:

  1. Set up webserver on localhost. The server sends to its clients index.html, which is a copy of the site's home page. Example of a configuration file:

    # cat ws.conf
    document-root /home/max/Documents/repos/simon/site/
    log /tmp/ws.log
    user nobody
    group nobody
    host 127.0.0.1
    # ./webserver ws.conf
  2. Include the following line to /etc/hosts: 127.0.0.1 simonstalenhag.se

  3. Use netem to slow down lo interface (see this):

    sudo tc qdisc add dev lo root handle 1: htb default 12 
    sudo tc class add dev lo parent 1:1 classid 1:12 htb rate 56kbps ceil 128kbps 
  4. Prepare a folder for the demonstration. It contains a link to the script and a snapshot.

  5. Prepare terminal (transparency, title, size) and a background image.

  6. Prepare commands to execute during a recording.

    ffmpeg -video_size 695x335 -framerate 5 -f x11grab -i :0.0+145,105 output.mp4
    
  7. Cut a second from the begining and on the end:

    ffmpeg -i output.mp4 -ss 00:00:1 -t 27 cutted.mp4
    
  8. Make a palette.png:

    ffmpeg -i cutted.mp4 -filter_complex "palettegen" palette.png
    
  9. Create a gif:

    ffmpeg -i cutted.mp4 -i palette.png -filter_complex "paletteuse" res.gif
    
  10. Download here https://github.com/7aitsev/simon/issues/4

  11. Update README.md

Clone this wiki locally