-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideo-to-gif
executable file
·33 lines (28 loc) · 1.24 KB
/
video-to-gif
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
#
# ############################################################################
# Project: scripts (none)
# File...: video-to-gif
# Created: Tuesday, 2020/02/04 - 12:15:50
# Author.: @fbnmtz, ([email protected])
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Last Modified: Sunday, 2023/07/02 - 21:06:02
# Modified By..: @fbnmtz, ([email protected])
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Version: 1.0.3.14
# ~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~·~·~·~·~·~·~·~~·~·~·~·~·~~·~·~·~·~·~·~·~
# Description:
# >
# ############################################################################
# HISTORY:
#
APPHOME="$HOME/videos/myGifs"
mkdir -p "$APPHOME"
# convert video into jpeg image in linux
mplayer -ao null "$1" -vo jpeg:outdir="$APPHOME/$1.output"
# convert video into jpeg image in linux
convert "$APPHOME/$1.output"/* "$APPHOME/$1.output".gif
# We can optimize the screenshots using convert command
convert "$APPHOME/$1.output".gif -fuzz 10% -layers Optimize "$1".gif
# remove unnecessary files
rm -rf "$APPHOME/$1.output"/ "$APPHOME/$1.output".gif