Skip to content

Instantly share code, notes, and snippets.

@LittleWat
Last active March 13, 2021 02:45
Show Gist options
  • Save LittleWat/44fb2b4a605dd68b768839cc807e89f1 to your computer and use it in GitHub Desktop.
Save LittleWat/44fb2b4a605dd68b768839cc807e89f1 to your computer and use it in GitHub Desktop.
QuickTimeで取得したmovファイルをgifに変換するスクリプト
#!/bin/bash
# same speed: $ bash ./mov2gif.sh hogehoge.mov
# X2 speed: $ bash ./mov2gif.sh hogehoge.mov 2
INPUT_FILENAME=$1
ARGSPEED=$2
SPEED=${ARGSPEED:=1}
OUTPUT_FILENAME="$1-x${SPEED}.gif"
echo "${INPUT_FILENAME} -> ${OUTPUT_FILENAME}"
ffmpeg -i ${INPUT_FILENAME} -vf scale=320:-1 -vf setpts=PTS/${SPEED} -af atempo=${SPEED} -r 10 ${OUTPUT_FILENAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment