Mac生成gif

2964 ワード

参考記事:https://www.jianshu.com/p/a86efa5147d5前に書いて、文章を参照してインストールした後、gifsicleが欠けていることをヒントにして、brew install gifsicleでインストールした後、lossyが欠けていると言って、brew install giflossyを実行して、gifsicleと衝突していると勘違いして、brew unlink gifsicleでbrew install giflossyを実行してやっと成功しました.
gifify test.mp4 -o test.gif

まとめると、参照記事に従ってインストールしてからbrew install giflossyを実行すればいいのです.参考文書の手順を繰り返します.(参考文書:https://www.jianshu.com/p/a86efa5147d5)

インストール


変換コマンドを行う前に、いくつかの小さな東東をインストールしなければなりません.

homebrew


もしあなたがもう詰めたら、この一歩は見ていないと思っています.そうでなければ、次の2行のスクリプトを端末に貼り付けて実行します.まず、
xcode-select --install


そして
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


意外なことがなければ、homebrewは詰めました.

gifify


次は私たちの本当の主役をインストールします.まず、Nodeをインストールします.js環境(以前にインストールされていた場合は、このステップをスキップします):
brew install node


次に、FFmpegをインストールします
brew install ffmpeg --with-libass --with-fontconfig


再インストールconvert
brew install imagemagick --with-fontconfig


それからpornel/giflossyに行って最新のzipパッケージをダウンロードして、解凍した後にコンピュータと一致する実行ファイルを/usr/local/binの下に置いて、あなたは他の場所に置いてもいいです.それが運行することを保証できればいいです.もしあなたのネットの速度が悪いならば、FFmpegconvertをインストールする時とても遅くて、私は6、7時間使いました.最終取付gifify
npm install -g gifify


実行
gifify -h


問題がなければ、次のような結果になります.
Usage: gifify [options] [file]

  Options:

    -h, --help              output usage information
    -V, --version           output the version number
    --colors             Number of colors, up to 255, defaults to 80
    --compress           Compression (quality) level, from 0 (no compression) to 100, defaults to 40
    --from        Start position, hh:mm:ss or seconds, defaults to 0
    --fps                Frames Per Second, defaults to 10
    -o, --output      Output file, defaults to stdout
    --resize           Resize output, use -1 when specifying only width or height. `350:100`, `400:-1`, `-1:200`
    --speed              Movie speed, defaults to 1
    --subtitles   Subtitle filepath to burn to the GIF
    --text          Add some text at the bottom of the movie
    --to          End position, hh:mm:ss or seconds, defaults to end of movie


エラーがgifsicleに欠けている場合はbrew install giflossyを実行します.それでいい

使用


変換するファイルのディレクトリの下に入ります.例えば、私のmovファイルをデスクトップに置いて、実行します.
cd Desktop/


そして実行
gifify timer.mov -o timer.gif


OK、デスクトップに戻ると、欲しいgifファイルがそこにあることに気づきました.timer.movは変換するファイルだtimergifは転送に成功した後に必要なファイルです.gififyコマンドにより、変換と同時にgifに字幕やサブタイトルなどを挿入することもできます.具体的にはvvo/gififyを参照してください.