-
Notifications
You must be signed in to change notification settings - Fork 0
/
gif-anim-make-gif
executable file
·43 lines (39 loc) · 979 Bytes
/
gif-anim-make-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
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
SETTINGS="$SCRIPTPATH/gif-anim-settings"
. "$SETTINGS" || {
echo "Error running '$SETTINGS' to get settings" >&2;
exit 1;
}
echo "Input frames ($ga_dir_frames):"
cd "$ga_dir_frames" || {
echo "Error changing to frames dir: $ga_dir_frames" >&2;
exit 1;
}
{ ls -gGl ???".$ga_frame_ext";
ls -gGl ????*".$ga_frame_ext"
} 2>/dev/null |
head -5 | sed -e 's/^/ /'
echo ' ...'
#convert -delay 20 -loop 0 *.jpg myimage.gif
# -framerate is input assumption (like, 60 fps, and output 60 fps)
# -r results in dividing input fps SKIPPING IMAGES
# -framerate 60 -r 15 means: final_fps = 60/15 = 4 (every 4 images)
# -r 1 \
# -vf scale=512:-1 \
ffmpeg \
-y \
-loglevel warning \
-framerate "$ga_fps" \
-r 1 \
-pattern_type glob \
-i '*.png' \
"$ga_fn_out_raw" \
;
if [[ ! -f "$ga_fn_out_raw" ]]; then
echo "Error creating $ga_fn_out_raw" >&2
exit 1
else
echo "Created $ga_fn_out_raw"
fi