How to find shutter count of Nikon D200 in Debian Wheezy?

2016/03/18
I will make a script that read shutter count data from Nikon and Sony cameras. I think exiftool can do it.

Sony A6000

#!/bin/sh
# exiftool
# Read shutter count of Sony A6000 mirroless camera

Tag_name='ImageCount2'

for image_file in "$@";
do
    result=$(exiftool -s $image_file | grep $Tag_name)
    count=$(echo $result | cut -d ' ' -f 3-)
    echo $image_file $count
done

Read shutter count from an image file.

./sc-sonya6000.sh sonya6000_2016031716.JPG
sonya6000_2016031716.JPG : 1471

Read shutter counts from multiple image files.

./sc-sonya6000.sh *.JPG
sonya6000_2016031701.JPG : 1456
sonya6000_2016031704.JPG : 1459
sonya6000_2016031708.JPG : 1463
sonya6000_2016031712.JPG : 1467
sonya6000_2016031714.JPG : 1469
sonya6000_2016031716.JPG : 1471

2015/12/27

exifprobe reads metadata of camera image file. It has only 515 kB compared to ExifTool’s 21 MB.

Installation

$ sudo aptitude install exifprobe
The following NEW packages will be installed:
exifprobe
0 packages upgraded, 1 newly installed, 0 to remove and 17 not upgraded.
Need to get 167 kB of archives. After unpacking 515 kB will be used.

Extract shutter count is done by

$ exifprobe -L 12122015_0309.jpg | grep ShutterCount

JPEG.APP1.Ifd0.Exif.MakerNote.ShutterCount = 95475

I’ve taken about 70,000 photos using the camera since 2013.
Should I get another DSLR camera for backup just in case the camera failure?

I bought a used Nikon D200 few weeks ago from a well-known Nikon dealer. It was somewhat big investment to me because I’ve been using Canon EOS 1000D since 2008. Few reasons made me buy D200: continuous shooting in RAW mode, supports Auto Focus of Nikkor 300mm f4, weather sealed body. Nikon Nikkor 300mm f4 and D200 will be my main equipment for wildlife photography.

gphoto2 communicates with this camera using PPT protocol. I changed the USB interface mode from USB to PPT after access failures. My shutter counter script using gphoto2 2.4.14 fails to access the number. I guess Nikon D200 do not store shutter counter information in camera.

ufraw handles Nikon’s RAW file format, which has NEF file extension.

#!/bin/bash

gphoto2 –get-config=/main/status/shuttercounter

jhead also fails to retrieve the shutter count in the JPEG file.

Nikon Shutter Count website shows the shutter count of uploaded JPEG file. The lMy shutter counter script using gphoto2 2.4.14 fails to access the number. I guess Nikon D200 do not store shutter counter information in camera.ink is here. This site gave 25,971 for shutter count on DSC_0008.JPG file.

exiftool does retrieve more EXIF information in JPEG file including shutter count. I installed it following the instruction here after downloading the tarball.

$ exiftool DSC_0008.JPG | grep "Shutter Count"
Shutter Count : 25971

Output of exiftool DSC_0008.JPG

