22 Replies Latest reply: Mar 26, 2014 2:08 PM by dezso: RSS

    Latest DNG converter not working in command-line mode

    Community Member
      Today I downloaded Adobe's latest DNG converter. It is failing with both .NEF and .CR2 files when run in command-line mode. It does appear to work in GUI mode. The switches+arguments I've used for my tests are:

      -u -e -p1 filename.CR2

      (or filename.NEF)

      With an older (CS2) version of the converter, the above arguments produce a .DNG output file as expected (with .CR2 files; I didn't try it with D3 .NEF files; surely that older version doesn't support the D3's format).

      With the very latest version, running the program with the above command produces no output. There's no error message.

      The 'readme' file that comes with the converter doesn't include any information about command-line usage, but I did find a PDF file covering this (adobe.com/products/dng/pdfs/dng_commandline.pdf). The switches+arguments shown in the PDF file appear to be exactly the ones I used in the past.

      I'm sure I'll need to use the most recent version to convert D3 RAW files. Is there something wrong with how I'm specifying its command-line switches/arguments?
        • 1. Re: Latest DNG converter not working in command-line mode
          Community Member
          Is there anyone from Adobe who might have the time to respond to this question? Given the command-line switches and arguments shown in the previous message, does it look as if I am giving the commands incorrectly?
          • 2. Re: Latest DNG converter not working in command-line mode
            Thomas Knoll Community Member
            Macintosh or Windows? What command line shell are you using?
            • 3. Re: Latest DNG converter not working in command-line mode
              Community Member
              > Macintosh or Windows? What command line shell are you using?

              I'm running the converter under Windows XP service pack 2.

              After seeing your reply I realized I had not tried running the program in a cmd.exe console window -- I'd been using only the 4NT version 5 command shell (meaning JP Software's command shell product 4nt.exe). For this latest attempt, I used both shells. The arguments/switches were:

              -u -e -p1 -o _MG_0972.CR2 _MG_0972.dng

              This time I added an explicit switch/arg for the output file to see if that would make any difference.

              Result in both the cmd.exe shell and the 4NT shell:

              I got output with the DNG converter that was released at about the time Photoshop CS2 was released, but no output with the one I downloaded most recently from Adobe's web site.

              Variations: 1) omitted "-o filename" -- same results. 2) omitted "-o" and used "*.cr2" for the input filename; in that case neither converter version produced output; 3) omitted "-o" and used ".\" for the input file, in case the converter would accept that for "all raw files in the current directory" -- again neither converter version produced any output.
              • 4. Re: Latest DNG converter not working in command-line mode
                Thomas Knoll Community Member
                Try typing a full path to the file and see what happens.
                • 5. Re: Latest DNG converter not working in command-line mode
                  Thomas Knoll Community Member
                  Recent version of the DNG Converter for Windows have required full path names in command line mode (rather than allowing paths relative to the working directory). I have just fixed this in the code and the fix will appear in the next release (5.2).
                  • 6. Re: Latest DNG converter not working in command-line mode
                    Community Member
                    > Recent version of the DNG Converter for Windows have required full path names in command line mode (rather than allowing paths relative to the working directory). I have just fixed this in the code and the fix will appear in the next release (5.2).

                    That's good to hear. I'll look forward to it, and in the meantime will use the workaround with the fully qualified path name.

                    (Feature request for some future version: the ability to specify multiple files via wildcard in command-line mode. This doesn't seem to be supported yet...)

                    Thanks.
                    • 7. Re: Latest DNG converter not working in command-line mode
                      Community Member
                      I have another issue that has been asked previously but not addressed. I'm trying to use the -d switch to specify that files should be saved in C:\RAW_Destination. I have used the following command variations:

                      1. C:\[path to DNG exe]\Adobe DNG Converter.exe -d c:\RAW_Destination c:\RAW_Source

                      2. C:\[path to DNG exe]\Adobe DNG Converter.exe -dc:\RAW_Destination c:\RAW_Source

                      3. C:\[path to DNG exe]\Adobe DNG Converter.exe dc:\RAW_Destination c:\RAW_Source

                      4. C:\[path to DNG exe]\Adobe DNG Converter.exe d c:\RAW_Destination c:\RAW_Source

                      Variation 1: does not run
                      Variation 2: runs without the correct destination directory, but with the correct source directory
                      Variation 3: runs without the correct destination directory, but with the correct source directory
                      Variation 4: thinks the destination I've specified is actually another input parameter

                      What is the correct syntax for the -d parameter? Is there a dash before, and a space after? Do I need to separate the parameters from the input files with some character?

                      Thanks very much for your help.
                      • 8. Re: Latest DNG converter not working in command-line mode
                        Community Member
                        I have been able to get this to work only as follows:

                        converter -p1 -d outputdir inputfile

                        where:

                        "converter" is the name of the converter (with path, unless its location is already in your %PATH%)

                        "outputdir" is the fully qualified path of the output directory

                        "inputfile" is the fully qualified path of the input file

                        Emphasis on "fully qualified". The DNG converter -- at least the version of it I have here -- doesn't understand that no path being specified indicates "current directory", and it doesn't appear to understand relative paths, either.

                        Here's an example of a command line that worked for me (should be on a single line, of course):

                        "Adobe DNG Converter 3.3.exe" -p1 -d d:\photography\test\dng_output d:\photography\test\filename.cr2

                        The program doesn't know how to create a directory and fails silently (returning an exit code of 0, unfortunately) when the output directory you specified doesn't exist. I found that the same occurs (silent termination, exit code 0) when the input file is in a format the converter doesn't support -- for instance, I have here some .NEF files from the D3, and the converter version I'm using doesn't support D3 files. I knew it wouldn't work but tried it as a test. There were no error messages and the exit code was 0.

                        There doesn't appear to be any wildcard support. I haven't been able to get the converter to process an entire directory's-worth of RAW files by simply specifying the input directory's name (even a fully qualified path). To convert more than one RAW file from the command line, I've had to write a script that passes instructions to the converter via a loop that processes one file at a time. I considered writing a tool whose purpose in life is to be a glorified "for" loop that runs the DNG converter on multiple files, then posting it on some web site...never did get around to it...
                        • 9. Re: Latest DNG converter not working in command-line mode
                          Community Member
                          That's fascinating, Mike, since that's exactly what I've been trying.

                          I verified that I am in fact passing the fully qualified path. But, oddly, the app fails silently if I pass _any_ parameter (even -p1) between the EXE name and the source file path. Something must be wrong.

                          I neglected to mention that I'm using WinXP--what platform are you on? I ask because the Windows executible is just called "Adobe DNG Converter.exe"--no version.

                          I saw your earlier message on processing a folder full of NEF files and that you've considered using a for loop to accomplish this. I can get the converter to launch by pointing at a folder and not individual files, and the converter parses the entire contents of the folder and subfolders (provided you've checked the box). I still have to hit the "convert" button, though.

                          Thanks again for your help.
                          • 10. Re: Latest DNG converter not working in command-line mode
                            Community Member
                            I think I know what's wrong: If I open a command prompt (not using a script this time), navigate to the directory that the converter is in, and type:

                            C:\UTIL> "Adobe DNG Converter.exe" -c

                            ...it won't launch. Same with any parameter. If I omit the parameters and pass a source path, it's fine. This happens with -p1 or -d, as well--all of the supported parameters.

                            I'm using converter version 5.2 on WinXP SP3.

                            I can probably find a way around this, but I figured I'd report it in case there's a bug lurking underneath this.
                            • 11. Re: Latest DNG converter not working in command-line mode
                              Community Member
                              > "I verified that I am in fact passing the fully qualified path. But, oddly, the app fails silently if I pass _any_ parameter (even -p1) between the EXE name and the source file path. Something must be wrong.

                              > I neglected to mention that I'm using WinXP--what platform are you on? I ask because the Windows executible is just called "Adobe DNG Converter.exe"--no version.

                              > I saw your earlier message on processing a folder full of NEF files and that you've considered using a for loop to accomplish this. I can get the converter to launch by pointing at a folder and not individual files, and the converter parses the entire contents of the folder and subfolders (provided you've checked the box). I still have to hit the "convert" button, though.


                              I'm using XP SP2. I tried a miminalist converter command just now (again, this would normally be on a single line):

                              C:\PhotoshopCS2\DNG_converter\version_3.3\Adobe_DNG_Converter_3.3.exe -p1 filename.cr2

                              (I renamed it to get rid of the spaces in the name -- gets around the need to double-quote the command.)

                              This did write an output file. Hmm...I don't know why it wouldn't be working when you have "-p1" between the executable's name and the input file's name.

                              I've been able to process a directory's-worth of RAW files via the GUI, but not with the command line -- unless I use a loop to do it. The program doesn't seem to support wildcards.
                              • 12. Re: Latest DNG converter not working in command-line mode
                                Community Member
                                > think I know what's wrong: If I open a command prompt (not using a script this time), navigate to the directory that the converter is in, and type:

                                C:\UTIL> "Adobe DNG Converter.exe" -c

                                ...it won't launch. Same with any parameter. If I omit the parameters and pass a source path, it's fine. This happens with -p1 or -d, as well--all of the supported parameters.


                                Right. Using "-c" alone causes the program simply to terminate. I tried it with some non-supported switches, such as "-a" and "-b" -- with nothing else on the command line -- and that launched the app in its GUI mode.

                                I write a ton of command-line tools for use in-house at work, and I do have opinions about these things. :-) The use of a non-supported switch should cause the app to print usage information (it has none that I know of, though). At the least, for it to open its main window in some of these cases is a clear enough signal that you didn't give it a correctly formed command line. Its doing nothing when "-c" alone appears on the command line...methinks that qualifies as a bug. The same thing seems to happen if you use any of its supported command-line switches as the sole arguments: the program simply closes with nary a whimper. Other (equally nonsensical) command-line arguments cause it to open its main window.
                                • 13. Re: Latest DNG converter not working in command-line mode
                                  Community Member
                                  It struck me silly that I've been running tests with v.3.3 when 5.2 is the latest, so I downloaded it. The setup "wizard"...hmm, why is it a "wizard"? It provides no choice of installation path. I didn't realize this because immediately after I'd launched it, I knocked something onto the floor, reached down to pick it up ... and looked back up just in time to see the "wizard" complete the installation...but where, I didn't know. It didn't display any information about where it had installed the app. Adventures In Discoverability. :) I hunted around on the hard drive until I found it (C:\Program Files\Adobe -- well, at least you can launch it if you think to look for it in the 'Start' menu). So ... that needs a bit of work. Anyway, I copied the app into a directory of my choice -- one that's in my system's %PATH%, replacing spaces in the name with underscores. It works fine in that directory -- no problem with the name-change as far as I can tell. Now back to the fun stuff...

                                  This version doesn't seem to require a fully qualified path to the input file or to the output directory when "-d" is used. That's an improvement. IOW, this worked:

                                  converter -p1 -d DNG filename

                                  where "converter" is the program's name, "DNG" is the name of a subdirectory of the directory where I'm running the test, and "filename" is the name of a RAW file in that directory.

                                  The program still doesn't know how to create a directory (or ask about creating one if it doesn't exist). Fails silently if "-d" is used and the specified directory doesn't exist. But at least this version returns an exit code of 1 due to the failure -- better than returning 0.

                                  Still doesn't understand wildcards. Hope done sprang eternal there for a moment, but oh well. Back to "for" loops...

                                  Still fails silently, returning exit code 0 (oops), if a nonsensical command-line is used (e.g., using "-c" as the only argument).

                                  Hey, how about a truly silly command-line error -- a command line including both "-c" and "-u". What happens? It "consumes" the first of the two mutually exclusive switches, ignoring the second -- you get a compressed DNG file. Swap the order of the switches, and you get an uncompressed file. (I'd vote for a syntax-error message in that case, m'self.)

                                  Interestingly strange little program...If I run it from the command line, it drops back to the command line immediately after I press ENTER. That makes it appear to have failed. But it hasn't -- it's running in the background, and a few seconds later the DNG file is created. But, if I run it from within a batch file, it does NOT return control to me until it has completed writing the output file. Wonder what's up with that.

                                  Fun stuff. :)
                                  • 14. Re: Latest DNG converter not working in command-line mode
                                    JimHess-8IPblY Community Member
                                    OK, I've finally decided that I have to ask this questio. I'm sure the answer is obvious to many of you. But what is the big deal about running the DNG converter in command line mode?
                                    • 15. Re: Latest DNG converter not working in command-line mode
                                      Community Member
                                      Mike_Arst@adobeforums.com wrote:

                                      > Fun stuff. :)

                                      Back in my application development days, it was glaring obvious when a command
                                      line geek wrote a GUI app and when a GUI geek wrote a command line app. This was
                                      especially true in Unix-land where there are defacto standards for stuff like
                                      error messages and exit codes.

                                      -X
                                      • 16. Re: Latest DNG converter not working in command-line mode
                                        Community Member
                                        Jim_Hess@adobeforums.com wrote:
                                        > But what is the big deal about running the DNG converter in command line mode?

                                        The question is not quite precise, so I'll give you two answers.

                                        1) It's a big deal (big problem) because it doesn't follow the conventions used
                                        by the vast majority of command line programs.

                                        2) ACR is not scriptable in any meaningful sense (unless you open docs in PS and
                                        toss your performance out the window), where as DNG converter kinda-sorta is, at
                                        least for the task of converting raw files to DNG files, which is a big deal for
                                        those of us who like to construct highly automated work flows.

                                        -X
                                        • 17. Re: Latest DNG converter not working in command-line mode
                                          Community Member
                                          > The question is not quite precise, so I'll give you two answers.

                                          What you said. :) I place a high value on reliable automated processes; it's what I do at work all day long. With converter 5.2 not supporting wildcards, I'm beginning to wonder if I should resurrect my little project to create a command-line wrapper for the thing, "faking" batch processing. Figuring out a way to ensure that the app is visible to/discoverable by the "wrapper" script on every possible machine would be a challenge -- likewise, devising a CLI that'd work for just about everyone wanting to use such a tool.
                                          • 18. Re: Latest DNG converter not working in command-line mode
                                            Community Member
                                            > it's what I do at work all day long.

                                            It pays for my toys :)


                                            > With converter 5.2 not supporting wildcards, I'm beginning to wonder if I should resurrect my little project to create a command-line wrapper for the thing, "faking" batch processing.

                                            Most of my work is JavaScript in Photoshop, so I write JS to get around the
                                            shortcomings of various CLI apps, include the DNG Converter.


                                            > Figuring out a way to ensure that the app is visible to/discoverable by the "wrapper" script on every possible machine would be a challenge

                                            You would have to make it a configuration setting. Prior to this last release,
                                            there was no standard installation folder for the converter. And a lot of people
                                            move it to their desktop anyway as a drop target.


                                            > likewise, devising a CLI that'd work for just about everyone wanting to use such a tool.

                                            I've thought about implementing one, but I'd end up scripting in Bash. My
                                            primary platform is a Mac Pro and I have cygwin installed on WinXP and Vista.

                                            -X
                                            • 19. Re: Latest DNG converter not working in command-line mode
                                              Community Member
                                              >> Figuring out a way to ensure that the app is visible to/discoverable by the "wrapper" script on every possible machine would be a challenge

                                              > You would have to make it a configuration setting. Prior to this last release, there was no standard installation folder for the converter. And a lot of people move it to their desktop anyway as a drop target.


                                              Yep. So it'd be: 1) insist upon having it in the %path%. Nice, but not an entirely realistic expectation. A lot of people don't know what the %path% is, let alone how to edit it. Sad. :) 2) Insist upon having its location be stored in some environment variable. Not friendly; failure-prone; kludge-y. 3) Insist upon having its location stored in some config file. Ok...so where's the config file? %systemroot%? %systemroot%\system32? Etc. etc.

                                              > I've thought about implementing one, but I'd end up scripting in Bash. My primary platform is a Mac Pro and I have cygwin installed on WinXP and Vista.

                                              The one I use here is a 4NT script (the command processor being shipped nowadays as "TakeCommand"). Better I should re-do it in Perl. 4NT scripting is great, but the Perl solution, though it wouldn't have all the pretty colors, would be way more robust.

                                              Hmm. Tiny light went on. I wonder if recent versions of ExifTool can write DNG. I think that app can read DNG. Whether it can write it (with or without the bells and whistles of Adobe's converter), I don't know. Worth checking out. Then all you have to do is learn yet more about the ExifTool command line. EEEEK! :) (Insanely great tool with a long learning curve, that one.)

                                              ... a moment later ... well, so it can. I'll have to mess with it a bit...
                                              • 20. Re: Latest DNG converter not working in command-line mode
                                                GKaiseril ACP/MVPs
                                                EXIFTool only modifies the files Metadata but not the image of the file types that it can read and write, of which DNG is one that can be read and written.
                                                • 21. Re: Latest DNG converter not working in command-line mode
                                                  dezso: Community Member

                                                  I see this is a very old post but I need some help now

                                                   

                                                  C:\DNG\ad.exe -c -p0 -cr7.1 -d D:\DngOUT D:\\Blackmagic Cinema Camera_1_2013-11-29_0709_C0001\Blackmagic Cinema Camera_1_2013-11-29_0709_C0001_000000.dng

                                                   

                                                  It will exit silent, no error, no conversition take place, if I remove the space from the folder and the filename it works fine, anyone have a workaround of this  ??

                                                   

                                                  C:\DNG\ad.exe -c -p0 -cr7.1 -d D:\DngOUT D:\Blackmagic_Cinema_Camera_1_2013-11-29_0709_C0001\Blackmagic_Cinema_Camera_1_2013-11-29 _0709_C0001_000000.dng"

                                                  • 22. Re: Latest DNG converter not working in command-line mode
                                                    dezso: Community Member

                                                    Solved my problem !!

                                                     

                                                    C:\DNG\ad.exe -c -p0 -cr7.1 -d D:\DngOUT "D:\\Blackmagic Cinema Camera_1_2013-11-29_0709_C0001\Blackmagic Cinema Camera_1_2013-11-29_0709_C0001_000000.dng"

                                                    Qoutation mark in the begeining and the end of the fine being connverted solved it for me...