Add Roll, Pitch, Yaw to folder of images

Started by lombardata, November 09, 2022, 06:34:54 AM

Previous topic - Next topic

lombardata

Dear all,
I would like to add  Roll, Pitch, Yaw informations to a folder of images thanks to the geotag option.
Using the following command :
"exiftool -config /path/example.config -m  -geotag " + txt_path + " '-geotime<${XMP:DateTimeOriginal}+00:00' " + "/img_path/prova" + " -overwrite_original -v2"I get the following output (I will copy only for the first image):
Writing File:Geotag
======== /home/mcontini/Desktop/prova/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg
Setting new values from /home/mcontini/Desktop/prova/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg
  Geotime value:   2022:10:21 12:15:18.250 UTC
Writing MIE-GPS:GPSLatitude
Writing XMP-drone-dji:GPSLatitude if tag exists
Writing XMP-exif:GPSLatitude if tag exists
Writing GPS:GPSLatitude
Writing MIE-GPS:GPSLongitude
Writing XMP-drone-dji:GPSLongitude if tag exists
Writing XMP-exif:GPSLongitude if tag exists
Writing GPS:GPSLongitude
Writing MIE-GPS:GPSAltitude
Writing XMP-exif:GPSAltitude if tag exists
Writing GPS:GPSAltitude
Writing XMP-exif:GPSAltitudeRef if tag exists
Writing GPS:GPSAltitudeRef
Deleting XMP-exif:GPSImgDirection
Deleting GPS:GPSImgDirection
Deleting XMP-exif:GPSImgDirectionRef
Deleting GPS:GPSImgDirectionRef
Deleting XMP-exifEX:CameraElevationAngle
Deleting ExifIFD:CameraElevationAngle
Deleting GPS:GPSPitch
Deleting GPS:GPSRoll
Writing GPS:GPSLatitudeRef
Writing GPS:GPSLongitudeRef
Writing GPS:GPSDateStamp
Writing GPS:GPSTimeStamp
Writing XMP-exif:GPSDateTime if tag exists
Rewriting /home/mcontini/Desktop/prova/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg...
  Editing tags in: APP0 APP1 ExifIFD File GPS IFD0 JFIF MIE-GPS XMP
  Creating tags in: APP1 File GPS IFD0 MIE-GPS
JPEG APP0 (14 bytes):
  Rewriting JFIF
JPEG APP1 (436 bytes):
  Rewriting IFD0
  Rewriting ExifIFD
  Rewriting GPS
    - GPS:GPSLatitudeRef = 'S'
    + GPS:GPSLatitudeRef = 'S'
    - GPS:GPSLatitude = '9 24 40.92812983'
    + GPS:GPSLatitude = '9 24 40.92812999989'
    - GPS:GPSLongitudeRef = 'E'
    + GPS:GPSLongitudeRef = 'E'
    - GPS:GPSLongitude = '46 12 35.99388005'
    + GPS:GPSLongitude = '46 12 35.9938800000082'
    - GPS:GPSAltitudeRef = '1'
    + GPS:GPSAltitudeRef = '1'
    - GPS:GPSAltitude = '2.014999867'
    + GPS:GPSAltitude = '2.0149998664856'
    - GPS:GPSTimeStamp = '12 15 18.25'
    + GPS:GPSTimeStamp = '12 15 18.25'
    - GPS:GPSDateStamp = '2022:10:21'
    + GPS:GPSDateStamp = '2022:10:21'
JPEG APP1 (2856 bytes):
  Rewriting XMP
    [XMP rewritten with no changes]
JPEG COM (14 bytes):
JPEG DQT (65 bytes):
JPEG DHT (227 bytes):
JPEG SOF0:
JPEG SOS
and once I try to see the metadata associated to images :
exiftool -n img_pathI get the Latitude and Longitude updated, but not the Roll, Pitch and Yaw:
##################
session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg
##################
ExifTool Version Number         : 12.40
File Name                       : session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg
Directory                       : /home/mcontini/Desktop/prova
File Size                       : 405486
File Modification Date/Time     : 2022:11:09 15:19:46+04:00
File Access Date/Time           : 2022:11:09 15:19:58+04:00
File Inode Change Date/Time     : 2022:11:09 15:19:46+04:00
File Permissions                : 100755
File Type                       : JPEG
File Type Extension             : JPG
MIME Type                       : image/jpeg
JFIF Version                    : 1 2
Exif Byte Order                 : MM
X Resolution                    : 1
Y Resolution                    : 1
Resolution Unit                 : 1
Y Cb Cr Positioning             : 1
Exif Version                    : 0232
Date/Time Original              : 2022:10:21 12:15:18
Components Configuration        : 1 2 3 0
Sub Sec Time                    : 250
Sub Sec Time Original           : 250
Sub Sec Time Digitized          : 250
Flashpix Version                : 0100
Color Space                     : 65535
GPS Version ID                  : 2 3 0 0
GPS Latitude Ref                : S
GPS Longitude Ref               : E
GPS Altitude Ref                : 1
GPS Time Stamp                  : 12:15:18.25
GPS Date Stamp                  : 2022:10:21
XMP Toolkit                     : Image::ExifTool 12.40
Comment                         : Lavc58.54.100
Image Width                     : 1920
Image Height                    : 1080
Encoding Process                : 0
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : 2 2
Image Size                      : 1920 1080
Megapixels                      : 2.0736
Date/Time Original              : 2022:10:21 12:15:18.250
GPS Altitude                    : -2.014999867
GPS Date/Time                   : 2022:10:21 12:15:18.25Z
GPS Latitude                    : -9.41136892495278
GPS Longitude                   : 46.2099983000139
GPS Position                    : -9.41136892495278 46.2099983000139
Does anyone figure out why?
The txt_path file with the metadata looks like :
GPS_time,GPSLatitude,GPSLongitude,GPSAltitude,GPSRoll,GPSPitch,GPSYaw,GPSDateStamp,GPSTimeStamp
2022-10-21 11:41:19.200000,-9.4113388,46.2100025,-2.059999942779541,-3.9592173534911126,-3.2360887320246547,18.04371296428144,2022-10-21,11:41:19.200000
2022-10-21 11:41:19.400000,-9.4113373,46.2100022,-2.059999942779541,-2.432934291911806,-0.8018471434770618,15.925624467265152,2022-10-21,11:41:19.400000
2022-10-21 11:41:19.600000,-9.4113359,46.2100023,-2.059999942779541,-0.318486201493215,1.091261380828655,15.604260763764614,2022-10-21,11:41:19.600000
Thank you in advance and thanks you for this powerful opensource tool :)

Phil Harvey

EXIF GPSPitch and GPSRoll are non-standard tags and require the user-defined tags in the config file to read them back as well.

If instead you write to XMP GPSPitch and GPSRoll you will be able to read them back without the config file.  (XMP stores the tag name in the metadata, which allows unknown tags to be meaningfully extracted.  EXIF does not.)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

lombardata

Thank you very much Phil for your reply.
I tried to change the txt file header to :
GPS_time,GPSLatitude,GPSLongitude,GPSAltitude,XMP-exif:GPSRoll,XMP-exif:GPSPitch,GPSYaw,GPSDateStamp,GPSTimeStamp
2022-10-21 11:41:19.200000,-9.4113388,46.2100025,-2.059999942779541,-3.9592173534911126,-3.2360887320246547,18.04371296428144,2022-10-21,11:41:19.200000
2022-10-21 11:41:19.400000,-9.4113373,46.2100022,-2.059999942779541,-2.432934291911806,-0.8018471434770618,15.925624467265152,2022-10-21,11:41:19.400000
but the problem still remain.
Where I'm wrong?
I also tried to change GPSDateStamp and GPSTimeStamp to XMP:GPSDateStamp etc but did not obtain the wished result.
Have a good day

Phil Harvey

Example 4 on the geotag page shows how to tag with XMP.  Your code should be:

