Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
make_movie.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2script=${0##*/}
3
4if [ -z $JPP_DIR ]; then
5 echo "Variable JPP_DIR undefined."
6 exit
7fi
8
9source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
10
11set_variable: DEBUG MOVIE_DEBUG 3
12set_variable: DELAY MOVIE_DELAY 2
13set_variable: WORKDIR MOVIE_WORKDIR ./
14
15if do_usage $*; then
16 usage "$script (input file)+"
17fi
18
19if (( $# == 0 )); then
20 fatal "Wrong number of arguments."
21fi
22
23echo -n "creating animated gif.."
24
25mkdir $WORKDIR/.$$
26
27export MAGICK_TMPDIR=$WORKDIR/.$$
28export MAGICK_MEMORY=$((1<<12))
29
30convert \
31 -delay $DELAY \
32 -limit memory $MAGICK_MEMORY \
33 -limit map $MAGICK_MEMORY \
34 $argv[1,-1] \
35 $WORKDIR/.$$/m.gif
36
37if (( $? == 0 )); then
38 echo "OK"
39else
40 fatal "failed"
41fi
42
43ffmpeg \
44 -i $WORKDIR/.$$/m.gif \
45 -pix_fmt yuv420p \
46 m.mp4
47
48rm -rf $WORKDIR/.$$
49
50echo "enjoy watching m.mp4"