DJI File Renamer
Updated on
Tags:
Motivation
I recently acquired a DJI Mini 2 drone. And so far I really enjoy it. When I tried to import the files into Capture One I realized I had a problem. Because the files are distributed across multiple directories (i.e., panorama ) importing the file based on their filename does not preserve the original order in which they were taken. And you cannot copy the files all into one directory because the sub-folders for the panorama pictures always use the same file numbering.
A semi-working workaround for that issue is to sort the files by date. If you only care about the RAW files (or only shoot JPEG) then this should solve the issue. If you want to keep both you are in for a catch. The dates of the RAW and JPEG files for the same image have different timestamps. This means when ordering the images by date, the RAW and JPEG files that belong to each other are not necessarily next to each other in the list and Capture one will consider them separate images instead of the same when importing. Another bummer with that approach is that we also loose the information about which photos belong to the same panorama series (it’s quite difficult to determine that by the autgenerated images at weird angles).
All this bothered me enough to whip up a small tool that correctly renames the files and preserves the ordering and panorama information. It will take a default input folder format that looks likes this:
─── DCIM
├── 100MEDIA
│ ├── DJI_0001.DNG
│ ├── DJI_0001.JPG
│ ├── DJI_0002.html
│ ├── DJI_0003.DNG
│ ├── DJI_0003.JPG
│ ...
│
└── PANORAMA
├── 100_0002
│ ├── DJI_0001.DNG
│ ├── DJI_0001.JPG
│ ├── DJI_0002.DNG
│ ├── DJI_0002.JPG
│ ├── DJI_0003.DNG
│ ├── DJI_0003.JPG
│ ├── DJI_0004.DNG
│ ├── DJI_0004.JPG
│ ├── DJI_0005.DNG
│ ├── DJI_0005.JPG
│ ├── DJI_0006.DNG
│ ├── DJI_0006.JPG
│ ├── DJI_0007.DNG
│ └── DJI_0007.JPG
...
And generates the following filenames by inlining the panorama images. The panorama image have the following format {PREFIX}-{GLOBAL_IMAGE_NUMBER}-PANO-{PANO_MODE}-{PANO_IMAGE_NUMBER}
. As shown below the GLOBAL_IMAGE_NUMBER
is the same for the the files of the same panorma as they all together form the panorama.
├── 2021-06-05---Pittsburgh---0001.DNG
├── 2021-06-05---Pittsburgh---0001.JPG
├── 2021-06-05---Pittsburgh---0002--PANO-SECTOR--0001.DNG
├── 2021-06-05---Pittsburgh---0002--PANO-SECTOR--0001.JPG
├── 2021-06-05---Pittsburgh---0002--PANO-SECTOR--0002.DNG
├── 2021-06-05---Pittsburgh---0002--PANO-SECTOR--0002.JPG
├── 2021-06-05---Pittsburgh---0002--PANO-SECTOR--0003.DNG
├── 2021-06-05---Pittsburgh---0002--PANO-SECTOR--0003.JPG
├── 2021-06-05---Pittsburgh---0002--PANO-SECTOR--0004.DNG
├── 2021-06-05---Pittsburgh---0002--PANO-SECTOR--0004.JPG
├── 2021-06-05---Pittsburgh---0002--PANO-SECTOR--0005.DNG
├── 2021-06-05---Pittsburgh---0002--PANO-SECTOR--0005.JPG
├── 2021-06-05---Pittsburgh---0002--PANO-SECTOR--0006.DNG
├── 2021-06-05---Pittsburgh---0002--PANO-SECTOR--0006.JPG
├── 2021-06-05---Pittsburgh---0002--PANO-SECTOR--0007.DNG
├── 2021-06-05---Pittsburgh---0002--PANO-SECTOR--0007.JPG
├── 2021-06-05---Pittsburgh---0003.DNG
├── 2021-06-05---Pittsburgh---0003.JPG
...
Licenses
Copyright (c) 2021, Sven Stork All rights reserved.
The redistribution of the software without my written permission is prohibited
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The icon is taken from https://icon-icons.com/icon/Drone/115355
Support
If you like to support my work, you can buy me some cookies here:
- Bitcoin: 1EDVLKUUhdfHx9aQpwdNcubCYfs8h5RjYT
- Paypal: https://www.paypal.me/SvenStork/
Installation
You can donwload the OSX disk image here.
After you downloaded the disk image mount it and drag and drop it into the Applications folder:
NOTE: Depending on your system you might need to explicitly permit application to run cf. https://support.apple.com/en-us/HT202491
Usage
The tool was designed to be as simple as possible and always consists of the following steps:
- Selected input folder with the DJI file (this is usually your SD card)
- Select the folder to which to copy the files
- Specify the filename prefix
- Wait for the files to be copied and renamed