Difference between revisions of "Exif"

From ElphelWiki
Jump to: navigation, search
 
(EXIF Fields)
 
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
In 353 camera in JPEG images we use standard EXIF fields (EXIF 2.2 specification from exif.org) for image description. All JPEG images have mentioned below fields (you can check this with any program what have support of Exif, in Linux with "exif" command line program, for example):
+
[[Category:Development Topics]]
 +
Images and videos from Elphel 353/363 cameras are tagged with EXIF data (we use standard EXIF fields (EXIF 2.2 specification from exif.org)).
 +
 
 +
= Reading EXIF from Images =
 +
Basically any standard software that can read EXIF data from JPEG images should work.
 +
 
 +
[http://www.exiv2.org/ exiv2] allow you to add, delete and modify metadata.
 +
 
 +
Though the [http://en.wikipedia.org/wiki/Makernote#MakerNote_data makernote] is an EXIF field that is different (structure as well as content) for every camera manufacturer.
 +
 
 +
= Reading EXIF from Videos =
 +
Each frame of Elphel generated MJPEG / (OGM or MOV) videos also contain EXIF data.
 +
 
 +
See examples of how to read them below.
 +
 
 +
== GSTreamer metadatademux ==
 +
[http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-metadatademux.html GSTreamer metadatademux] — element that parse or demux metadata from image files, we need to make it work with MJPEG video files.
 +
 
 +
To test it on single image:
 +
gst-launch -v -m filesrc location=./test.jpeg ! metadatademux ! fakesink silent=TRUE
 +
 
 +
The idea is to be able to parse a video in realtime, use metadatademux plugin to extract needed EXIF field and pipe them to another plugin such as [http://gstreamer.freedesktop.org/data/doc/gstreamer/0.10.4/gst-plugins-base-plugins/html/gst-plugins-base-plugins-plugin-subparse.html subparse] or [http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-textoverlay.html textoverlay] to include those data on the video or a custom plugin to write KML/KMZ files for google earth.
 +
 
 +
== OGG subtitles ==
 +
OGG has a provision to include [http://en.wikipedia.org/wiki/Ogg#Metadata metadata]. It can be interesting as many players have support for subtitles.
 +
 
 +
==MOV EXIF Data Extraction Example Script==
 +
 
 +
[[Media:PHP-geo-test.tar.gz | Download the Script]]
 +
 
 +
This example script was written by Konstantin Kim in PHP and based on PEL ([http://pel.sourceforge.net/ PHP Exif Library]) from Martin Geisler.
 +
 
 +
Both are released under GNU GPL V3.
 +
 
 +
The script extracts EXIF data from a MOV file and writes it to a KML file. It's easy to modify to do something else.
 +
 
 +
Though the script has a design error, it needs to load the entire MOV file into RAM. So dont use it with 32GB files ;)
 +
 
 +
==MOV EXIF Data Extraction Script (NASA)==
 +
 
 +
[[media:Extract_exif.tar.gz | Download the Script]]
 +
 
 +
This script was modified by Scott Janz based on the work by Konstantin Kim in PHP and based on PEL ([http://pel.sourceforge.net/ PHP Exif Library]) from Martin Geisler.
 +
 
 +
This includes the PEL distribution as well since one file had to be modified.
 +
 
 +
The script is modified to output the location parameters (GPS coordinates) to a text file formatted in a way that you can read it with QuickTime and overlay the information on the movie.
 +
 
 +
=EXIF Fields=
 +
All JPEG images have mentioned below fields (you can check this with any program what have support of Exif, in Linux with "exif" command line program, for example):
  
 
<br>
 
<br>
Line 33: Line 82:
 
<tr>
 
<tr>
 
<td>Software</td>
 
<td>Software</td>
<td>0x0x0131</td>
+
<td>0x0131</td>
 
<td>7.1.0.18</td>
 
<td>7.1.0.18</td>
 
<td>firmware version of camera at exposition moment</td>
 
<td>firmware version of camera at exposition moment</td>
Line 49: Line 98:
 
<td>0x013B</td>
 
<td>0x013B</td>
 
<td>00:0E:64:01:02:03</td>
 
<td>00:0E:64:01:02:03</td>
<td>serial number of camera (Ethernet MAC address)</td>
+
<td>serial number of camera (Ethernet MAC address), ASCIIZ value</td>
 
</tr>
 
</tr>
  
Line 74: Line 123:
  
 
</table>
 
</table>
 +
 +
Additional EXIF fields are Framenumber, Orientation, GPS Coordinates, GPS Orienatation, GPS Timestamp, ...
 +
 +
----
 +
 +
<i>Note:</i> in latest at this moment firmware (7.1.0.18) for 353 camera (CMOS sensor) all fields are correct, but with 363 camera (CCD sensor) we have wrong exposure time and shifted timestamp - TODO.
 +
 +
Exif data supported by [[Imgsrv]] and [[Camogm]] is described in [[Imgsrv#imgsrv_and_Exif_data]]. More changes are expected shortly - software will support more flexible Exif data including GPS-related fields.--[[User:Andrey.filippov|Andrey.filippov]] 10:40, 28 March 2008 (CDT)
 +
 +
==Makernote==
 +
The makernote is a special area of the EXIF metadata that any manufacturerer (maker) can define individually.
 +
 +
The data saved in the Elphel EXIF Makernote includes the following fields:
 +
 +
*double[] gains = new double[4];
 +
*double[] blacks = new double[4];
 +
*double[] blacks256 = new double[4];
 +
*double[] gammas = new double[4];
 +
*long[] gamma_scales = new long[4]; /** now not used, was scale _after_ gamma is applied, 0x400(default) corresponds to 1.0 */
 +
*double[][] rgammas = new double[4][];
 +
*double min_gain;
 +
*long WOI_LEFT;
 +
*long WOI_WIDTH;
 +
*long WOI_TOP;
 +
*long WOI_HEIGHT;
 +
*long BAYER_MODE;
 +
*long DCM_HOR;
 +
*long DCM_VERT;
 +
*long BIN_HOR;
 +
*long BIN_VERT;
 +
*long COLOR_MODE;
 +
*long FLIPH;
 +
*long FLIPV;
 +
*long HEIGHT1;
 +
*long HEIGHT2;
 +
*long HEIGHT3;
 +
*long BLANK1;
 +
*long BLANK2;
 +
*boolean COMPOSITE;
 +
*boolean PORTRAIT;
 +
*boolean YTABLEFORC;
 +
*long QUALITY;
 +
*long CQUALITY;
 +
*long CORING_INDEX_Y;
 +
*long CORING_INDEX_C;
 +
 +
More information is available in the Makernote reading functions at:
 +
[http://elphel.git.sourceforge.net/git/gitweb.cgi?p=elphel/ImageJ-Elphel;a=blob;f=JP46_Reader_camera.java;h=428fad1f30ddd1098de142a750c3d11c9e480312;hb=HEAD]
 +
starting at line 303
 +
 +
=Adding additional EXIF2.2 Data Fields in the camera=
 +
 +
Emails by Andrey Filippov on Support Mailinglist:
 +
 +
[http://www.mail-archive.com/support-list@support.elphel.com/msg00313.html http://www.mail-archive.com/support-list@support.elphel.com/msg00313.html]
 +
 +
[http://www.mail-archive.com/support-list@support.elphel.com/msg00278.html http://www.mail-archive.com/support-list@support.elphel.com/msg00278.html]

Latest revision as of 12:34, 12 November 2010

Images and videos from Elphel 353/363 cameras are tagged with EXIF data (we use standard EXIF fields (EXIF 2.2 specification from exif.org)).

Reading EXIF from Images

Basically any standard software that can read EXIF data from JPEG images should work.

exiv2 allow you to add, delete and modify metadata.

Though the makernote is an EXIF field that is different (structure as well as content) for every camera manufacturer.

Reading EXIF from Videos

Each frame of Elphel generated MJPEG / (OGM or MOV) videos also contain EXIF data.

See examples of how to read them below.

GSTreamer metadatademux

GSTreamer metadatademux — element that parse or demux metadata from image files, we need to make it work with MJPEG video files.

To test it on single image:

gst-launch -v -m filesrc location=./test.jpeg ! metadatademux ! fakesink silent=TRUE

The idea is to be able to parse a video in realtime, use metadatademux plugin to extract needed EXIF field and pipe them to another plugin such as subparse or textoverlay to include those data on the video or a custom plugin to write KML/KMZ files for google earth.

OGG subtitles

OGG has a provision to include metadata. It can be interesting as many players have support for subtitles.

MOV EXIF Data Extraction Example Script

Download the Script

This example script was written by Konstantin Kim in PHP and based on PEL (PHP Exif Library) from Martin Geisler.

Both are released under GNU GPL V3.

The script extracts EXIF data from a MOV file and writes it to a KML file. It's easy to modify to do something else.

Though the script has a design error, it needs to load the entire MOV file into RAM. So dont use it with 32GB files ;)

MOV EXIF Data Extraction Script (NASA)

Download the Script

This script was modified by Scott Janz based on the work by Konstantin Kim in PHP and based on PEL (PHP Exif Library) from Martin Geisler.

This includes the PEL distribution as well since one file had to be modified.

The script is modified to output the location parameters (GPS coordinates) to a text file formatted in a way that you can read it with QuickTime and overlay the information on the movie.

EXIF Fields

All JPEG images have mentioned below fields (you can check this with any program what have support of Exif, in Linux with "exif" command line program, for example):


Tag name Tag ID Sample value description
Image description 0x010E coming soon...
Manufacturer 0x010F Elphel, Inc standard
Model 0x0110 353 standard
Software 0x0131 7.1.0.18 firmware version of camera at exposition moment
Date and Time 0x0132 1970:01:01 01:50:14 standard; time from FPGA RTC at sensor start moment
Artist 0x013B 00:0E:64:01:02:03 serial number of camera (Ethernet MAC address), ASCIIZ value
Exposure Time 0x829A 1/49 sec. standard
Date and Time (original) 0x9003 1970:01:01 01:50:14 standard; time from FPGA RTC at sensor start moment
SubSecTimeOriginal 0x9291 686527 standard; time from FPGA RTC at sensor start moment

Additional EXIF fields are Framenumber, Orientation, GPS Coordinates, GPS Orienatation, GPS Timestamp, ...


Note: in latest at this moment firmware (7.1.0.18) for 353 camera (CMOS sensor) all fields are correct, but with 363 camera (CCD sensor) we have wrong exposure time and shifted timestamp - TODO.

Exif data supported by Imgsrv and Camogm is described in Imgsrv#imgsrv_and_Exif_data. More changes are expected shortly - software will support more flexible Exif data including GPS-related fields.--Andrey.filippov 10:40, 28 March 2008 (CDT)

Makernote

The makernote is a special area of the EXIF metadata that any manufacturerer (maker) can define individually.

The data saved in the Elphel EXIF Makernote includes the following fields:

  • double[] gains = new double[4];
  • double[] blacks = new double[4];
  • double[] blacks256 = new double[4];
  • double[] gammas = new double[4];
  • long[] gamma_scales = new long[4]; /** now not used, was scale _after_ gamma is applied, 0x400(default) corresponds to 1.0 */
  • double[][] rgammas = new double[4][];
  • double min_gain;
  • long WOI_LEFT;
  • long WOI_WIDTH;
  • long WOI_TOP;
  • long WOI_HEIGHT;
  • long BAYER_MODE;
  • long DCM_HOR;
  • long DCM_VERT;
  • long BIN_HOR;
  • long BIN_VERT;
  • long COLOR_MODE;
  • long FLIPH;
  • long FLIPV;
  • long HEIGHT1;
  • long HEIGHT2;
  • long HEIGHT3;
  • long BLANK1;
  • long BLANK2;
  • boolean COMPOSITE;
  • boolean PORTRAIT;
  • boolean YTABLEFORC;
  • long QUALITY;
  • long CQUALITY;
  • long CORING_INDEX_Y;
  • long CORING_INDEX_C;

More information is available in the Makernote reading functions at: [1] starting at line 303

Adding additional EXIF2.2 Data Fields in the camera

Emails by Andrey Filippov on Support Mailinglist:

http://www.mail-archive.com/support-list@support.elphel.com/msg00313.html

http://www.mail-archive.com/support-list@support.elphel.com/msg00278.html