Exif Data in pictures and videos

Please post your questions about using the web-based Photo, Music, Video Stations here.
Post Reply
New here
Posts: 8
Joined: Fri Jan 13, 2012 9:14 pm

Exif Data in pictures and videos

Post by iamklaus » Mon May 21, 2018 4:35 pm

Hey guys,

I regularly upload pictures from my families smartphone to a common upload folder. Until now the pictures are flat and unsorted within this folder.

Recently I wrote a bash script, which loops through the files, read the creation date from the exif data and moves the file into a folder structure. This word perfectly with images. I use the tool "identify" from imagemagick, which is already installed on the QNAP nas. Now I loog for a similar tool for the (mainly) MP4 files.

Any recommendations?

And for those who are interested in the script, here it is:

Code: Select all


shopt -s nullglob

for filename in "$INPUT_DIR/"*.{jpg,jpeg,png,JPG,PNG}; do
        imageDateTaken=$(identify -verbose $filename | grep date:modify | awk '{ print $2 }' | awk '{ print substr ($1,1,7) }')

   if [ ! -d "$OUTPUT_DIR/$imageDateTaken" ]; then
            mkdir $OUTPUT_DIR/$imageDateTaken

   cp -v $filename $OUTPUT_DIR/$imageDateTaken
   rm -v $filename


User avatar
Ask me anything
Posts: 7793
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: Exif Data in pictures and videos

Post by OneCD » Mon May 21, 2018 4:46 pm

Nice work! :geek:

Try mediainfo. It's available via the Entware QPKG:

Code: Select all

opkg install mediainfo

ffprobe is another good one:

Code: Select all

opkg install ffprobe


Post Reply

Return to “Photo Station, Music Station, Video Station”