Browse Source

correctly handle space in filesane

master
Guillaume Castagnino 2 years ago
parent
commit
69d87e9dd8
  1. 13
      photos/import.sh
  2. 9
      photos/prepare-for-web.sh
  3. 10
      video-convert.sh

13
photos/import.sh

@ -151,6 +151,7 @@ do
;;
esac
done
shift "$((OPTIND-1))"
if [ "x${TITLE}" != "x" ]
then
@ -196,18 +197,18 @@ add_file()
g_files+=("${file}")
}
for rsrc in `seq $OPTIND $#`
for rsrc in "$@"
do
if [ -f "${!rsrc}" ]
if [ -f "${rsrc}" ]
then
add_file ${!rsrc}
elif [ -d "${!rsrc}" ]
add_file "${rsrc}"
elif [ -d "${rsrc}" ]
then
echo "Recursing into '${!rsrc}'"
echo "Recursing into '${rsrc}'"
while read file
do
add_file ${file}
done < <(find "${!rsrc}" -type f | sort)
done < <(find "${rsrc}" -type f | sort)
fi
done

9
photos/prepare-for-web.sh

@ -87,17 +87,18 @@ do
;;
esac
done
shift "$((OPTIND-1))"
echo "Output size set to ${size}"
echo "Output jpeg quality set to ${quality}"
for img in `seq $OPTIND $#`
for img in "$@"
do
if [ -f "${!img}" ]
if [ -f "${img}" ]
then
prepare "${!img}" $size $border $sign $quality
prepare "${img}" $size $border $sign $quality
else
echo "warning : ${!img} does not exists"
echo "warning : ${img} does not exists"
fi
done

10
video-convert.sh

@ -29,14 +29,16 @@ do
;;
esac
done
shift "$((OPTIND-1))"
count=0
intput=""
intput=()
vids=""
concat=""
for arg in `seq $OPTIND $#`
for arg in "$@"
do
input="$input -i ${!arg}"
input[$((2*$count))]="-i"
input[$((2*$count+1))]=${arg}
if [ x"$scale" != x"" ] ; then
vids="$vids [$count:v:0] scale=$scale:$scale:force_original_aspect_ratio=decrease [v$count] ;"
concat="$concat [v$count] [$count:a:0]"
@ -50,5 +52,5 @@ if [ x"$rate" != x"" ] ; then
rate="-r $rate"
fi
ffmpeg "$input" -filter_complex "$filter" -map "[v]" -map "[a]" $rate -c:v libx264 -preset medium -crf $crf -c:a libfdk_aac -b:a 128k -map_metadata 0:g "$output"
ffmpeg "${input[@]}" -filter_complex "$filter" -map "[v]" -map "[a]" $rate -c:v libx264 -preset medium -crf $crf -c:a libfdk_aac -b:a 128k -map_metadata 0:g "$output"
# for i in *.mov ; do ~/scripts/video-convert.sh -o ${i/mov/mkv} $i ; done

Loading…
Cancel
Save