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
|
#!/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}
|
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
|
case "$1" in
|
||||||
-h|--help)
|
-h|--help)
|
||||||
echo "Usage: $(basename $0) [OPTIONS] [PATTERN]"
|
echo "Usage: $(basename $0) [OPTIONS] [PATTERN]"
|
||||||
@ -28,29 +40,23 @@ while true ; do
|
|||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
-p|--pattern)
|
-p|--pattern)
|
||||||
PATTERN="%2"
|
PATTERN="$2"
|
||||||
shift 2
|
shift 2
|
||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
# trailing args...
|
||||||
*)
|
*)
|
||||||
PATTERN="%1"
|
PATTERN="$1"
|
||||||
shift
|
shift
|
||||||
exit
|
continue
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
##if [ "$1" == "-r" ] ; then
|
|
||||||
## FPS="$2"
|
|
||||||
## shift 2
|
|
||||||
##fi
|
|
||||||
##if ! [ -z "$1" ] ; then
|
|
||||||
## PATTERN="$1"
|
|
||||||
##fi
|
|
||||||
|
|
||||||
LST=($PATTERN)
|
LST=($PATTERN)
|
||||||
|
|
||||||
|
|
||||||
# generate name...
|
# generate name...
|
||||||
A=${LST[0]}
|
A=${LST[0]}
|
||||||
A=${A%.*}
|
A=${A%.*}
|
||||||
@ -66,13 +72,13 @@ PALETTE=${PALETTE:-.palette.png}
|
|||||||
{
|
{
|
||||||
set -o noglob
|
set -o noglob
|
||||||
# gif palette...
|
# gif palette...
|
||||||
ffmpeg \
|
@ ffmpeg \
|
||||||
-pattern_type glob \
|
-pattern_type glob \
|
||||||
-i $PATTERN \
|
-i $PATTERN \
|
||||||
-vf palettegen \
|
-vf palettegen \
|
||||||
"$PALETTE"
|
"$PALETTE"
|
||||||
# gif...
|
# gif...
|
||||||
ffmpeg \
|
@ ffmpeg \
|
||||||
-r $FPS \
|
-r $FPS \
|
||||||
-pattern_type glob \
|
-pattern_type glob \
|
||||||
-i $PATTERN \
|
-i $PATTERN \
|
||||||
@ -80,10 +86,10 @@ PALETTE=${PALETTE:-.palette.png}
|
|||||||
-filter_complex paletteuse=dither=none \
|
-filter_complex paletteuse=dither=none \
|
||||||
"${NAME}".gif
|
"${NAME}".gif
|
||||||
# cleanup...
|
# cleanup...
|
||||||
rm "$PALETTE"
|
@ rm "$PALETTE"
|
||||||
|
|
||||||
# mkv...
|
# mkv...
|
||||||
ffmpeg \
|
@ ffmpeg \
|
||||||
-r $FPS \
|
-r $FPS \
|
||||||
-pattern_type glob \
|
-pattern_type glob \
|
||||||
-i $PATTERN \
|
-i $PATTERN \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user