exiftool -config /path/example.config -m -geotag " + txt_path + " '-xmp:geotime<${XMP:DateTimeOriginal}+00:00' " + "/img_path/prova" + " -overwrite_original -v2

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Also, I don't think GPSYaw is part of the example config file.  And it also isn't among the list of tags the -geotag option will write.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Good point.  You should use GPSTrack instead of GPSYaw.  It may not be the best place for the this information, but you can move it somewhere else (like to a user-defined XMP tag) after geotagging.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

lombardata

Ok, thank you very much Phil and StarGeek.
I've tried your command Phil (sorry but I didn't see the command on Example 4) but still do not have Roll and Pitch information.
Output of :
"exiftool -config /your_dir/example.config -m -geotag " + "your_dir/exiftool_tags_prova.txt " + " '-xmp:geotime<${XMP:DateTimeOriginal}+00:00' " + "your_dir/img"  + " -overwrite_original -v2"
is :
======== /home/mcontini/Desktop/prova/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1850.jpeg
Setting new values from /home/mcontini/Desktop/prova/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1850.jpeg
  Geotime value:   2022:10:21 12:15:18.500 UTC
Writing MIE-GPS:GPSLatitude
Writing XMP-drone-dji:GPSLatitude if tag exists
Writing XMP-exif:GPSLatitude if tag exists
Writing GPS:GPSLatitude
Writing MIE-GPS:GPSLongitude
Writing XMP-drone-dji:GPSLongitude if tag exists
Writing XMP-exif:GPSLongitude if tag exists
Writing GPS:GPSLongitude
Writing MIE-GPS:GPSAltitude
Writing XMP-exif:GPSAltitude if tag exists
Writing GPS:GPSAltitude
Writing XMP-exif:GPSAltitudeRef if tag exists
Writing GPS:GPSAltitudeRef
Writing MIE-GPS:GPSTrack
Writing XMP-exif:GPSTrack if tag exists
Writing GPS:GPSTrack
Writing XMP-exif:GPSTrackRef if tag exists
Writing GPS:GPSTrackRef
Deleting MIE-GPS:GPSSpeed
Deleting XMP-exif:GPSSpeed
Deleting GPS:GPSSpeed
Deleting XMP-exif:GPSSpeedRef
Deleting GPS:GPSSpeedRef
Deleting XMP-exif:GPSImgDirection
Deleting GPS:GPSImgDirection
Deleting XMP-exif:GPSImgDirectionRef
Deleting GPS:GPSImgDirectionRef
Deleting XMP-exifEX:CameraElevationAngle
Deleting ExifIFD:CameraElevationAngle
Deleting XMP-exif:GPSPitch
Deleting GPS:GPSPitch
Deleting XMP-exif:GPSRoll
Deleting GPS:GPSRoll
Writing GPS:GPSLatitudeRef
Writing GPS:GPSLongitudeRef
Writing GPS:GPSDateStamp
Writing GPS:GPSTimeStamp
Writing XMP-exif:GPSDateTime if tag exists
Rewriting /home/mcontini/Desktop/prova/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1850.jpeg...
  Editing tags in: APP0 APP1 ExifIFD File GPS IFD0 JFIF MIE-GPS XMP
  Creating tags in: APP1 File GPS IFD0 MIE-GPS
JPEG APP0 (14 bytes):
  Rewriting JFIF
JPEG APP1 (436 bytes):
  Rewriting IFD0
  Rewriting ExifIFD
  Rewriting GPS
    - GPS:GPSLatitudeRef = 'S'
    + GPS:GPSLatitudeRef = 'S'
    - GPS:GPSLatitude = '9 24 40.92858'
    + GPS:GPSLatitude = '9 24 40.928580000004'
    - GPS:GPSLongitudeRef = 'E'
    + GPS:GPSLongitudeRef = 'E'
    - GPS:GPSLongitude = '46 12 35.99405999'
    + GPS:GPSLongitude = '46 12 35.9940600000231'
    - GPS:GPSAltitudeRef = '1'
    + GPS:GPSAltitudeRef = '1'
    - GPS:GPSAltitude = '2.007499933'
    + GPS:GPSAltitude = '2.0074999332428'
    - GPS:GPSTimeStamp = '12 15 18.5'
    + GPS:GPSTimeStamp = '12 15 18.5'
    + GPS:GPSTrackRef = 'T'
    + GPS:GPSTrack = '205.721648116134'
    - GPS:GPSDateStamp = '2022:10:21'
    + GPS:GPSDateStamp = '2022:10:21'
JPEG APP1 (3207 bytes):
  Rewriting XMP
    - XMP-exif:GPSAltitude = '75215/37467'
    + XMP-exif:GPSAltitude = '75215/37467'
    - XMP-exif:GPSAltitudeRef = '1'
    + XMP-exif:GPSAltitudeRef = '1'
    - XMP-exif:GPSDateTime = '2022-10-21T12:15:18.5'
    + XMP-exif:GPSDateTime = '2022-10-21T12:15:18.5'
    - XMP-exif:GPSLatitude = '9,24.682143S'
    + XMP-exif:GPSLatitude = '9,24.682143S'
    - XMP-exif:GPSLongitude = '46,12.599901E'
    + XMP-exif:GPSLongitude = '46,12.599901E'
    - XMP-exif:GPSTrack = '19955/97'
    + XMP-exif:GPSTrack = '19955/97'
    - XMP-exif:GPSTrackRef = 'T'
    + XMP-exif:GPSTrackRef = 'T'
JPEG COM (14 bytes):
JPEG DQT (65 bytes):
JPEG DHT (245 bytes):
JPEG SOF0:
JPEG SOS
Output of :
exiftool -n img_pathis :
xifTool Version Number         : 12.40
File Name                       : session_2022_10_21_aldabra_plancha_body_v1A_01_4_1851.jpeg
Directory                       : /home/mcontini/Desktop/prova
File Size                       : 449281
File Modification Date/Time     : 2022:11:10 12:59:58+04:00
File Access Date/Time           : 2022:11:10 12:59:58+04:00
File Inode Change Date/Time     : 2022:11:10 12:59:58+04:00
File Permissions                : 100755
File Type                       : JPEG
File Type Extension             : JPG
MIME Type                       : image/jpeg
JFIF Version                    : 1 2
Exif Byte Order                 : MM
X Resolution                    : 1
Y Resolution                    : 1
Resolution Unit                 : 1
Y Cb Cr Positioning             : 1
Exif Version                    : 0232
Date/Time Original              : 2022:10:21 12:15:18
Components Configuration        : 1 2 3 0
Sub Sec Time                    : 750
Sub Sec Time Original           : 750
Sub Sec Time Digitized          : 750
Flashpix Version                : 0100
Color Space                     : 65535
GPS Version ID                  : 2 3 0 0
GPS Altitude Ref                : 1
GPS Time Stamp                  : 12:15:18.75
GPS Date Stamp                  : 2022:10:21
XMP Toolkit                     : Image::ExifTool 12.40
Comment                         : Lavc58.54.100
Image Width                     : 1920
Image Height                    : 1080
Encoding Process                : 0
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : 2 2
Image Size                      : 1920 1080
Megapixels                      : 2.0736
Date/Time Original              : 2022:10:21 12:15:18.750
GPS Altitude                    : -2
GPS Date/Time                   : 2022:10:21 12:15:18.75Z
GPS Latitude                    : -9.41136924994444
GPS Longitude                   : 46.2099984749444
GPS Latitude Ref                : S
GPS Longitude Ref               : E
GPS Position                    : -9.41136924994444 46.2099984749444
For what concerns the Yaw, I succesfully wrote it in GPSTrack and for the time being, this is good enough:)
I would like to upload an example of images and logs, but I have a really slow connection at the moment and find myself unable to do so. Sorry for the inconvenience,
Thanks again

Phil Harvey

This is what I get.  You should be able to reproduce these steps:

> exiftool a.jpg -all=                           
    1 image files updated
> exiftool a.jpg -datetimeoriginal="2022:10:21 11:41:19"
    1 image files updated
> exiftool -config example.config -geotag a.csv '-xmp:geotime<${datetimeoriginal}+00:00' -v2 a.jpg
Loaded 3 points from CSV-format GPS track log file 'a.csv'
  GPS track start: 2022:10:21 11:41:19.200 UTC
  GPS track end:   2022:10:21 11:41:19.600 UTC
