How to make a gif image to paste into a Qiita article within 2 minutes

1 minute read

flow

  1. Record (time required 1 minute)
  2. Convert .mov to .gif (1 minute required)

1, record.

Press 1, Shift + Command + 5 (condition: macOS 10.14 Mojave or above) at the same time to start screen recording. Otherwise, launch Quick Time Player.
The famous screenshot command is Shift + Command + 3 or 4 (3 is normal and 4 is the selection).
Shift + Command + 5 shortcuts have been added in macOS 10.14 Mojave and above.
Because it looks like this
スクリーンショット 2020-08-31 22.23.03.png

If you select this,
スクリーンショット 2020-08-31 22.23.47.png

Since “Import” in the above image changes to ** “Record” **,
スクリーンショット 2020-08-31 22.24.57.png
Press ** “Record” ** to start shooting.
When stopped, a .mov file will be created.

2, convert .mov to .gif

Since .mov cannot be placed on Qiita as it is, convert it to .gif.

#Install with homebrew
brew install ffmpeg

#Convert
ffmpeg -i hoge.mov fuga.gif

# (application)If you want smooth movement, increase the frame rate with the r option.(Number of frames per second)
ffmpeg -i hoge.mov -r 10 fuga.gif

When completed, a gif will be created and you can paste it like this.
load2.gif

Supplement

FFmpeg is a free video and audio encoder.
It can be used on Linux, Windows and Mac.
Official site:
https://www.ffmpeg.org/download.html