0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Automatorでmovをgifに変換するスクリプトを作成する

Last updated at Posted at 2020-05-12

会社の人に教えてもらったAutomatorでmovをgifに変換するスクリプトを作成する方法を、忘れないように記事にしておく
教えていただいた方の言葉とキャプチャ、非常にわかりやすかったので、ほぼ、そのまま流用させていただきました:bow:

ffmpeg をインストール

brew install ffmpeg

Automator の設定

1. brew install ffmpegしたあと、以下の設定でAutomatorを保存します。

保存したファイル名で、クイックアクションに登録されるので、以降は、そこから一発変換できます。

DIRNAME=`dirname $@`
BASENAME=`basename $@`
/opt/homebrew/bin/ffmpeg -i $@ -r 10 -vf scale=300:-1 ${DIRNAME}/${BASENAME}.gif

※Intel Macを使っている場合は、/usr/local/bin/ffmpeg になります

2. 以下のキャプチャのように設定する

スクリーンショット 2019-10-29 18.21.52.png
スクリーンショット 2019-10-29 18.22.20.png
スクリーンショット_2019-10-29_18_23_21.png

Automatorの「ワークフローが受け取る現在の項目」を「ファイルまたはフォルダ」もしくは、「ムービーファイル」にしておきます。
スクリーンショット 2019-10-29 18.31.43.png

拡張子を mp4 に変えたバージョンも作っておくと便利です。

DIRNAME=`dirname $@`
BASENAME=`basename $@`
/opt/homebrew/bin/ffmpeg -i $@ -crf 28 -vf scale=300:-1 ${DIRNAME}/${BASENAME}.gif

参考
https://syobochim.hatenablog.com/entry/2021/01/07/004600
https://tech.ckme.co.jp/ffmpeg_h264.shtml
https://qiita.com/riversun/items/d09d8e596a20ec1798f3

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?