Writing File:Geotag
======== a.jpg
Setting new values from a.jpg
  Geotime value:   2022:10:21 11:41:19.000 UTC
Writing XMP-drone-dji:GPSLatitude if tag exists
Writing XMP-exif:GPSLatitude
Writing XMP-drone-dji:GPSLongitude if tag exists
Writing XMP-exif:GPSLongitude
Writing XMP-exif:GPSAltitude
Writing XMP-exif:GPSAltitudeRef
Writing XMP-exif:GPSTrack
Writing XMP-exif:GPSTrackRef
Deleting XMP-exif:GPSSpeed
Deleting XMP-exif:GPSSpeedRef
Deleting XMP-exif:GPSImgDirection
Deleting XMP-exif:GPSImgDirectionRef
Writing XMP-exifEX:CameraElevationAngle
Writing XMP-exif:GPSPitch
Writing XMP-exif:GPSRoll
Writing XMP-exif:GPSDateTime
Rewriting a.jpg...
  Editing tags in: APP1 File XMP
  Creating tags in: APP1 File XMP
JPEG APP1 (182 bytes):
Creating APP1:
  Creating XMP
    + XMP-exifEX:CameraElevationAngle = '-16051/4960'
    + XMP-exif:GPSAltitude = '720005/349517'
    + XMP-exif:GPSAltitudeRef = '1'
    + XMP-exif:GPSDateTime = '2022-10-21T11:41:19'
    + XMP-exif:GPSLatitude = '9,24.680328S'
    + XMP-exif:GPSLongitude = '46,12.60015E'
    + XMP-exif:GPSPitch = '-16051/4960'
    + XMP-exif:GPSRoll = '-16795/4242'
    + XMP-exif:GPSTrack = '33435/1853'
    + XMP-exif:GPSTrackRef = 'T'
JPEG DHT (416 bytes):
JPEG DQT (130 bytes):
JPEG SOF0:
JPEG SOS
    1 image files updated

with this "a.csv" file:

GPS_time,GPSLatitude,GPSLongitude,GPSAltitude,GPSRoll,GPSPitch,GPSTrack,GPSDateStamp,GPSTimeStamp
2022-10-21 11:41:19.200000,-9.4113388,46.2100025,-2.059999942779541,-3.9592173534911126,-3.2360887320246547,18.04371296428144,2022-10-21,11:41:19.200000
2022-10-21 11:41:19.400000,-9.4113373,46.2100022,-2.059999942779541,-2.432934291911806,-0.8018471434770618,15.925624467265152,2022-10-21,11:41:19.400000
2022-10-21 11:41:19.600000,-9.4113359,46.2100023,-2.059999942779541,-0.318486201493215,1.091261380828655,15.604260763764614,2022-10-21,11:41:19.600000

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

There will be support for a GPSImgDirection column in the -geotag CSV-format input file of ExifTool 12.51 when it is released.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

lombardata

