DIYPhotobits.Com Camera Control 4.0 – Basic Bracketing

It is here, it is basic, but it works (somewhat) — Bracketing.  Once again I find myself either spending an hour I have available to work on the code, or publishing what I already have working, limited though it may be.

So here we have 4.0 – the Basic Bracketing version.


Expect bugs — that’s why the version is a .0 one!  However it should do you for some basic HDR or timelapse uses.


  • Only works in P, A or S modes as the bracketing is controlled by adjusting the exposure compensation. I’ll do M mode support later.
  • The package has the wrong version number (3.1) on the Start menu icon,but once you open the script itis the correct 4.0
  • Tested on D300 and D40 ok

92 Replies to “DIYPhotobits.Com Camera Control 4.0 – Basic Bracketing”

  1. I gave it a try, don’t know if its because i use a D70, or a wrong procedure, but it gives me a lot of shots with the same exposure settings… I set the nr of brakets and the fstop distance, with my camera set to continous shooting and then shutter release, is this right?

  2. when you so consecutive shots…does it buffer well? does the camera store the images in the card? thanks…

  3. It is a bit slow because it does not use the camera buffer, the camera treats each one as a separate shot and saves it to the camera card.

    But the script does not download any of them until the whole sequence is complete. In fact downloading is optional, you can bracket without downloading.

    The end result is a bit faster than one frame a second in my test but it will vary greatly depending on your situation I think.

  4. Raymond,
    I appreciate your program and it worked immediately (D300). Now, I changed to v4.0 and the bracketing solution is a good work-around. However, I wonder whether we can not put the 0.3 resolution of the ExpComp in consideration.

    I gave them a try by just using the ‘* 3’ multiplication within the CInt() at lines 219 and 221 (…* CInt(tbBracketStops.value * 3))))). It seems to work, ‘stops’ values of 0.3 and 0.7 are accepted and used. Are there any other restrictions, I don’t see?

  5. Ray…..THANKS!

    Can Firewire support be added please?

    I’d love to link my Fuji S3pro (it’s USB connection is very frabile, I •have• to use FireWire)

  6. JensB – doesn’t it work if you just enter 0.3 or 0.7 in the field? I thought it would as I wrote that line but forgot to test it. Will do so next and fix it if that does not work.

    Joseph, sorry I can’t see how to do Firewire. 🙁

  7. Raymond, I tried it firstly but I recognized that the values below ‘1’ were set to ‘0’. The reason seems to be the CInt() function that truncates the float values to integers by skipping the digits after the point.

    Another question: Do you see any possibility to activate AF by a button (like an on-screen ‘AF-ON’)?

  8. Can I run this from a terminal/dos box? This is a excellent tool, but I really don’t need the gui since I’m going to use it just for HDR (I’m going to OVERLY use it :-).

    Also, I’ve noticed that it mistakenly shoots .jpg when .nef is selected, maybe that is a bug in the html though. I also noticed that sometimes the first shot is done twice, only appears to be the first exposure that is took in the application (maybe a index problem in a array)?

    btw, how come I’m the only one who can’t find the source :-/

    Anyhow, thanks for this, _MUCH_ appreciated.

  9. thank you so much. i have the nikon d40 and it works perfectly. its NOT the d4ox. (i thought it only works with d40x)

    do you have a manuel to your program? i want to understand every setting on your program.

    thanks again~!!!!

  10. Peter, it’s a script so the executable *is* the source. Open the .hta file in a text editor! 🙂

    The current version can’t be run from a command prompt, but an old one could — but that did not have the new features like bracketing. I guess you could try to port those features back to the old script but I don’t know how practical it would be.

    Andy, glad it works but sorry no manual so far!

  11. I’m sorry, I noticed that about the .hta along the way :-).

    First and foremost, can .hta write to your local filesystem?

    Can you give me a link to where the common found calls you have to use with this .dll controlling the camera device? I ask this because I would think there is all kinds of references for usb imaging devices using this module.

    This page clears up most of what I want to know about .hta, besides telling me if .hta can write to the local fs (C:\or_wherever\).

    I most definitely want to add que support for Photomatrix and .dng compression for RAW. I’m not sure if you are using math in combination with the bracketing mode in the camera, or just math to set all exposure settings every time to simulate a human adjustment for every shot.

    Anyways, if you would allow I would like to help out with the bracketing, Ui (I’ve already redone the .css for my use, but haven’t figured out imgReplacement in VB yet), and external support for other apps (depending on if .hta has write access). You’ve already done all the actual scripting/math it looks like :-), so I’d like to help with the easier stuff :-).

    If you don’t want help, and cease to work on this app, I just hope Nikon doesn’t mess anything up in a future firmware upgrade, because this app is perfect for many people as is to date.

  12. Oh sorry, I’m using a D90 in A mode, haven’t tried any other mode.

    Also I would like to mention to people reading in case they overlooked or didn’t realize…

    The true beauty of this app for my HDR shooting is that my camera, a Nikon D90, can only bracket 3 shots automatically. I usually do 6 shots and wind up with duplicates (I only need 4 but it’s just easier to move the EV and do another bracket). So every time I go to change the EV to get another bracket that is going to waste space (being dupes), I take a risk of shaking/moving the camera.

    For people looking to do higher HDR frame counts within studios or with a camera with a limit of 3 frames per bracket, this is perfect solution.

  13. Well, is there a debugger to .hta? I need to step through this app :-/ being I’m rusty and there is nothing like a main() function.

    All I have now is…

    argLine = split(objHTAApp.commandLine, chr(34))
    cmdArgs = split(trim(argLine(2)))

    … and the rest of the code to parse. Also I have a work up for using a .ini file instead the moniker way you are using. Not because I think your way is insufficient, but because I don’t understand how monikers work :-).

    Anyhow, I’ve been reading over the samples here and I noticed it list “Enumerate all the Supported Events for the Selected Device”. I can’t get this to work yet for some reason in a test.hta, I know the device is connected, just mgsbox never comes with a list (not sure, this I’ll try Sunday). I was wondering if this is the call that lists the things such as EV, (A,S, or P), shutter speed, etc… and if so does it list bracketing for your camera? I assume it doesn’t or else you would of tried it :-).

    Also I’ve been trying to get Camera Control to write out a .txt file after every bracket just to more easily distinguish on the memory card what files are sets. It wasn’t a problem at first, until it occurred to me that I had that hard coded. Can you get the partition letter?

    I gave up on the idea of creating a que to something like Photomatrix because it doesn’t support queues nor do any other apps I’ve looked into! Sunday I look forward to sitting down and focusing on 1 thing at a time.

    I can say this, coming from non-windows specific languages, it’s baby steps! 🙂

  14. Well I have downloaded the SDK and according to “D90UsbMtpE_01.doc” within the SDK, “EnableBracketing” is a possibility under MTP. However, my D90 is listed as PTP only, so I’m not sure if this will work for me. I cannot find a SDK for my D70s. (BTW I cannot give out the SDK to anyone trolling, it’s free so go get it!)

    I think I’ll buy a D40x next week when I can and play with it. I have captured the raw data sent over USB and have found what I believe to be a hash to start with, but again, I only have a D90 :-(. Also I’ve done a 3 minute search on sending data across the usb with .vbs and I have no definative answer on the subject (outside of writing a module, which is out of scope for this).

    Sorry for the repetitive posts, just trying to help.

  15. Peter, you are leap frogging over me here. 🙂 I suspect you have found answers to most of your questions already. I only got the SDK myself last week.

    Sadly I have very little time for this project and my coding skills are very weak. It’s 20 years since I used a compiled language, it has all been scripting since then and for some reason that’s very different.

    The hta vbscripting is annoyingly limited; this weekend I tried to see if I could extract the jpg from the nef for preview purposes, but found that vbs can’t do any binary file operations; at least not without unreliable workarounds. I haven’t found a way to step scripts either — MS Script Debugger is supposed to do it but I’ve never made it work. So it’s a lot of “msgbox” statements as I go along…

    Anyway I still can’t understand the Nikon SDK about the NEF format, it is written so badly! Where are the examples?? And never having written C language I find myself unable to make much use of the sample code.

    Getting myself up to speed again with a compiled language so I could use the SDK properly is outside the scope of my one-hour-a-week or so allocation of time to this project.

    I’ll have to stick to simple stuff that glues existing components together. I do have some ideas in that regard, but they’ll have to wait until another weekend.

  16. You’re with me. I went to college for systems programming (C, VB, Java) but it’s been a very long time since I have used a system language. Like I mentioned, I’m only familiar with web languages (PHP, PERL, some Python), luckily I guess they those float around C. Doesn’t matter though, what I want to do I have never covered in any manner, so it’s still hello world for me.

    You are right about the .hta limitations, I’m so confused on .vbs. Limited isn’t the word for it, it is down right confusing. To strip out the .jpg it appears to me you would have to use text based functions looking for headers and eof’s (I assume this is what you found too), so yes it’s not reliable.

    I haven’t read the spec at all for NEF, I don’t plan on it either :-). If need be I will peak at a open source project like “hugin” or what not to see how it deals with it.

    Anyways, I have to figure out this how sniffing works (for USB), I’ve never done it and it seems so far a very useful approach.

    BTW, you don’t have to use a compiled language to use the .dll’s. At this point I’m wondering if .hta can’t access them correctly itself, but it boils down to what you said, there isn’t really any examples. Really there isn’t anything at all but a string and hex equivalent for all functions/objects. On top of that, if one would use the SDK .dll’s, what is the liabilities and fair usage? I didn’t read the 50 pages of all _SEVEN_ EULA’s!

    P.S. The D90 does support EnableBracketing, I overlooked it. Actually all camera models appear to. It has seemed they have dropped the “MTP” from “MTP/PTP” and just use “PTP” as the sole terminology.

  17. Hi!
    I have a D60 and it’s partially (not) working. Maybe it’s because I’m running XP SP2 on Parallels Virtualizer inside a Mac.

    -Braketing works
    -Images are not downloaded (but kept on camera)
    -Time Lapse doesn’t take pictures
    -Pop up advising the device may not support shutter release from computer, but it does work, althogh button remains pressed
    -It keeps taking pictures, about every 20 seconds, till I get a pop error: Line: 157, Char: 2, Index out of range and the script stops.

  18. Great work.
    Great to have bracketing that can be set 2 stops or higher apart for exposure fusion & HDR. Waiting patiently for manual control.
    Some bugs:
    1. Every time I switch on the camera it copies the whole card to my desktop to a random folder which I had deleted earlier. It makes a new folder with the same name and copies to it. No idea how it chose that folder name.
    2. Bracketing in A mode was working but seems to have stopped. Now I get the right number of pix but all exposed normally.

    Hope this helps. D300 , MSI netbook/XP-sp2

  19. I have a D40 and, first of all, this is an awesome upgrade to the camera’s capabilities.

    I have been working on doing a time lapse, but of a flower blooming. Obviously, talk about slooooow.

    2 things I’ve noticed and wonder if you have experienced.

    1) it seems like the time lapse “timing” might be off. I have it set for 300 secs, which should be 5 minutes, but in reality it is firing at about 8 minutes.

    2) is there any way to turn the camera “off” or to “sleep mode” between shots? On a full battery, I can get about 2 hrs of time lapse photos. If the LCD could be turned off, it would extend that timing into many, many hours I would assume.

    Just wondering if there is something I am doing wrong or could be doing better. Again though… what a fantastic upgrade. great work!!!

  20. Hi Raymond,
    I use the v4 already for some time and really appreciate it. I have one of this fency tiny netbooks for getting mobility with that tool. The screen is quite small, therefore I modified and re-arranged the GUI in the HTML part. Now it fits smoothly in and looks pretty well. Since, I received a lot of fun with your tool, I would like to give someting back. If you are interested I can provide this GUI part to you, you can use and share it w/o any restrictions from my side. Give me an Email I will send it.

  21. I uninstalled/ renistalled and its working again, but still copies all my files to that same folder on the desktop.Weird.

    It would be nice to be able to download Raw & jpeg together and use the jpeg for previewing.

    And live view would be the icing on the cake.


  22. amazing it works very well on my nikon D40
    Excellent lets get to high dynamic range photos


  23. Will this work on Vista?
    I downloaded the 4.0 and ran the program. The program comes on and shows an error-An error has occured IN THE SCRIPT ON THIS PAGE. Line-165
    error-access denied
    Do ou want to continue running scripts in this page?

    can u help?

  24. I got it to work with the 3.1 version.
    ANother question is, how to get the preview pic to show fullscreen? Can this prgram link with picasa to show full page automatically?
    Thank you guys in advfance

  25. I really want to use this script so bad I can taste it, but I shoot exclusively in RAW and no matter what I do it will not work in RAW.

    I had the same problem with every version.

    I am on Vista, can anyone tell me what I need to do to get this to work in a RAW work-flow? The script works great in .jpg but I can not shoot most of my work in jpg I need RAW.

    I am using a Nikon D80 someone has to know what I can do, Please help.

  26. James,

    You have to use a program to view the file like Lightroom v. 2

    Because it can view NEF files, you can set LR to watch an “Autoimport” folder and as soon as a photo is loaded there, it will come up inside LR.

    Works perfectly with RAW/NEF files. I suppose any other program that could view your raw files would work…but it would need that “Autoimport” feature or you would have to keep refreshing the folder.

    Hope that helps.

  27. Gearscout,

    Thank you, I use Lightroom as well as Photoshop. I have Lightroom set to auto import and it does. The problem is that the Photobits Camera Control does not import an NEF from my Nikon D80.

    When I shoot a .jpg Camera Control inports the file – then it is auto imported into Lightroom.

    When I shoot a NEF Camera Control just sits there and the image is not imported at all out of the camera.

    I know some others have had this problem with Vista while some Vista users say it works just fine. Very strange.

    Thanks for the help though.

  28. Just recently got a chance to try this out on your recommendation over on my blog. Pretty cool stuff!

    Had me wishing for a larger preview of the image, since that’s the real draw to tethered shooting for me, to evaluate focus and exposure etc. But I can certainly see the utility of this for HDR. I should really get into that. 😉

    Thanks for the comment and suggestion!

  29. Thanks for the great software.
    I shoot RAW on the D200 and although the preview does not support RAW, pointing
    Bridge to the relevant folder and setting it to order files by descending date allowed it to preview the latest image automatically on my system.
    Thanks again,

    James Reynard

  30. Why Camera Control 4.0 tries to connect to the internet at start-up? Phoning home at

  31. That IP is Feedburner, the Google RSS feed tool. Camera Control 4.0 is loading the recent posts from my blog to display at the bottom of the script.

  32. Background connection to the internet could be exploited and become a security threat. What about the possibility of:
    1) Have the connection removed and replaced by a URL link for the feed?
    2) Having a user’s option to switch the connection on / off (similar to the auto update in many softwares)?

    Other than that, it does the work. Just tested with my Nikon D200 (USB set to PTP, not MASS) and Adobe Lightroom 2 with Auto Import functionality set. Works pretty well.

  33. It is an HTML page, which loads a blog rss feed via google, that is hardly a security risk! Anybody that concerned can read the script code to see it isn’t doing anything bad, or if not nobody is forcing them to use this. I don’t exactly have a lot of time to work on this and would rather spend any time I have on real useful features rather than things like that.

  34. Raymond,

    I am sorry I was misunderstood. I never considered that the legit connection started by the application could be a security risk, but the exploitation of an open connection for someone else is a reality. The connection the internet can be hijacked and redirected to another place, a typical infection strategy. Just keeping a not need connection closed minimizes this kind of risk.

    Another typical security exploit (pretty common) is someone downloading the application, repacking it with a modified code and a redirect to another site. It works pretty well since people does not consider a risk since it is known that the application connects to the internet.

    Personally, I have no reason to not trust on a Google site or on your application, but on my computer the connection to them from the application is already blocked by my firewall – just to risk to take a change. Sorry, but internet is not safe place, and drive-by infection is a reality.

    So far, I like the application, and I am glad that people like you have spent time and resources to make it available to everybody for free. I started using it to shoot tethered with my Nikon D200 (along with Lightroom2), and I am happy with the results.

    Marco R

  35. Will you add exposure times > 30secs?

    in CameraControl.hta the longest exposure value is:

    dicShutterTable.add 300000,”30s”

    Adding increased values up to 10 minutes would be a great help for shooting night-time HDRs.

    Just a thouhgt when manual-mode will be supported.

    Keep to good work up.

  36. Hi Raymond,

    I dont know if you remember but a while ago i asked you if you planned to make some bracketing options for CC. Well i then tried on my own and went and learn VBscript and so on and managed to modify your script…
    Now i see that you release version 4 already ! I didnt try it but i thought i might share with you the version i did and maybe you’ll want to grab some code (it’s very beginner i think but it works so far, except for very long exposure >15s ).
    Here is the file:

    (i’ll delete it after you download it, the password is ‘raymond’ )
    I’m more of a graphist so you’ll see i made some interface changes too.
    Anyway thanks so much for CC, it’s really pretty cool !

  37. Great program with a lot of promise. Am trying to use it on a D90 but it will only take 1 exposure when using Time Lapse. It uses the delay correctly but only fires once. I am in “A” mode.

  38. Hello, great program ! I have a D90 and had a similar problems as for David T, but it seems to work fine now if I put the focus to manual. Cheers, Charles

  39. I get an install error using XP, SP2. Device not available. This happens right at the start of running the msi.

  40. Love the features on this. I have been looking for a teathering solution. When using a D200, whenever I select auto-download, I get a script error; “Index out of range. Line 157. Char 2”

  41. GREAT! Works in Time Lapse very good now. I am trying to get the bracketing to work but have still not gotten that down pat yet.

  42. hello could you add fuji s5 pro device and vendor id to your app so it will work with it

    productid 0x01c3
    venderid 0x04cb (fujifilm Corporation

  43. Successful Bracketting on my D60 ! But I have to close and open the program again to start a new AEB shot. Thank you.

  44. I’m gave it a try but got stuck like BobS (comment 46). When i press the “Release shutter” button the camera shoots but then I get that same error message: “An error has occurred in the script on this page.
    Line: 157
    Char: 2
    Code: 0”

    Thanks for doing this,


  45. Raymond,
    I would appreciate your help. My D40 shoots with the same exposure setting, in P, S and A mode. How should I set up your program?
    I’m using Windows Vista.

  46. Ups!,
    Related to my previous post, I was talking about bracketing. Even though I set the program to bracket, my Nikon D40 still shoots with the same exposure in P, S, and A mode. I’m runnig Windows Vista.
    Someone to help me?. Thxs


Leave a Reply

Your email address will not be published. Required fields are marked *