How to use ffmpeg – Let’s convert the file format

environment

  • mac
  • ffmpeg
  • movImageMagick
  • mov
  • gif

do what

We introduce ffmpeg and movImageMagick to mac. After that, I will actually convert the mov file (if mov file does not exist, it may be good to use QuickTime Player etc) to gif file. In order to use ffmpeg, please introduce Homebrew so that brew command can be used beforehand. *** This article is intended for mac users.

 

ffmpegとmovImageMagick

Ffmpeg to be used from now on is free software that will convert the image / movie format. There are various options, and it moves still more easily. It is also recommended to install movImageMagick in conjunction with ffmpeg’s trial at the same time. movImageMagick compresses movies such as mov to be huge, to a small size. movImageMagick can also be installed easily with the brew command.

Confirm that ffmpeg does not exist

Let’s go for the first time. First of all, make sure ffmpeg is not on macOS。

Install the latest version of ffmpeg

You can install ffmpeg with the following command.

Install imagemagick

Do not forget to download imagemagick after introducing ffmpeg. You can install imagemagick with the following command. Now you can compress large files and convert them to smaller sizes.

Convert mov to gif

Ready if you come here. Convert mov file to gif file with the following command. In the example below, gif is generated by cutting out the specified range from 0 to 10 seconds. If the playback time is long, the file becomes large, so we recommend converting only the necessary parts.

Confirm file size with la -lh

Let’s check the size of the gif file with the following command as a trial. It should surely have been converted with a small size.

Shell for work efficiency

It would be troublesome to hit commands every time on macOS as above. I made a shell to improve work efficiency. Start time, name under the file, end time, newly created file name, a function to be executed by taking these as arguments. Please try using it for alias by all means. Finally, a reference article for that is described below.

How to use

Reference

[urlpreviewbox url=”https://off.tokyo/blog/2018/04/13/mamp%E3%81%AEdb%E3%81%AB%E3%82%A2%E3%82%AF%E3%82%BB%E3%82%B9%E3%81%99%E3%82%8B%E3%82%B7%E3%82%A7%E3%83%AB%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88/”/]

How to use ffmpeg – Let’s convert the file format