How to Use Adobe DNG Converter from the Command Line
Intro
Whenever I shoot a time lapse in raw on my GoPro (affiliate link), it creates one folder that is full of *.JPG
and *.GPR
files. I then find myself moving all the *.JPG
files into a JPG
folder, and all the *.GPR
files into a GPR
folder. I then use Adobe Digital Negative (DNG) Converter to convert the .GPR
files into .DNG
so that I can import them to Final Cut Pro (FCP/FCPX). Adobe DNG Converter is a graphical user interface (GUI) program which means I need to open the program, select input and output destinations, select my settings, all while using the mouse to make my selections. It’s slow and repetitive (not to mention I make the same selections every time). I just want something that I can double click that will move the pictures to their respective folders and start the GPR
to DNG
conversion process. Turns out, as I suspected, the Adobe DNG Converter is running a command line program underneath the hood. Here’s how we can use it without the GUI to “automate” away this repetitive task:
Note that this article assumes you have basic familiarity with the terminal and shell commands
TL;DR
1
matt@mac $ /Applications/Adobe\ DNG\ Converter.app/Contents/MacOS/Adobe\ DNG\ Converter -fl -mp -d /path/to/output/folder /path/to/GPR/folder/*
Where
-fl = embed fast load data
-mp = process multiple files in parallel
default is sequential (one image at a time)
-d = output directory
Additional arguments can be found in this .pdf.
View the scripts I made for this post at my GitHub repo AdobeDNGConverterScripts.
Installation
Go here, download and install the application.
This article was created using Adobe DNG Converter version 16.2.0
Using the GUI
Bring up spotlight (command+space) to search for Adobe DNG Converter.app, press enter to open it. There are four main steps:
- Select the images to convert
- Here I select the folder where I have placed my
.GPR
files
- Here I select the folder where I have placed my
- Select the location to save converted images
- Here I select a
DNG
folder that I created
- Here I select a
- Select a name for converted images
- I normally just change the extension to
.DNG
instead of.dng
just because the GoPro files are.GPR
(capitalized).
- I normally just change the extension to
- Preferences
- I normally just leave these at the default:
- Compatibility: Camera Raw 15.3 and later
- JPEG Preview: Medium Size
- Embed fast load data
- Don’t use lossy compression
- Don’t embed original
Click “Convert” and let the program go to work
Using the Command Line Interface (CLI)
Inside the Adobe DNG Converter.app
is an executable file: Adobe DNG Converter.app/Contents/MacOS/Adobe DNG Converter
1
2
3
4
5
matt@mac $ pwd
/Applications/Adobe DNG Converter.app/Contents/MacOS
matt@mac $ ls -l
total 551496
-rwxr-xr-x 1 root wheel 282361984 Jun 1 2023 Adobe DNG Converter
I’m not sure how to bring up a help menu for it… The CLI for Adobe DNG Converter has limited documentation available. This .pdf is about all I can find. Thankfully, that .pdf
explains some of the acceptable arguments that the executable understands.
If you want the same default settings that the GUI provides, you can use the following command:
1
matt@mac $ /Applications/Adobe\ DNG\ Converter.app/Contents/MacOS/Adobe\ DNG\ Converter -fl -d /path/to/output/folder /path/to/GPR/folder/*
Where
-d = output directory
-fl = embed fast load data
And that’s it! If you look in your /path/to/output/folder
, you should see the converted .DNG
files 🎉
But I’d recommend adding the -mp
flag as it adds a decent boost to processing times:
1
matt@mac $ /Applications/Adobe\ DNG\ Converter.app/Contents/MacOS/Adobe\ DNG\ Converter -fl -mp -d /path/to/output/folder /path/to/GPR/folder/*
-mp = process multiple files in parallel
default is sequential (one image at a time)
My GoPro Organization Script
I wrote a script that will convert take my GoPro’s standard RAW timelapse output:
GOPR0000.GPR
GOPR0000.JPG
GOPR0001.GPR
GOPR0001.JPG
and convert it to:
GPR/
GOPR0000.GPR
GOPR0001.GPR
JPG/
GOPR0000.JPG
GOPR0001.JPG
DNG/
GOPR0000.dng
GOPR0001.dng
You can place organizeGoProDNG.sh into the folder with your GoPro’s images and run it to begin the organization and conversion.
Pro tip: If you change the extension of the script from .sh
to .command
, you can “double click” it in Finder to run it!
DO NOT run random scripts from the internet, especially from untrusted parties. Please review scripts before running them. Even if you don’t understand the script, it’s worth pasting it into a large language model (LLM) such as ChatGPT and asking it to explain the script for you, ask if there is anything dangerous or malicious in it, etc.
Advanced information
Reproducibility
Note that these files are not bitwise reproducible (but they are exactly the same size):
1
2
3
4
5
6
7
8
9
10
11
12
matt@mac $ /Applications/Adobe\ DNG\ Converter.app/Contents/MacOS/Adobe\ DNG\ Converter -fl *.GPR
matt@mac $ /Applications/Adobe\ DNG\ Converter.app/Contents/MacOS/Adobe\ DNG\ Converter -fl *.GPR
matt@mac $ shasum -a 256 *.dng
486395fba712ddaf3265d503f53a21a0977401e95e935857863239017692d49f GOPR0000.dng
66a4c517d62a396977cf101e49026e0dc2d4f9ab0775a6dd96b81e5dcd41daaa GOPR0000_1.dng
5c647d26c98bbcb34f66c7c8530cc006fab6a716d13f42dc98fa63ddb1b0b3e7 GOPR0001.dng
2864621bea9c221750bcea31b52009a063a36ebfd025bc892267e20a22c3986f GOPR0001_1.dng
matt@mac $ ls -l *.dng
-rw-r--r-- 1 matt staff 11876742 Feb 26 22:55 GOPR0000.dng
-rw-r--r-- 1 matt staff 11876742 Feb 26 22:55 GOPR0000_1.dng
-rw-r--r-- 1 matt staff 13340838 Feb 26 22:55 GOPR0001.dng
-rw-r--r-- 1 matt staff 13340838 Feb 26 22:55 GOPR0001_1.dng
Argument runtime and file size comparison
I am using 3000x4000 .GPR
(raw) files shot with my GoPro Hero 8 Black:
1
2
3
4
5
6
7
8
matt@mac $ file *.GPR
GOPR0000.GPR: TIFF image data, little-endian, direntries=58, height=3000, bps=16, compression=JBIG, ITU-T T.85, PhotometricIntepretation=(unknown=0xffff8023), description=C:\DCIM\100GOPRO\GOPR3115.GPR, manufacturer=GoPro, model=HERO8 Black, orientation=[*2*], width=4000
GOPR0001.GPR: TIFF image data, little-endian, direntries=58, height=3000, bps=16, compression=JBIG, ITU-T T.85, PhotometricIntepretation=(unknown=0xffff8023), description=C:\DCIM\100GOPRO\G0029214.GPR, manufacturer=GoPro, model=HERO8 Black, orientation=[*2*], width=4000
matt@mac $ ls -l *.GPR
-rwx------ 1 matt staff 6186776 Feb 26 22:54 GOPR0000.GPR
-rwx------ 1 matt staff 3677656 Feb 26 22:54 GOPR0001.GPR
I wrote a script to compare the runtime and output file sizes of the different arguments for the executable
1
2
3
4
5
6
7
8
9
10
11
matt@mac $ ./compare_AdobeDNGConverter_arguments.sh
Default = 25217580B, .992175s
Using flags -c -p1 -cr7.1 -dng1.7.1 = -.0003828s (0%), +0B (+0%) vs default
Using flags -u -p1 -cr7.1 -dng1.7.1 = -.0146741s (-1%), +0B (+0%) vs default
Using flags -l -p1 -cr7.1 -dng1.7.1 = -.0108651s (-1%), +0B (+0%) vs default
Using flags -c -p1 -e -cr7.1 -dng1.7.1 = -.002032s (0%), +0B (+0%) vs default
Using flags -c -p0 -cr7.1 -dng1.7.1 = -.066626s (-6%), -140136B (0%) vs default
Using flags -c -p2 -cr7.1 -dng1.7.1 = +.7514072s (+75%), +3101062B (+12%) vs default
Using flags -c -p1 -fl -cr7.1 -dng1.7.1 = +.043321s (+4%), +2295970B (+9%) vs default
Using flags -c -p1 -lossy -cr7.1 -dng1.7.1 = +.2135278s (+21%), -8252052B (-32%) vs default
Using flags -c -p1 -mp -cr7.1 -dng1.7.1 = -.3165521s (-31%), +0B (+0%) vs default
This particular example was ran using the two *.GPR
files I mentioned above (available from my GitHub repo).
Flags | Runtime (s) | Runtime (%) | Size (bytes) | Size (%) |
---|---|---|---|---|
-c -p1 -cr7.1 -dng1.7.1 | -.0003828s | 0% | +0B | +0% |
-u -p1 -cr7.1 -dng1.7.1 | -.0146741s | -1% | +0B | +0% |
-l -p1 -cr7.1 -dng1.7.1 | -.0108651s | -1% | +0B | +0% |
-c -p1 -e -cr7.1 -dng1.7.1 | -.002032s | 0% | +0B | +0% |
-c -p0 -cr7.1 -dng1.7.1 | -.066626s | -6% | -140,136B | 0% |
-c -p2 -cr7.1 -dng1.7.1 | +.7514072s | +75% | +3,101,062B | +14% |
-c -p1 -fl -cr7.1 -dng1.7.1 | +.043321s | +4% | +2,295,970B | +4% |
-c -p1 -lossy -cr7.1 -dng1.7.1 | +.2135278s | +21% | -8,252,052B | -63% |
-c -p1 -mp -cr7.1 -dng1.7.1 | -.3165521s | -31% | +0B | +0% |
Where
- Runtime = smaller (negative) is better
- Size = smaller (negative) is better
Outro
Hope this was helpful and can save you some time!
Please let me know in the comments below if you have any suggestions or difficulties.
Thanks for reading!
Comments powered by Disqus.