mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-18 00:55:35 +00:00
Add mp4->gif script
This commit is contained in:
parent
c14694effb
commit
9394ceeb3d
4 changed files with 29 additions and 0 deletions
BIN
assets/palette.png
Normal file
BIN
assets/palette.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1,004 B |
BIN
assets/uppy-demo.gif
Normal file
BIN
assets/uppy-demo.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 MiB |
BIN
assets/uppy-demo.mp4
Normal file
BIN
assets/uppy-demo.mp4
Normal file
Binary file not shown.
29
bin/to-gif.sh
Executable file
29
bin/to-gif.sh
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
set -o pipefail
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
# set -o xtrace
|
||||
|
||||
# Set magic variables for current file & dir
|
||||
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
|
||||
__base="$(basename ${__file} .sh)"
|
||||
__root="$(cd "$(dirname "${__dir}")" && pwd)"
|
||||
|
||||
width=600
|
||||
speed=0.7
|
||||
|
||||
ffmpeg \
|
||||
-y \
|
||||
-i "${__root}/assets/uppy-demo.mp4" \
|
||||
-vf fps=10,scale=${width}:-1:flags=lanczos,palettegen "${__root}/assets/palette.png"
|
||||
|
||||
ffmpeg \
|
||||
-y \
|
||||
-i "${__root}/assets/uppy-demo.mp4" \
|
||||
-i "${__root}/assets/palette.png" \
|
||||
-filter_complex "setpts=${speed}*PTS,fps=10,scale=${width}:-1:flags=lanczos[x];[x][1:v]paletteuse" \
|
||||
"${__root}/assets/uppy-demo.gif"
|
||||
|
||||
du -hs "${__root}/assets/uppy-demo.gif"
|
||||
open -a 'Google Chrome' "${__root}/assets/uppy-demo.gif"
|
||||
Loading…
Add table
Add a link
Reference in a new issue