Unfortunately my shell skills are very bad and I would need some help in running a simple script on my QNAP to fix some date problem on some videos.
The script I put in place is very easy:
- in a given folder
- check if there are .mp4 files starting with VID_
- if so, for each of them run a given exiftool command
Here is the script so far, but I guess I am not using the right way to call the variable:
#!/bin/sh
# set target directories
dir="/share/Multimedia/Pictures/"
# move to target directory
cd "$dir"
# check if there is some .mp4 file starting with "VID_" in the folder
VID=$(ls -A $dir | grep 'VID_' | grep './mp4')
if
["$VID"];
then
# for each file in the list
for f in $VID
do
# change all date metadata according to its filename
exiftool "-*date<filename" -wm w $f
done
else
fi
Thanks for your help!
ps: the exiftool instruction is correct (except probably for the variable)