Thank you again Phil.
I have successfully reproduced your example, but when I want to do the same for a folder of three images, e.g. :
"exiftool -config /home/mcontini/Desktop/Ifremer/Plancha/example.config -geotag /home/mcontini/Desktop/phil_example/exiftool_tags.csv '-xmp:geotime<${datetimeoriginal}+00:00' -v2 " + DIR +  " -overwrite_original"
with the following csv file (I've changed Roll and Pitch values for sake of simplicity):
GPS_time,GPSLatitude,GPSLongitude,GPSAltitude,GPSRoll,GPSPitch,GPSTrack,GPSDateStamp,GPSTimeStamp
2022-10-21 11:41:19.200000,-9.4113388,46.2100025,-2.05999994277954,-3,-3,18.0437129642814,2022-10-21,11:41:19.200000
2022-10-21 11:41:19.400000,-9.4113373,46.2100022,-2.05999994277954,-2,-2,15.9256244672652,2022-10-21,11:41:19.400000
2022-10-21 11:41:19.600000,-9.4113359,46.2100023,-2.05999994277954,-1,-1,15.6042607637646,2022-10-21,11:41:19.600000
I get the same Roll and Pitch values for all the images (the one for the 11:41:19.200000 time).
Millisecond time is wrote in XMP:DateTimeOriginal and then copied in all the exif time fields :
"exiftool -m '-SubSecTimeOriginal<XMP:DateTimeOriginal'  '-SubSecTime<XMP:DateTimeOriginal' '-SubSecTimeDigitized<XMP:DateTimeOriginal' '-datetimeoriginal<XMP:DateTimeOriginal' " + DIR + " -fileorder filename -overwrite_original"and seems to be well written in the corresponding fields :
======== /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1850.jpeg
ExifTool Version Number         : 12.40
File Name                       : session_2022_10_21_aldabra_plancha_body_v1A_01_4_1850.jpeg
Directory                       : /home/mcontini/Desktop/phil_example/img
File Size                       : 546661
File Modification Date/Time     : 2022:11:14 15:01:01+04:00
File Access Date/Time           : 2022:11:14 15:01:01+04:00
File Inode Change Date/Time     : 2022:11:14 15:01:01+04:00
File Permissions                : 100755
File Type                       : JPEG
File Type Extension             : JPG
MIME Type                       : image/jpeg
Exif Byte Order                 : MM
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : 2
Y Cb Cr Positioning             : 1
Exif Version                    : 0232
Date/Time Original              : 2022:10:21 11:41:19
Components Configuration        : 1 2 3 0
Sub Sec Time                    : 450
Sub Sec Time Original           : 450
Sub Sec Time Digitized          : 450
Flashpix Version                : 0100
Color Space                     : 65535
XMP Toolkit                     : Image::ExifTool 12.40
GPS Altitude Ref                : 1
GPS Latitude                    : -9.4113388
GPS Longitude                   : 46.2100025
GPS Pitch                       : -3
GPS Roll                        : -3
GPS Date/Time                   : 2022:10:21 11:41:19
GPS Track                       : 18.0437128980032
GPS Track Ref                   : T
Camera Elevation Angle          : -3
Image Width                     : 1920
Image Height                    : 1080
Encoding Process                : 0
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : 2 2
Image Size                      : 1920 1080
Megapixels                      : 2.0736
Date/Time Original              : 2022:10:21 11:41:19.450
GPS Altitude                    : -2.05999994277818
GPS Latitude Ref                : S
GPS Longitude Ref               : E
GPS Position                    : -9.4113388 46.2100025
======== /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg
ExifTool Version Number         : 12.40
File Name                       : session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg
Directory                       : /home/mcontini/Desktop/phil_example/img
File Size                       : 405819
File Modification Date/Time     : 2022:11:14 15:01:01+04:00
File Access Date/Time           : 2022:11:14 15:01:01+04:00
File Inode Change Date/Time     : 2022:11:14 15:01:01+04:00
File Permissions                : 100755
File Type                       : JPEG
File Type Extension             : JPG
MIME Type                       : image/jpeg
Exif Byte Order                 : MM
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : 2
Y Cb Cr Positioning             : 1
Exif Version                    : 0232
Date/Time Original              : 2022:10:21 11:41:19
Components Configuration        : 1 2 3 0
Sub Sec Time                    : 200
Sub Sec Time Original           : 200
Sub Sec Time Digitized          : 200
Flashpix Version                : 0100
Color Space                     : 65535
XMP Toolkit                     : Image::ExifTool 12.40
GPS Altitude Ref                : 1
GPS Latitude                    : -9.4113388
GPS Longitude                   : 46.2100025
GPS Pitch                       : -3
GPS Roll                        : -3
GPS Date/Time                   : 2022:10:21 11:41:19
GPS Track                       : 18.0437128980032
GPS Track Ref                   : T
Camera Elevation Angle          : -3
Image Width                     : 1920
Image Height                    : 1080
Encoding Process                : 0
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : 2 2
Image Size                      : 1920 1080
Megapixels                      : 2.0736
Date/Time Original              : 2022:10:21 11:41:19.200
GPS Altitude                    : -2.05999994277818
GPS Latitude Ref                : S
GPS Longitude Ref               : E
GPS Position                    : -9.4113388 46.2100025
======== /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1851.jpeg
ExifTool Version Number         : 12.40
File Name                       : session_2022_10_21_aldabra_plancha_body_v1A_01_4_1851.jpeg
Directory                       : /home/mcontini/Desktop/phil_example/img
File Size                       : 449352
File Modification Date/Time     : 2022:11:14 15:01:01+04:00
File Access Date/Time           : 2022:11:14 15:01:01+04:00
File Inode Change Date/Time     : 2022:11:14 15:01:01+04:00
File Permissions                : 100755
File Type                       : JPEG
File Type Extension             : JPG
MIME Type                       : image/jpeg
Exif Byte Order                 : MM
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : 2
Y Cb Cr Positioning             : 1
Exif Version                    : 0232
Date/Time Original              : 2022:10:21 11:41:19
Components Configuration        : 1 2 3 0
Sub Sec Time                    : 700
Sub Sec Time Original           : 700
Sub Sec Time Digitized          : 700
Flashpix Version                : 0100
Color Space                     : 65535
XMP Toolkit                     : Image::ExifTool 12.40
GPS Altitude Ref                : 1
GPS Latitude                    : -9.4113388
GPS Longitude                   : 46.2100025
GPS Pitch                       : -3
GPS Roll                        : -3
GPS Date/Time                   : 2022:10:21 11:41:19
GPS Track                       : 18.0437128980032
GPS Track Ref                   : T
Camera Elevation Angle          : -3
Image Width                     : 1920
Image Height                    : 1080
Encoding Process                : 0
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : 2 2
Image Size                      : 1920 1080
Megapixels                      : 2.0736
Date/Time Original              : 2022:10:21 11:41:19.700
GPS Altitude                    : -2.05999994277818
GPS Latitude Ref                : S
GPS Longitude Ref               : E
GPS Position                    : -9.4113388 46.2100025
    1 directories scanned
    3 image files read

I tried to change :
"exiftool -config /home/mcontini/Desktop/Ifremer/Plancha/example.config -geotag /home/mcontini/Desktop/phil_example/exiftool_tags.csv '-xmp:geotime<${datetimeoriginal}+00:00' -v2 " + DIR +  " -overwrite_original"to :
"exiftool -config /home/mcontini/Desktop/Ifremer/Plancha/example.config -geotag /home/mcontini/Desktop/phil_example/exiftool_tags.csv '-xmp:geotime<${XMP:DateTimeOriginal}+00:00' -v2 " + DIR +  " -overwrite_original"thinking of passing the correct time with millisecond accuracy, but in this second scenario I've only the image corresponding to the 2022:10:21 11:41:19.700 time that is updated :
- XMP-exif:GPSPitch = '-1/1'
    + XMP-exif:GPSPitch = '-1/1'
    - XMP-exif:GPSRoll = '-1/1'
    + XMP-exif:GPSRoll = '-1/1'
other images do not have the fields corresponding to roll and pitch values.
Do you have any idea where I am wrong?
Sorry for the inconvenience :-\

Phil Harvey

If XMP:DateTimeOriginal has sub seconds, then this should work.  What is the output of this command for your files?:

exiftool -xmp:datetimeoriginal DIR

Also, you may try adding the -v3 option when writing to see more details about what times ExifTool is using and the tags it is writing.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

lombardata

Hi,
the output of the command line is :
======== /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1850.jpeg
Date/Time Original              : 2022:10:21 11:41:19.450
======== /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg
Date/Time Original              : 2022:10:21 11:41:19.200
======== /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1851.jpeg
Date/Time Original              : 2022:10:21 11:41:19.700
so that XMP:DateTimeOriginal seems to have the correct time.
Adding the -v3 option to the following command lined :
os.system("exiftool -config /home/mcontini/Desktop/Ifremer/Plancha/example.config -geotag /home/mcontini/Desktop/phil_example/exiftool_tags.csv '-xmp:geotime<${datetimeoriginal}+00:00' -v3 " + DIR +  " -overwrite_original")
yelds to :
CSV column '_time' ignored
CSV column 'Latitude' is lat
CSV column 'Longitude' is lon
CSV column 'Altitude' is alt
CSV column 'Roll' is roll
CSV column 'Pitch' is pitch
CSV column 'Track' is track
CSV column 'DateStamp' is date
CSV column 'TimeStamp' is time
Loaded 3 points from CSV-format GPS track log file '/home/mcontini/Desktop/phil_example/exiftool_tags.csv'
  GPS track start: 2022:10:21 11:41:19.200 UTC
  GPS track end:   2022:10:21 11:41:19.600 UTC
Writing File:Geotag
======== /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1850.jpeg
Setting new values from /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1850.jpeg
  Geotime value:   2022:10:21 11:41:19.000 UTC
  Taking pos from fix:
    2022:10:21 11:41:19.200 UTC - alt=-2.05999994277954 first=1 lat=-9.4113388 lon=46.2100025 pitch=-3 roll=-3 track=18.0437129642814
Writing XMP-drone-dji:GPSLatitude if tag exists
Writing XMP-exif:GPSLatitude
Writing XMP-drone-dji:GPSLongitude if tag exists
Writing XMP-exif:GPSLongitude
Writing XMP-exif:GPSAltitude
Writing XMP-exif:GPSAltitudeRef
Writing XMP-exif:GPSTrack
Writing XMP-exif:GPSTrackRef
Deleting XMP-exif:GPSSpeed
Deleting XMP-exif:GPSSpeedRef
Deleting XMP-exif:GPSImgDirection
Deleting XMP-exif:GPSImgDirectionRef
Writing XMP-exifEX:CameraElevationAngle
Writing XMP-exif:GPSPitch
Writing XMP-exif:GPSRoll
Writing XMP-exif:GPSDateTime
Rewriting /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1850.jpeg...
  Editing tags in: APP1 File XMP
  Creating tags in: APP1 File XMP
JPEG APP1 (218 bytes):
    0000: 45 78 69 66 00 00 4d 4d 00 2a 00 00 00 08 00 05 [Exif..MM.*......]
    0010: 01 1a 00 05 00 00 00 01 00 00 00 4a 01 1b 00 05 [...........J....]
    0020: 00 00 00 01 00 00 00 52 01 28 00 03 00 00 00 01 [.......R.(......]
    0030: 00 02 00 00 02 13 00 03 00 00 00 01 00 01 00 00 [................]
    0040: 87 69 00 04 00 00 00 01 00 00 00 5a 00 00 00 00 [.i.........Z....]
    0050: 00 00 00 48 00 00 00 01 00 00 00 48 00 00 00 01 [...H.......H....]
    0060: 00 08 90 00 00 07 00 00 00 04 30 32 33 32 90 03 [..........0232..]
    [snip 106 bytes]
JPEG APP1 (3443 bytes):
    0000: 68 74 74 70 3a 2f 2f 6e 73 2e 61 64 6f 62 65 2e [http://ns.adobe.]
    0010: 63 6f 6d 2f 78 61 70 2f 31 2e 30 2f 00 3c 3f 78 [com/xap/1.0/.<?x]
    0020: 70 61 63 6b 65 74 20 62 65 67 69 6e 3d 27 ef bb [packet begin='..]
    0030: bf 27 20 69 64 3d 27 57 35 4d 30 4d 70 43 65 68 [.' id='W5M0MpCeh]
    0040: 69 48 7a 72 65 53 7a 4e 54 63 7a 6b 63 39 64 27 [iHzreSzNTczkc9d']
    0050: 3f 3e 0a 3c 78 3a 78 6d 70 6d 65 74 61 20 78 6d [?>.<x:xmpmeta xm]
    0060: 6c 6e 73 3a 78 3d 27 61 64 6f 62 65 3a 6e 73 3a [lns:x='adobe:ns:]
    [snip 3331 bytes]
  Rewriting XMP
    - XMP-exifEX:CameraElevationAngle = '-3/1'
    + XMP-exifEX:CameraElevationAngle = '-3/1'
    - XMP-exif:GPSAltitude = '720005/349517'
    + XMP-exif:GPSAltitude = '720005/349517'
    - XMP-exif:GPSAltitudeRef = '1'
    + XMP-exif:GPSAltitudeRef = '1'
    - XMP-exif:GPSDateTime = '2022-10-21T11:41:19'
    + XMP-exif:GPSDateTime = '2022-10-21T11:41:19'
    - XMP-exif:GPSLatitude = '9,24.680328S'
    + XMP-exif:GPSLatitude = '9,24.680328S'
    - XMP-exif:GPSLongitude = '46,12.60015E'
    + XMP-exif:GPSLongitude = '46,12.60015E'
    - XMP-exif:GPSPitch = '-3/1'
    + XMP-exif:GPSPitch = '-3/1'
    - XMP-exif:GPSRoll = '-3/1'
    + XMP-exif:GPSRoll = '-3/1'
    - XMP-exif:GPSTrack = '33435/1853'
    + XMP-exif:GPSTrack = '33435/1853'
    - XMP-exif:GPSTrackRef = 'T'
    + XMP-exif:GPSTrackRef = 'T'
JPEG DQT (65 bytes):
JPEG DHT (245 bytes):
JPEG SOF0:
JPEG SOS
======== /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg
Setting new values from /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg
  Geotime value:   2022:10:21 11:41:19.000 UTC
  Taking pos from fix:
    2022:10:21 11:41:19.200 UTC - alt=-2.05999994277954 first=1 lat=-9.4113388 lon=46.2100025 pitch=-3 roll=-3 track=18.0437129642814
Writing XMP-drone-dji:GPSLatitude if tag exists
Writing XMP-exif:GPSLatitude
Writing XMP-drone-dji:GPSLongitude if tag exists
Writing XMP-exif:GPSLongitude
Writing XMP-exif:GPSAltitude
Writing XMP-exif:GPSAltitudeRef
Writing XMP-exif:GPSTrack
Writing XMP-exif:GPSTrackRef
Deleting XMP-exif:GPSSpeed
Deleting XMP-exif:GPSSpeedRef
Deleting XMP-exif:GPSImgDirection
Deleting XMP-exif:GPSImgDirectionRef
Writing XMP-exifEX:CameraElevationAngle
Writing XMP-exif:GPSPitch
Writing XMP-exif:GPSRoll
Writing XMP-exif:GPSDateTime
Rewriting /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg...
  Editing tags in: APP1 File XMP
  Creating tags in: APP1 File XMP
JPEG APP1 (218 bytes):
    0000: 45 78 69 66 00 00 4d 4d 00 2a 00 00 00 08 00 05 [Exif..MM.*......]
    0010: 01 1a 00 05 00 00 00 01 00 00 00 4a 01 1b 00 05 [...........J....]
    0020: 00 00 00 01 00 00 00 52 01 28 00 03 00 00 00 01 [.......R.(......]
    0030: 00 02 00 00 02 13 00 03 00 00 00 01 00 01 00 00 [................]
    0040: 87 69 00 04 00 00 00 01 00 00 00 5a 00 00 00 00 [.i.........Z....]
    0050: 00 00 00 48 00 00 00 01 00 00 00 48 00 00 00 01 [...H.......H....]
    0060: 00 08 90 00 00 07 00 00 00 04 30 32 33 32 90 03 [..........0232..]
    [snip 106 bytes]
JPEG APP1 (3443 bytes):
    0000: 68 74 74 70 3a 2f 2f 6e 73 2e 61 64 6f 62 65 2e [http://ns.adobe.]
    0010: 63 6f 6d 2f 78 61 70 2f 31 2e 30 2f 00 3c 3f 78 [com/xap/1.0/.<?x]
    0020: 70 61 63 6b 65 74 20 62 65 67 69 6e 3d 27 ef bb [packet begin='..]
    0030: bf 27 20 69 64 3d 27 57 35 4d 30 4d 70 43 65 68 [.' id='W5M0MpCeh]
    0040: 69 48 7a 72 65 53 7a 4e 54 63 7a 6b 63 39 64 27 [iHzreSzNTczkc9d']
    0050: 3f 3e 0a 3c 78 3a 78 6d 70 6d 65 74 61 20 78 6d [?>.<x:xmpmeta xm]
    0060: 6c 6e 73 3a 78 3d 27 61 64 6f 62 65 3a 6e 73 3a [lns:x='adobe:ns:]
    [snip 3331 bytes]
  Rewriting XMP
    - XMP-exifEX:CameraElevationAngle = '-3/1'
    + XMP-exifEX:CameraElevationAngle = '-3/1'
    - XMP-exif:GPSAltitude = '720005/349517'
    + XMP-exif:GPSAltitude = '720005/349517'
    - XMP-exif:GPSAltitudeRef = '1'
    + XMP-exif:GPSAltitudeRef = '1'
    - XMP-exif:GPSDateTime = '2022-10-21T11:41:19'
    + XMP-exif:GPSDateTime = '2022-10-21T11:41:19'
    - XMP-exif:GPSLatitude = '9,24.680328S'
    + XMP-exif:GPSLatitude = '9,24.680328S'
    - XMP-exif:GPSLongitude = '46,12.60015E'
    + XMP-exif:GPSLongitude = '46,12.60015E'
    - XMP-exif:GPSPitch = '-3/1'
    + XMP-exif:GPSPitch = '-3/1'
    - XMP-exif:GPSRoll = '-3/1'
    + XMP-exif:GPSRoll = '-3/1'
    - XMP-exif:GPSTrack = '33435/1853'
    + XMP-exif:GPSTrack = '33435/1853'
    - XMP-exif:GPSTrackRef = 'T'
    + XMP-exif:GPSTrackRef = 'T'
JPEG DQT (65 bytes):
JPEG DHT (227 bytes):
JPEG SOF0:
JPEG SOS
======== /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1851.jpeg
Setting new values from /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1851.jpeg
  Geotime value:   2022:10:21 11:41:19.000 UTC
  Taking pos from fix:
    2022:10:21 11:41:19.200 UTC - alt=-2.05999994277954 first=1 lat=-9.4113388 lon=46.2100025 pitch=-3 roll=-3 track=18.0437129642814
Writing XMP-drone-dji:GPSLatitude if tag exists
Writing XMP-exif:GPSLatitude
Writing XMP-drone-dji:GPSLongitude if tag exists
Writing XMP-exif:GPSLongitude
Writing XMP-exif:GPSAltitude
Writing XMP-exif:GPSAltitudeRef
Writing XMP-exif:GPSTrack
Writing XMP-exif:GPSTrackRef
Deleting XMP-exif:GPSSpeed
Deleting XMP-exif:GPSSpeedRef
Deleting XMP-exif:GPSImgDirection
Deleting XMP-exif:GPSImgDirectionRef
Writing XMP-exifEX:CameraElevationAngle
Writing XMP-exif:GPSPitch
Writing XMP-exif:GPSRoll
Writing XMP-exif:GPSDateTime
Rewriting /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1851.jpeg...
  Editing tags in: APP1 File XMP
  Creating tags in: APP1 File XMP
JPEG APP1 (218 bytes):
    0000: 45 78 69 66 00 00 4d 4d 00 2a 00 00 00 08 00 05 [Exif..MM.*......]
    0010: 01 1a 00 05 00 00 00 01 00 00 00 4a 01 1b 00 05 [...........J....]
    0020: 00 00 00 01 00 00 00 52 01 28 00 03 00 00 00 01 [.......R.(......]
    0030: 00 02 00 00 02 13 00 03 00 00 00 01 00 01 00 00 [................]
    0040: 87 69 00 04 00 00 00 01 00 00 00 5a 00 00 00 00 [.i.........Z....]
    0050: 00 00 00 48 00 00 00 01 00 00 00 48 00 00 00 01 [...H.......H....]
    0060: 00 08 90 00 00 07 00 00 00 04 30 32 33 32 90 03 [..........0232..]
    [snip 106 bytes]
JPEG APP1 (3443 bytes):
    0000: 68 74 74 70 3a 2f 2f 6e 73 2e 61 64 6f 62 65 2e [http://ns.adobe.]
    0010: 63 6f 6d 2f 78 61 70 2f 31 2e 30 2f 00 3c 3f 78 [com/xap/1.0/.<?x]
    0020: 70 61 63 6b 65 74 20 62 65 67 69 6e 3d 27 ef bb [packet begin='..]
    0030: bf 27 20 69 64 3d 27 57 35 4d 30 4d 70 43 65 68 [.' id='W5M0MpCeh]
    0040: 69 48 7a 72 65 53 7a 4e 54 63 7a 6b 63 39 64 27 [iHzreSzNTczkc9d']
    0050: 3f 3e 0a 3c 78 3a 78 6d 70 6d 65 74 61 20 78 6d [?>.<x:xmpmeta xm]
    0060: 6c 6e 73 3a 78 3d 27 61 64 6f 62 65 3a 6e 73 3a [lns:x='adobe:ns:]
    [snip 3331 bytes]
  Rewriting XMP
    - XMP-exifEX:CameraElevationAngle = '-3/1'
    + XMP-exifEX:CameraElevationAngle = '-3/1'
    - XMP-exif:GPSAltitude = '720005/349517'
    + XMP-exif:GPSAltitude = '720005/349517'
    - XMP-exif:GPSAltitudeRef = '1'
    + XMP-exif:GPSAltitudeRef = '1'
    - XMP-exif:GPSDateTime = '2022-10-21T11:41:19'
    + XMP-exif:GPSDateTime = '2022-10-21T11:41:19'
    - XMP-exif:GPSLatitude = '9,24.680328S'
    + XMP-exif:GPSLatitude = '9,24.680328S'
    - XMP-exif:GPSLongitude = '46,12.60015E'
    + XMP-exif:GPSLongitude = '46,12.60015E'
    - XMP-exif:GPSPitch = '-3/1'
    + XMP-exif:GPSPitch = '-3/1'
    - XMP-exif:GPSRoll = '-3/1'
    + XMP-exif:GPSRoll = '-3/1'
    - XMP-exif:GPSTrack = '33435/1853'
    + XMP-exif:GPSTrack = '33435/1853'
    - XMP-exif:GPSTrackRef = 'T'
    + XMP-exif:GPSTrackRef = 'T'
JPEG DQT (65 bytes):
JPEG DHT (228 bytes):
JPEG SOF0:
JPEG SOS
    1 directories scanned
    3 image files updated
which makes me think that the time on which the data is associated to images is not the right time (Geotime value:   2022:10:21 11:41:19.000 UTC, for the three images). Maybe due to an error in doing
Quote-datetimeoriginal<XMP:DateTimeOriginal
?
On the other hand if I try directly with
QuoteXMP:DateTimeOriginal
:
os.system("exiftool -config /home/mcontini/Desktop/Ifremer/Plancha/example.config -geotag /home/mcontini/Desktop/phil_example/exiftool_tags.csv '-xmp:geotime<${XMP:DateTimeOriginal}+00:00' -v3 " + DIR +  " -overwrite_original")

then the output is :
CSV column '_time' ignored
CSV column 'Latitude' is lat
CSV column 'Longitude' is lon
CSV column 'Altitude' is alt
CSV column 'Roll' is roll
CSV column 'Pitch' is pitch
CSV column 'Track' is track
CSV column 'DateStamp' is date
CSV column 'TimeStamp' is time
Loaded 3 points from CSV-format GPS track log file '/home/mcontini/Desktop/phil_example/exiftool_tags.csv'
  GPS track start: 2022:10:21 11:41:19.200 UTC
  GPS track end:   2022:10:21 11:41:19.600 UTC
Writing File:Geotag
======== /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1850.jpeg
Setting new values from /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1850.jpeg
  Geotime value:   2022:10:21 11:41:19.450 UTC
  Interpolating between fixes (f=0.25):
    2022:10:21 11:41:19.400 UTC - alt=-2.05999994277954 lat=-9.4113373 lon=46.2100022 pitch=-2 roll=-2 track=15.9256244672652
    2022:10:21 11:41:19.600 UTC - alt=-2.05999994277954 lat=-9.4113359 lon=46.2100023 pitch=-1 roll=-1 track=15.6042607637646
Writing XMP-drone-dji:GPSLatitude if tag exists
Writing XMP-exif:GPSLatitude
Writing XMP-drone-dji:GPSLongitude if tag exists
Writing XMP-exif:GPSLongitude
Writing XMP-exif:GPSAltitude
Writing XMP-exif:GPSAltitudeRef
Writing XMP-exif:GPSTrack
Writing XMP-exif:GPSTrackRef
Deleting XMP-exif:GPSSpeed
Deleting XMP-exif:GPSSpeedRef
Deleting XMP-exif:GPSImgDirection
Deleting XMP-exif:GPSImgDirectionRef
Deleting XMP-exifEX:CameraElevationAngle
Deleting XMP-exif:GPSPitch
Deleting XMP-exif:GPSRoll
Writing XMP-exif:GPSDateTime
Rewriting /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1850.jpeg...
  Editing tags in: APP1 File XMP
  Creating tags in: APP1 File XMP
JPEG APP1 (218 bytes):
    0000: 45 78 69 66 00 00 4d 4d 00 2a 00 00 00 08 00 05 [Exif..MM.*......]
    0010: 01 1a 00 05 00 00 00 01 00 00 00 4a 01 1b 00 05 [...........J....]
    0020: 00 00 00 01 00 00 00 52 01 28 00 03 00 00 00 01 [.......R.(......]
    0030: 00 02 00 00 02 13 00 03 00 00 00 01 00 01 00 00 [................]
    0040: 87 69 00 04 00 00 00 01 00 00 00 5a 00 00 00 00 [.i.........Z....]
    0050: 00 00 00 48 00 00 00 01 00 00 00 48 00 00 00 01 [...H.......H....]
    0060: 00 08 90 00 00 07 00 00 00 04 30 32 33 32 90 03 [..........0232..]
    [snip 106 bytes]
JPEG APP1 (3443 bytes):
    0000: 68 74 74 70 3a 2f 2f 6e 73 2e 61 64 6f 62 65 2e [http://ns.adobe.]
    0010: 63 6f 6d 2f 78 61 70 2f 31 2e 30 2f 00 3c 3f 78 [com/xap/1.0/.<?x]
    0020: 70 61 63 6b 65 74 20 62 65 67 69 6e 3d 27 ef bb [packet begin='..]
    0030: bf 27 20 69 64 3d 27 57 35 4d 30 4d 70 43 65 68 [.' id='W5M0MpCeh]
    0040: 69 48 7a 72 65 53 7a 4e 54 63 7a 6b 63 39 64 27 [iHzreSzNTczkc9d']
    0050: 3f 3e 0a 3c 78 3a 78 6d 70 6d 65 74 61 20 78 6d [?>.<x:xmpmeta xm]
    0060: 6c 6e 73 3a 78 3d 27 61 64 6f 62 65 3a 6e 73 3a [lns:x='adobe:ns:]
    [snip 3331 bytes]
  Rewriting XMP
    - XMP-exifEX:CameraElevationAngle = '-3/1'
    - XMP-exif:GPSAltitude = '720005/349517'
    + XMP-exif:GPSAltitude = '720005/349517'
    - XMP-exif:GPSAltitudeRef = '1'
    + XMP-exif:GPSAltitudeRef = '1'
    - XMP-exif:GPSDateTime = '2022-10-21T11:41:19'
    + XMP-exif:GPSDateTime = '2022-10-21T11:41:19.45'
    - XMP-exif:GPSLatitude = '9,24.680328S'
    + XMP-exif:GPSLatitude = '9,24.680217S'
    - XMP-exif:GPSLongitude = '46,12.60015E'
    + XMP-exif:GPSLongitude = '46,12.6001335E'
    - XMP-exif:GPSPitch = '-3/1'
    - XMP-exif:GPSRoll = '-3/1'
    - XMP-exif:GPSTrack = '33435/1853'
    + XMP-exif:GPSTrack = '116241/7336'
    - XMP-exif:GPSTrackRef = 'T'
    + XMP-exif:GPSTrackRef = 'T'
JPEG DQT (65 bytes):
JPEG DHT (245 bytes):
JPEG SOF0:
JPEG SOS
======== /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg
Setting new values from /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg
  Geotime value:   2022:10:21 11:41:19.200 UTC
  Interpolating between fixes (f=0):
    2022:10:21 11:41:19.200 UTC - alt=-2.05999994277954 first=1 lat=-9.4113388 lon=46.2100025 pitch=-3 roll=-3 track=18.0437129642814
    2022:10:21 11:41:19.400 UTC - alt=-2.05999994277954 lat=-9.4113373 lon=46.2100022 pitch=-2 roll=-2 track=15.9256244672652
Writing XMP-drone-dji:GPSLatitude if tag exists
Writing XMP-exif:GPSLatitude
Writing XMP-drone-dji:GPSLongitude if tag exists
Writing XMP-exif:GPSLongitude
Writing XMP-exif:GPSAltitude
Writing XMP-exif:GPSAltitudeRef
Writing XMP-exif:GPSTrack
Writing XMP-exif:GPSTrackRef
Deleting XMP-exif:GPSSpeed
Deleting XMP-exif:GPSSpeedRef
Deleting XMP-exif:GPSImgDirection
Deleting XMP-exif:GPSImgDirectionRef
Deleting XMP-exifEX:CameraElevationAngle
Deleting XMP-exif:GPSPitch
Deleting XMP-exif:GPSRoll
Writing XMP-exif:GPSDateTime
Rewriting /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg...
  Editing tags in: APP1 File XMP
  Creating tags in: APP1 File XMP
JPEG APP1 (218 bytes):
    0000: 45 78 69 66 00 00 4d 4d 00 2a 00 00 00 08 00 05 [Exif..MM.*......]
    0010: 01 1a 00 05 00 00 00 01 00 00 00 4a 01 1b 00 05 [...........J....]
    0020: 00 00 00 01 00 00 00 52 01 28 00 03 00 00 00 01 [.......R.(......]
    0030: 00 02 00 00 02 13 00 03 00 00 00 01 00 01 00 00 [................]
    0040: 87 69 00 04 00 00 00 01 00 00 00 5a 00 00 00 00 [.i.........Z....]
    0050: 00 00 00 48 00 00 00 01 00 00 00 48 00 00 00 01 [...H.......H....]
    0060: 00 08 90 00 00 07 00 00 00 04 30 32 33 32 90 03 [..........0232..]
    [snip 106 bytes]
JPEG APP1 (3443 bytes):
    0000: 68 74 74 70 3a 2f 2f 6e 73 2e 61 64 6f 62 65 2e [http://ns.adobe.]
    0010: 63 6f 6d 2f 78 61 70 2f 31 2e 30 2f 00 3c 3f 78 [com/xap/1.0/.<?x]
    0020: 70 61 63 6b 65 74 20 62 65 67 69 6e 3d 27 ef bb [packet begin='..]
    0030: bf 27 20 69 64 3d 27 57 35 4d 30 4d 70 43 65 68 [.' id='W5M0MpCeh]
    0040: 69 48 7a 72 65 53 7a 4e 54 63 7a 6b 63 39 64 27 [iHzreSzNTczkc9d']
    0050: 3f 3e 0a 3c 78 3a 78 6d 70 6d 65 74 61 20 78 6d [?>.<x:xmpmeta xm]
    0060: 6c 6e 73 3a 78 3d 27 61 64 6f 62 65 3a 6e 73 3a [lns:x='adobe:ns:]
    [snip 3331 bytes]
  Rewriting XMP
    - XMP-exifEX:CameraElevationAngle = '-3/1'
    - XMP-exif:GPSAltitude = '720005/349517'
    + XMP-exif:GPSAltitude = '720005/349517'
    - XMP-exif:GPSAltitudeRef = '1'
    + XMP-exif:GPSAltitudeRef = '1'
    - XMP-exif:GPSDateTime = '2022-10-21T11:41:19'
    + XMP-exif:GPSDateTime = '2022-10-21T11:41:19.2'
    - XMP-exif:GPSLatitude = '9,24.680328S'
    + XMP-exif:GPSLatitude = '9,24.680328S'
    - XMP-exif:GPSLongitude = '46,12.60015E'
    + XMP-exif:GPSLongitude = '46,12.60015E'
    - XMP-exif:GPSPitch = '-3/1'
    - XMP-exif:GPSRoll = '-3/1'
    - XMP-exif:GPSTrack = '33435/1853'
    + XMP-exif:GPSTrack = '33435/1853'
    - XMP-exif:GPSTrackRef = 'T'
    + XMP-exif:GPSTrackRef = 'T'
JPEG DQT (65 bytes):
JPEG DHT (227 bytes):
JPEG SOF0:
JPEG SOS
======== /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1851.jpeg
Setting new values from /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1851.jpeg
  Geotime value:   2022:10:21 11:41:19.700 UTC
  Taking pos from fix:
    2022:10:21 11:41:19.600 UTC - alt=-2.05999994277954 lat=-9.4113359 lon=46.2100023 pitch=-1 roll=-1 track=15.6042607637646
Writing XMP-drone-dji:GPSLatitude if tag exists
Writing XMP-exif:GPSLatitude
Writing XMP-drone-dji:GPSLongitude if tag exists
Writing XMP-exif:GPSLongitude
Writing XMP-exif:GPSAltitude
Writing XMP-exif:GPSAltitudeRef
Writing XMP-exif:GPSTrack
Writing XMP-exif:GPSTrackRef
Deleting XMP-exif:GPSSpeed
Deleting XMP-exif:GPSSpeedRef
Deleting XMP-exif:GPSImgDirection
Deleting XMP-exif:GPSImgDirectionRef
Writing XMP-exifEX:CameraElevationAngle
Writing XMP-exif:GPSPitch
Writing XMP-exif:GPSRoll
Writing XMP-exif:GPSDateTime
Rewriting /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1851.jpeg...
  Editing tags in: APP1 File XMP
  Creating tags in: APP1 File XMP
JPEG APP1 (218 bytes):
    0000: 45 78 69 66 00 00 4d 4d 00 2a 00 00 00 08 00 05 [Exif..MM.*......]
    0010: 01 1a 00 05 00 00 00 01 00 00 00 4a 01 1b 00 05 [...........J....]
    0020: 00 00 00 01 00 00 00 52 01 28 00 03 00 00 00 01 [.......R.(......]
    0030: 00 02 00 00 02 13 00 03 00 00 00 01 00 01 00 00 [................]
    0040: 87 69 00 04 00 00 00 01 00 00 00 5a 00 00 00 00 [.i.........Z....]
    0050: 00 00 00 48 00 00 00 01 00 00 00 48 00 00 00 01 [...H.......H....]
    0060: 00 08 90 00 00 07 00 00 00 04 30 32 33 32 90 03 [..........0232..]
    [snip 106 bytes]
JPEG APP1 (3443 bytes):
    0000: 68 74 74 70 3a 2f 2f 6e 73 2e 61 64 6f 62 65 2e [http://ns.adobe.]
    0010: 63 6f 6d 2f 78 61 70 2f 31 2e 30 2f 00 3c 3f 78 [com/xap/1.0/.<?x]
    0020: 70 61 63 6b 65 74 20 62 65 67 69 6e 3d 27 ef bb [packet begin='..]
    0030: bf 27 20 69 64 3d 27 57 35 4d 30 4d 70 43 65 68 [.' id='W5M0MpCeh]
    0040: 69 48 7a 72 65 53 7a 4e 54 63 7a 6b 63 39 64 27 [iHzreSzNTczkc9d']
    0050: 3f 3e 0a 3c 78 3a 78 6d 70 6d 65 74 61 20 78 6d [?>.<x:xmpmeta xm]
    0060: 6c 6e 73 3a 78 3d 27 61 64 6f 62 65 3a 6e 73 3a [lns:x='adobe:ns:]
    [snip 3331 bytes]
  Rewriting XMP
    - XMP-exifEX:CameraElevationAngle = '-3/1'
    + XMP-exifEX:CameraElevationAngle = '-1/1'
    - XMP-exif:GPSAltitude = '720005/349517'
    + XMP-exif:GPSAltitude = '720005/349517'
    - XMP-exif:GPSAltitudeRef = '1'
    + XMP-exif:GPSAltitudeRef = '1'
    - XMP-exif:GPSDateTime = '2022-10-21T11:41:19'
    + XMP-exif:GPSDateTime = '2022-10-21T11:41:19.7'
    - XMP-exif:GPSLatitude = '9,24.680328S'
    + XMP-exif:GPSLatitude = '9,24.680154S'
    - XMP-exif:GPSLongitude = '46,12.60015E'
    + XMP-exif:GPSLongitude = '46,12.600138E'
    - XMP-exif:GPSPitch = '-3/1'
    + XMP-exif:GPSPitch = '-1/1'
    - XMP-exif:GPSRoll = '-3/1'
    + XMP-exif:GPSRoll = '-1/1'
    - XMP-exif:GPSTrack = '33435/1853'
    + XMP-exif:GPSTrack = '24171/1549'
    - XMP-exif:GPSTrackRef = 'T'
    + XMP-exif:GPSTrackRef = 'T'
JPEG DQT (65 bytes):
JPEG DHT (228 bytes):
JPEG SOF0:
JPEG SOS
    1 directories scanned
    3 image files updated
but the reason why it only adds data to the third image remains unclear to me.

Phil Harvey

The -v3 output shows that the command added XMP GPS tags to all images.  If you think it didn't, then this is FAQ 3.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

lombardata

are you referring to code line :
os.system("exiftool -config /home/mcontini/Desktop/Ifremer/Plancha/example.config -geotag /home/mcontini/Desktop/phil_example/exiftool_tags.csv '-xmp:geotime<${datetimeoriginal}+00:00' -v3 " + DIR +  " -overwrite_original")
or :
os.system("exiftool -config /home/mcontini/Desktop/Ifremer/Plancha/example.config -geotag /home/mcontini/Desktop/phil_example/exiftool_tags.csv '-xmp:geotime<${XMP:DateTimeOriginal}+00:00' -v3 " + DIR +  " -overwrite_original")
?
Because in the first case the XMP GPS tags are correctly added to all images, but based on [ExifIFD]       DateTimeOriginal that do not present milliseconds. So that is the reason why the XMP GPS tags are duplicated for all images with the same date and time with a precision to the second (e.g. the three images in the example below).
On the other hand in the second case, XMP GPS tags are associated on the basis of the correct time [XMP-exif]      DateTimeOriginal with a millisecond precision, but not all GPS tags are added to all images. [XMP-exif]      GPSLatitude  and [XMP-exif]      GPSLongitude are correctly updated, but [XMP-exif]      GPSPitch and [XMP-exif]      GPSRoll are written only for image /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1851.jpeg.
I checked FAQ 3 and the information I'm looking at is the correct one, there are no duplicate tags for the GPS Roll and GPS Pitch tags and there is no contradictory information in different meta information formats.

lombardata

Quote from: lombardata on November 15, 2022, 01:14:31 AMOn the other hand in the second case, XMP GPS tags are associated on the basis of the correct time [XMP-exif]      DateTimeOriginal with a millisecond precision, but not all GPS tags are added to all images. [XMP-exif]      GPSLatitude  and [XMP-exif]      GPSLongitude are correctly updated, but [XMP-exif]      GPSPitch and [XMP-exif]      GPSRoll are written only for image /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1851.jpeg.
Looking at the output of :
os.system("exiftool -config /home/mcontini/Desktop/Ifremer/Plancha/example.config -geotag /home/mcontini/Desktop/phil_example/exiftool_tags.csv '-xmp:geotime<${XMP:datetimeoriginal}+00:00' -v3 " + DIR +  " -overwrite_original")
it appears that when an interpolation is made :
======== /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg
Setting new values from /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg
  Geotime value:  2022:10:21 11:41:19.200 UTC
  Interpolating between fixes (f=0):
    2022:10:21 11:41:19.200 UTC - alt=-2.05999994277954 first=1 lat=-9.4113388 lon=46.2100025 pitch=-3 roll=-3 track=18.0437129642814
    2022:10:21 11:41:19.400 UTC - alt=-2.05999994277954 lat=-9.4113373 lon=46.2100022 pitch=-2 roll=-2 track=15.9256244672652
and :
======== /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1850.jpeg
Setting new values from /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1850.jpeg
  Geotime value:  2022:10:21 11:41:19.450 UTC
  Interpolating between fixes (f=0.25):
    2022:10:21 11:41:19.400 UTC - alt=-2.05999994277954 lat=-9.4113373 lon=46.2100022 pitch=-2 roll=-2 track=15.9256244672652
    2022:10:21 11:41:19.600 UTC - alt=-2.05999994277954 lat=-9.4113359 lon=46.2100023 pitch=-1 roll=-1 track=15.6042607637646
the tags in question are not written :
Writing XMP-drone-dji:GPSLatitude if tag exists
Writing XMP-exif:GPSLatitude
Writing XMP-drone-dji:GPSLongitude if tag exists
Writing XMP-exif:GPSLongitude
Writing XMP-exif:GPSAltitude
Writing XMP-exif:GPSAltitudeRef
Writing XMP-exif:GPSTrack
Writing XMP-exif:GPSTrackRef
Deleting XMP-exif:GPSSpeed
Deleting XMP-exif:GPSSpeedRef
Deleting XMP-exif:GPSImgDirection
Deleting XMP-exif:GPSImgDirectionRef
Deleting XMP-exifEX:CameraElevationAngle
Deleting XMP-exif:GPSPitch
Deleting XMP-exif:GPSRoll
Writing XMP-exif:GPSDateTime
.
On the other hand, when information is extracted directly from a precise time :
======== /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1851.jpeg
Setting new values from /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1851.jpeg
  Geotime value:  2022:10:21 11:41:19.700 UTC
  Taking pos from fix:
    2022:10:21 11:41:19.600 UTC - alt=-2.05999994277954 lat=-9.4113359 lon=46.2100023 pitch=-1 roll=-1 track=15.6042607637646

the tags are written :
Writing XMP-drone-dji:GPSLatitude if tag exists
Writing XMP-exif:GPSLatitude
Writing XMP-drone-dji:GPSLongitude if tag exists
Writing XMP-exif:GPSLongitude
Writing XMP-exif:GPSAltitude
Writing XMP-exif:GPSAltitudeRef
Writing XMP-exif:GPSTrack
Writing XMP-exif:GPSTrackRef
Deleting XMP-exif:GPSSpeed
Deleting XMP-exif:GPSSpeedRef
Deleting XMP-exif:GPSImgDirection
Deleting XMP-exif:GPSImgDirectionRef
Writing XMP-exifEX:CameraElevationAngle
Writing XMP-exif:GPSPitch
Writing XMP-exif:GPSRoll
Writing XMP-exif:GPSDateTime
it is not clear to me why, just as it is not clear to me why interpolation is made for image /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1849.jpeg which has a time that corresponds exactly to a line in the csv file (Geotime value:   2022:10:21 11:41:19.200 UTC), while for image /home/mcontini/Desktop/phil_example/img/session_2022_10_21_aldabra_plancha_body_v1A_01_4_1851.jpeg interpolation is not made :
  Geotime value:   2022:10:21 11:41:19.700 UTC
  Taking pos from fix:
    2022:10:21 11:41:19.600 UTC - alt=-2.05999994277954 lat=-9.4113359 lon=46.2100023 pitch=-1 roll=-1 track=15.6042607637646
although the time does not correspond perfectly.
Is this due to the fact that there is no information in the csv file for times after the time of this image?
I apologise if I am pedantic, but I am trying to understand how to make the best use of Exiftool's full potential.
Thanks again for your help