Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get camera serial number from EXIF?

Tags:

php

exif

How to get camera serial number from EXIF ?


Edit: some folk think that not all (or even many) cameras store serial number, but I tried four from different manufacturers and they do. So, let's just rephrase it as "How to get camera serial number from EXIF if there is any?"

like image 991
Mawg says reinstate Monica Avatar asked May 02 '11 13:05

Mawg says reinstate Monica


Video Answer


2 Answers

As has been mentioned, not all cameras store the serial number. However, most of the DSLRs do.

The serial number is actually stored in the MakerNotes section of the EXIF. This is a proprietary section for manufacturers to write in whatever format they like.

I've extended the great work by Jacob Seidelin (< edit: the URL is a 404) to extract the serial number with javascript on my Site which includes an offline version for Chrome for no other reason than to see if I could! It's open source so if you're looking for a javascript solution you're welcome to build on it etc.

The question doesn't include a programming language or any contsraints so the best answer currently is to use exiftool. It has the most complete support for different camera models and file formats (including brilliant support for how different applications butcher it!)

A simple example command to get the serial number would be:

exiftool -SerialNumber myImage.jpg

I writing my site, I've looked into this topic over hundreds of hours so if you have any more questions, let me know!

like image 186
matt burns Avatar answered Sep 23 '22 17:09

matt burns


Almost all DSLR cameras code the serial number into the EXIF info in the maker notes section. The reason most people don't see it in the EXIF info is that Adobe products all but ignore the maker notes section of the EXIF info. So if you are viewing the EXIF info using an Adobe product you won't see the serial number. But that doesn't mean it isn't there, it just means Adobe isn't displaying it.

like image 24
Michael C Avatar answered Sep 24 '22 17:09

Michael C