DJI Drone HDR Files Name Issue

I love to take pictures with my DJI Mavic Air (Generation 1). The best results can be created by using the HDR function on my drone. (By enabling „save all pictures“ and then stack them in a professional photo software.

But this feature is ruining my Lightroom Workflow because:
The parent folder has an unique name, for example

101_0001

but the pictures inside of the folder every time the same names

HDR_0001.DNG
HDR_0002.DNG
HDR_0003.DNG

In Lightroom you can click on the parent folder of all HDR pictures and use the Auto-Stack-Function (by creation time) get all your HDR pictures in stacks and finally merge them.

This results in a new file named:

HDR_0001-HDR.DNG

Now if you want to move all HDR pictures into one folder you will get an error because all the files have the same name.

So I created a script which I can start with the new shortcuts application and every HDR file and panorama file is renamed and the parent folder name will be added.

Also a Backup of your files is created into the /tmp folder. (If you miss something do not restart your machine… this folder will be deleted after a reboot)

#!/bin/bash
#IMPORTANT: You have no name your SD Card your Drone: MavicAirEXT
#IMPORTANT: You have no name your internal Card your Drone: MavicAirINT
#IMPORTANT: My path to the files automatic imported files to Lightroom is: ~/Pictures/XXX-Auto-Import/
#IMPORTANT: My path to the temp HDR files is: ~/Pictures/ZZZ-TMP/HDR/
#IMPORTANT: My path to the temp PANORAMA files is: ~/Pictures/ZZZ-TMP/HDR/
#IMPORTANT: My path to the HDR files is: ~/Pictures/Fotos/00000000\ Drone/HDR/
#IMPORTANT: My path to the PANORAMA files is: ~/Pictures/Fotos/00000000\ Drone/PANORAMA/


#****BACKUP*****
#create a backup of the SD Card's if something went wrong you can find you files in /tmp folder.
#after reboot the backups will be delete
foldername=$(date +%Y%m%d%H%M%S)
mkdir -p /tmp/backup/"$foldername"

mkdir -p /tmp/backup/"$foldername"/MavicAirINT
cp -R /Volumes/MavicAirINT/DCIM/* /tmp/backup/"$foldername"/MavicAirINT

mkdir -p /tmp/backup/"$foldername"/MavicAirEXT
cp -R /Volumes/MavicAirEXT/DCIM/* /tmp/backup/"$foldername"/MavicAirEXT
#****BACKUP-ENDE*****


#****move Files to right place*****
mv /Volumes/MavicAirINT/DCIM/101MEDIA/* ~/Pictures/XXX-Auto-Import/ 2>/dev/null
mv /Volumes/MavicAirEXT/DCIM/101MEDIA/* ~/Pictures/XXX-Auto-Import/ 2>/dev/null
mv /Volumes/MavicAirINT/DCIM/HDR/* ~/Pictures/ZZZ-TMP/HDR/ 2>/dev/null
mv /Volumes/MavicAirEXT/DCIM/HDR/* ~/Pictures/ZZZ-TMP/HDR/ 2>/dev/null
mv /Volumes/MavicAirINT/DCIM/PANORAMA/* ~/Pictures/ZZZ-TMP/PANORAMA/ 2>/dev/null
mv /Volumes/MavicAirEXT/DCIM/PANORAMA/* ~/Pictures/ZZZ-TMP/PANORAMA/ 2>/dev/null

#****replace file name*****
find ~/Pictures/ZZZ-TMP/HDR  -iname '*.DNG' -exec sh -c '
  for img; do
    parentdir=${img%/*}      # leave the parent dir (remove the last `/` and filename)
    dirname=${parentdir##*/} # leave the parent directory name (remove all parent paths `*/`)
    mv -i "$img" "$parentdir/$dirname"_"${img##*/}"
  done
' sh {} +

find ~/Pictures/ZZZ-TMP/PANORAMA  -iname '*.DNG' -exec sh -c '
  for img; do
    parentdir=${img%/*}      # leave the parent dir (remove the last `/` and filename)
    dirname=${parentdir##*/} # leave the parent directory name (remove all parent paths `*/`)
    mv -i "$img" "$parentdir/$dirname"_"${img##*/}"
  done
' sh {} +


#****move Files to right place*****
mv /Users/vschaupper/Pictures/ZZZ-TMP/HDR/* ~/Pictures/Fotos/00000000\ Drone/HDR/ 2>/dev/null
mv /Users/vschaupper/Pictures/ZZZ-TMP/PANORAMA/* ~/Pictures/Fotos/00000000\ Drone/PANORAMA/ 2>/dev/null

#****eject SD Cards*****
diskutil eject /Volumes/MavicAirINT/ 2>/dev/null
diskutil eject /Volumes/MavicAirEXT/ 2>/dev/null

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.

Time limit is exhausted. Please reload the CAPTCHA.

Durch die weitere Nutzung der Seite stimmst du der Verwendung von Cookies zu. Weitere Informationen

Die Cookie-Einstellungen auf dieser Website sind auf "Cookies zulassen" eingestellt, um das beste Surferlebnis zu ermöglichen. Wenn du diese Website ohne Änderung der Cookie-Einstellungen verwendest oder auf "Akzeptieren" klickst, erklärst du sich damit einverstanden.

Schließen