ExifTool Version Number : 9.24
File Name : DSC_0008.JPG
Directory : .
File Size : 558 kB
File Modification Date/Time : 2013:03:28 18:04:38+09:00
File Access Date/Time : 2013:03:28 18:11:41+09:00
File Inode Change Date/Time : 2013:03:28 18:10:13+09:00
File Permissions : rw-r--r--
File Type : JPEG
MIME Type : image/jpeg
Exif Byte Order : Big-endian (Motorola, MM)
Make : NIKON CORPORATION
Camera Model Name : NIKON D200
Orientation : Horizontal (normal)
X Resolution : 300
Y Resolution : 300
Resolution Unit : inches
Software : Ver.1.00
Modify Date : 2013:03:28 18:04:36
Y Cb Cr Positioning : Co-sited
Exposure Time : 1/4
F Number : 22.0
Exposure Program : Aperture-priority AE
ISO : 400
Exif Version : 0221
Date/Time Original : 2013:03:28 18:04:36
Create Date : 2013:03:28 18:04:36
Components Configuration : Y, Cb, Cr, -
Compressed Bits Per Pixel : 2
Exposure Compensation : 0
Max Aperture Value : 4.0
Metering Mode : Multi-segment
Flash : No Flash
Focal Length : 300.0 mm
Maker Note Version : 2.10
Color Mode : Color
Quality : Normal
White Balance : Auto
Focus Mode : AF-S
Flash Setting : Normal
Flash Type :
White Balance Fine Tune : 0
WB RB Levels : 1.97265625 1.234375 1 1
Program Shift : 0
Exposure Difference : 0
Compression : JPEG (old-style)
Preview Image Start : 3348
Preview Image Length : 25166
Flash Exposure Compensation : 0
ISO Setting : 400
Image Boundary : 0 0 1936 1296
External Flash Exposure Comp : 0
Flash Exposure Bracket Value : 0.0
Exposure Bracket Value : 0
Crop Hi Speed : Off (3904x2616 cropped to 3904x2616 at pixel 0,0)
Exposure Tuning : 0
Serial Number :
Tone Comp : Normal
Lens Type : AF
Lens : 300mm f/4
Flash Mode : Did Not Fire
AF Area Mode : Single Area
AF Point : Center
AF Points In Focus : Center
Shooting Mode : Single-Frame
Color Hue : Mode3
Light Source : Natural
Shot Info Version : 0207
Vibration Reduction : Off
Hue Adjustment : 0
Noise Reduction : Off
WB RGGB Levels : 505 256 256 316
Lens Data Version : 0201
Exit Pupil Position : 120.5 mm
AF Aperture : 4.0
Focus Position : 0x32
Focus Distance : 0.03 m
Lens ID Number : 16
Lens F Stops : 6.00
Min Focal Length : 302.0 mm
Max Focal Length : 302.0 mm
Max Aperture At Min Focal : 4.0
Max Aperture At Max Focal : 4.0
MCU Version : 8
Effective Max Aperture : 4.0
Sensor Pixel Size : 6.05 x 6.05 um
Image Data Size : 530248
Image Count : 25467
Deleted Image Count : 504
Shutter Count : 25971
Flash Info Version : 0101
Flash Source : None
External Flash Firmware : n/a
External Flash Flags : (none)
Flash Commander Mode : Off
Flash Control Mode : Off
Flash Compensation : 0
Flash GN Distance : 0
Flash Group A Control Mode : Off
Flash Group B Control Mode : Off
Flash Group A Compensation : 0
Flash Group B Compensation : 0
Image Optimization : Vivid
Multi Exposure Version : 0100
Multi Exposure Mode : Off
Multi Exposure Shots : 0
Multi Exposure Auto Gain : Off
High ISO Noise Reduction : High
User Comment :
Sub Sec Time : 32
Sub Sec Time Original : 32
Sub Sec Time Digitized : 32
Flashpix Version : 0100
Color Space : sRGB
Exif Image Width : 1936
Exif Image Height : 1296
Interoperability Index : R98 - DCF basic file (sRGB)
Interoperability Version : 0100
Sensing Method : One-chip color area
File Source : Digital Camera
Scene Type : Directly photographed
CFA Pattern : [Green,Red][Blue,Green]
Custom Rendered : Normal
Exposure Mode : Auto
Digital Zoom Ratio : 1
Focal Length In 35mm Format : 450 mm
Scene Capture Type : Standard
Gain Control : Low gain up
Contrast : Normal
Saturation : High
Sharpness : Hard
Subject Distance Range : Unknown
GPS Version ID : 2.2.0.0
Thumbnail Offset : 28672
Thumbnail Length : 11715
Image Width : 1936
Image Height : 1296
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:2 (2 1)
Aperture : 22.0
Blue Balance : 1.234375
Image Size : 1936x1296
Lens ID : AF Nikkor 300mm f/4 IF-ED
Lens : 300mm f/4 AF
Preview Image : (Binary data 25166 bytes, use -b option to extract)
Red Balance : 1.972656
Scale Factor To 35 mm Equivalent: 1.5
Shutter Speed : 1/4
Create Date : 2013:03:28 18:04:36.32
Date/Time Original : 2013:03:28 18:04:36.32
Modify Date : 2013:03:28 18:04:36.32
Thumbnail Image : (Binary data 11715 bytes, use -b option to extract)
Circle Of Confusion : 0.020 mm
Depth Of Field : -0.00 m (0.03 - 0.03)
Field Of View : 4.6 deg (0.00 m)
Focal Length : 300.0 mm (35 mm equivalent: 450.0 mm)
Hyperfocal Distance : 204.23 m
Light Value : 8.9

About janpenguin

Email: janpenguin [at] riseup [dot] net Every content on the blog is made by Free and Open Source Software in GNU/Linux.
This entry was posted in GNU/Linux, Photography and tagged , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s