added check for movies for avprobe

master
Marc Wäckerlin 8 years ago
parent 154cbcd3a4
commit 38fa86129b
  1. 1
      scripts/mvfotos.conf
  2. 3
      scripts/mvfotos.in

@ -48,6 +48,7 @@ path[9]="bilder3d.mpo"
# file name extensions that contain exif information # file name extensions that contain exif information
exif="jpg jps mpo jpeg" exif="jpg jps mpo jpeg"
movie="mp4 mov 3gp avi m2t mpeg mpg mts mxf"
# number of the clipinfo file type, ${ext[$cpi]} must contain "cpi" # number of the clipinfo file type, ${ext[$cpi]} must contain "cpi"
cpi=4 cpi=4

@ -44,6 +44,9 @@ while [ $# -gt 0 ]; do
postfix=$(basename "$1" | tr '[:upper:]' '[:lower:]' | sed 's,[/ ],_,g;s,[][(){}],,g') postfix=$(basename "$1" | tr '[:upper:]' '[:lower:]' | sed 's,[/ ],_,g;s,[][(){}],,g')
type=${globaltype:-${postfix##*.}} type=${globaltype:-${postfix##*.}}
date= date=
if [ "${movie//${type}/}" != "${movie}" ]; then
date=$(avprobe "$1" 2>&1 | sed -n 's,^ *creation_time *: *\([0-9][0-9][0-9][0-9]\)-\([0-9][0-9]\)-\([0-9][0-9]\) *\([0-9][0-9]\):\([0-9][0-9]\):\([0-9][0-9]\) *$,\1\2\3-\4\5\6,p' | sort | uniq | head -1)
fi
if [ "${exif//${type}/}" != "$exif" ]; then if [ "${exif//${type}/}" != "$exif" ]; then
date=$(exif -t 0x132 "$1" | sed -n 's/.*Value: \([0-9]*\):\([0-9]*\):\([0-9]*\) \([0-9]*\):\([0-9]*\):\([0-9]*\)/\1\2\3-\4\5\6/p' | uniq) date=$(exif -t 0x132 "$1" | sed -n 's/.*Value: \([0-9]*\):\([0-9]*\):\([0-9]*\) \([0-9]*\):\([0-9]*\):\([0-9]*\)/\1\2\3-\4\5\6/p' | uniq)
if [ -z "$date" ]; then if [ -z "$date" ]; then

Loading…
Cancel
Save