mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
6abcecb10b
commit
e826b5881a
@ -1,13 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#shopt -s extglob
|
||||
#shopt -s nullglob
|
||||
#shopt -s failglob
|
||||
|
||||
|
||||
DEBUG=${DEBUG:-$DRY_RUN}
|
||||
function @ () {
|
||||
[ -z $DEBUG ] \
|
||||
|| echo "### $@"
|
||||
[ -z $DRY_RUN ] \
|
||||
&& $@
|
||||
}
|
||||
|
||||
# XXX add help...
|
||||
# XXX add better options...
|
||||
|
||||
FPS=${FPS:-8}
|
||||
PATTERN=${PATTERN:-'*.@(jpg|jpeg|png)'}
|
||||
# XXX ffmpeg does not seem to support extglob...
|
||||
#PATTERN=${PATTERN:-'*.@(JPG|jpg|JPEG|jpeg|PNG|png)'}
|
||||
PATTERN=${PATTERN:-'*.jpeg'}
|
||||
|
||||
while true ; do
|
||||
while [[ $# != 0 ]] ; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
echo "Usage: $(basename $0) [OPTIONS] [PATTERN]"
|
||||
@ -28,29 +40,23 @@ while true ; do
|
||||
continue
|
||||
;;
|
||||
-p|--pattern)
|
||||
PATTERN="%2"
|
||||
PATTERN="$2"
|
||||
shift 2
|
||||
continue
|
||||
;;
|
||||
|
||||
# trailing args...
|
||||
*)
|
||||
PATTERN="%1"
|
||||
PATTERN="$1"
|
||||
shift
|
||||
exit
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
##if [ "$1" == "-r" ] ; then
|
||||
## FPS="$2"
|
||||
## shift 2
|
||||
##fi
|
||||
##if ! [ -z "$1" ] ; then
|
||||
## PATTERN="$1"
|
||||
##fi
|
||||
|
||||
LST=($PATTERN)
|
||||
|
||||
|
||||
# generate name...
|
||||
A=${LST[0]}
|
||||
A=${A%.*}
|
||||
@ -66,13 +72,13 @@ PALETTE=${PALETTE:-.palette.png}
|
||||
{
|
||||
set -o noglob
|
||||
# gif palette...
|
||||
ffmpeg \
|
||||
@ ffmpeg \
|
||||
-pattern_type glob \
|
||||
-i $PATTERN \
|
||||
-vf palettegen \
|
||||
"$PALETTE"
|
||||
# gif...
|
||||
ffmpeg \
|
||||
@ ffmpeg \
|
||||
-r $FPS \
|
||||
-pattern_type glob \
|
||||
-i $PATTERN \
|
||||
@ -80,10 +86,10 @@ PALETTE=${PALETTE:-.palette.png}
|
||||
-filter_complex paletteuse=dither=none \
|
||||
"${NAME}".gif
|
||||
# cleanup...
|
||||
rm "$PALETTE"
|
||||
@ rm "$PALETTE"
|
||||
|
||||
# mkv...
|
||||
ffmpeg \
|
||||
@ ffmpeg \
|
||||
-r $FPS \
|
||||
-pattern_type glob \
|
||||
-i $PATTERN \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user