I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2009-05-25 17:13:05-07 by janmartin
-geotag not working on jpg files extracted from .avi. Files incldued!
Hi everybody,

please help me in solving this geotagging problem.

I already spend the whole weekend on it, learning a lot, but unfortunately not making any progress at all.

I have 121 jpg pictures extracted from an .avi video using mplayer:
mplayer -vo jpeg:optimize=100:quality=100:outdir=/home/me/test/panos -sstep 12 /home/me/test/'file. +avi'


Manually I created a "track.gpx" file which should be valid and also match the "Date Modified" of the jpg's displayed by Ubuntu Nautilus file manager.

However when running this command:
/home/me/Image-ExifTool-7.76/exiftool -v2 -geotag /home/me/test/track.gpx /home/me/test/panos > /h +ome/me/test/geotag.txt


I only get this output, indicating that images have not been geotagged at all.
Argument "-Geotime<DateTimeOriginal" is assumed Loaded 5 points from GPS track log file '/home/me/test/track.gpx' GPS track start: 2009:05:24 14:23:15 UTC GPS track end: 2009:05:24 14:25:02 UTC Writing File:Geotag ======== /home/me/test/panos/00000036.jpg Setting new values from /home/me/test/panos/00000036.jpg Nothing changed in /home/me/test/panos/00000036.jpg ....


I tried it the whole weekend, worked especially on Timezone settings, but could not make it work.
Your help is greatly appreciated.

Please find the files (first 5 jpgs instead of all 121) and output of the commands I run here:
mybestprojects.com/data/test.zip

Thanks,
Jan,
janmartin3 AT googlemail DOT com


Some more info:v
Images, "Date Modified" according to Ubuntu Nautilus file manager:
2009-05-24 02:23:15 PM
to
2009-05-24 02:25:02 PM

track.gpx: (Created manually.) According to "geotag":
GPS track start: 2009:05:24 14:23:15 UTC
GPS track end: 2009:05:24 14:25:02 UTC

Output of various command I run to solve the problem:
/home/me/Image-ExifTool-7.76/exiftool -v2 -geotag /home/me/test/track.gpx /home/me/test/panos > /h +ome/me/test/geotag.txt /home/me/Image-ExifTool-7.76/exiftool -h /home/me/test/panos/00000001.jpg > /home/me/test/exiftool- +h_00000001.jpg.html /home/me/Image-ExifTool-7.76/exiftool -h /home/me/test/panos/00000121.jpg > /home/me/test/exiftool- +h_00000121.jpg.html /home/me/Image-ExifTool-7.76/exiftool -v2 -AllDates-=2:00 /home/me/test/panos > /home/me/test/-All +Dates-=2:00.txt
Direct Responses: 10813 | Write a response
Posted on 2009-05-25 17:33:16-07 by exiftool in response to 10811
Re: -geotag not working on jpg files extracted from .avi. Files incldued!
Hi Jan,

The problem is that the JPG images don't contain the DateTimeOriginal information. Do a "exiftool -s" on the JPG images to see what the date is called, then add "-geotime>TAG" to the command line (including the quotes) to use the specified TAG as the timestamp for the geotagging.

- Phil
Direct Responses: 10814 | Write a response
Posted on 2009-05-25 17:33:53-07 by exiftool in response to 10813
Re: -geotag not working on jpg files extracted from .avi. Files incldued!
oops. that should have been "-geotime<TAG".
Direct Responses: 10815 | Write a response
Posted on 2009-05-25 17:36:36-07 by exiftool in response to 10814
Re: -geotag not working on jpg files extracted from .avi. Files incldued!
And one more point. It sounds like your times might be in UTC. If so, you would use "-geotime<$TAG+00:00", otherwise local time will be assumed. (use single quotes here instead of double quotes if you are in Linux or on a Mac.)

- Phil
Direct Responses: 10816 | Write a response
Posted on 2009-05-25 18:11:00-07 by janmartin in response to 10815
Re: -geotag not working on jpg files extracted from .avi. Files incldued!
Hi Phil,

wow, that is a fast answer.
Only Date-Tag I see is "FileModifyDate", showing 1243167795.

/home/me/Image-ExifTool-7.76/exiftool -s -v2 /home/me/test/panos/00000001.jpg > /home/me/test/exift +ool-s_00000001.jpg.txt ExifToolVersion = 7.76 FileName = 00000001.jpg Directory = /home/me/test/panos FileSize = 275016 FileModifyDate = 1243167795 FileType = JPEG MIMEType = image/jpeg JPEG APP0 (14 bytes): + [BinaryData directory, 9 bytes] | JFIFVersion = 1 1 | - Tag 0x0000 (2 bytes, int8u[2]) | ResolutionUnit = 1 | - Tag 0x0002 (1 bytes, int8u[1]) | XResolution = 72 | - Tag 0x0003 (2 bytes, int16u[1]) | YResolution = 72 | - Tag 0x0005 (2 bytes, int16u[1]) JPEG DQT (65 bytes): JPEG DQT (65 bytes): JPEG SOF0 (15 bytes): JPEG DHT (29 bytes): JPEG DHT (73 bytes): JPEG DHT (28 bytes): JPEG DHT (66 bytes): JPEG SOS

So I tried this anyway:
/home/me/Image-ExifTool-7.76/exiftool -v2 '-geotime<$FileModifyDate+00:00' -geotag /home/me/test/tr +ack.gpx /home/me/test/panos > /home/me/test/geotag_FileModifyDate.txt<br>

But it only worked after I changed the dates in the gpx file by 2 hours from 14... to 12.. o'clock.

Thanks for the great help.

Jan
Loaded 5 points from GPS track log file '/home/me/test/track.gpx' GPS track start: 2009:05:24 12:23:15 UTC GPS track end: 2009:05:24 12:25:02 UTC Writing File:Geotag ======== /home/me/test/panos/00000036.jpg Setting new values from /home/me/test/panos/00000036.jpg Geotime value: 2009:05:24 12:23:50 UTC Writing MIE-GPS:GPSLatitude Writing XMP-exif:GPSLatitude if tag exists Writing GPS:GPSLatitude Writing MIE-GPS:GPSLongitude Writing XMP-exif:GPSLongitude if tag exists Writing GPS:GPSLongitude Deleting MIE-GPS:GPSAltitude Deleting XMP-exif:GPSAltitude Deleting GPS:GPSAltitude Deleting XMP-exif:GPSAltitudeRef Deleting GPS:GPSAltitudeRef Writing GPS:GPSLatitudeRef Writing GPS:GPSLongitudeRef Writing GPS:GPSDateStamp Writing GPS:GPSTimeStamp Writing XMP-exif:GPSDateTime if tag exists Rewriting /home/me/test/panos/00000036.jpg... Editing tags in: APP0 APP1 File GPS IFD0 JFIF MIE-GPS XMP Creating tags in: APP1 File GPS IFD0 MIE-GPS JPEG APP0 (14 bytes): Rewriting JFIF Creating APP1: Creating IFD0 ExifByteOrder = MM + IFD0:XResolution = '72' (mandatory) + IFD0:YResolution = '72' (mandatory) + IFD0:ResolutionUnit = '2' (mandatory) + IFD0:YCbCrPositioning = '1' (mandatory) Creating GPS + GPS:GPSVersionID = '2 2 0 0' (mandatory) + GPS:GPSLatitudeRef = 'N' + GPS:GPSLatitude = '37 15 49.7102400000074' + GPS:GPSLongitudeRef = 'E' + GPS:GPSLongitude = '127 1 30.2570400000059' + GPS:GPSTimeStamp = '12 23 50' + GPS:GPSDateStamp = '2009:05:24' JPEG DQT (65 bytes): JPEG DQT (65 bytes): JPEG SOF0: JPEG DHT (29 bytes): JPEG DHT (70 bytes): JPEG DHT (27 bytes): JPEG DHT (68 bytes): JPEG SOS ======== /home/me/test/panos/00000061.jpg .....
P.S.: This CPAN forum software is the weirdest pice of shit of a forum software I have seen in years!
Direct Responses: 10978 | Write a response
Posted on 2009-06-16 17:24:11-07 by janmartin in response to 10816
Re: -geotag not working on jpg files extracted from .avi. Files incldued!
Hi,

it's me again, same problem as last time.
Can't believe it!

I try:
exiftool -v2 -geotag trk.gpx '-geotime<${FileModifyDate}-02:00' -P /pics


and get:
Loaded 1673 points from GPS track log file '/home/me/perl/gpx/rewe.log.gpx'
GPS track start: 2009:06:16 11:30:46 UTC
GPS track end: 2009:06:16 12:03:11 UTC
Writing File:Geotag
Setting new values from /home/me/perl/pics/00000015.jpg
Geotime value: 2009:06:16 09:33:30 UTC
Nothing changed in /home/me/perl/pics/00000015.jpg
======== /home/me/perl/pics/00000007.jpg
...

Ok, So I thought the
${FileModifyDate}-02:00
should take care of the 2 hours time zone difference of the pictures to the GPS UTC time.
Am I wrong?

I try
exiftool -s -time:all pics/00000015.jpg
and get:
FileModifyDate : 2009:06:16 11:33:30+02:00

So I started to experiment:

'-geotime<${FileModifyDate}-04:00' '-geotime<${FileModifyDate}-02:00' '-geotime<${FileModifyDate}-00:00' '-geotime<${FileModifyDate}-0:00' '-geotime<${FileModifyDate}+02:00' '-geotime<${FileModifyDate}+04:00'

but nothing works.

What's wrong again?
Is it really me?

Direct Responses: 10985 | Write a response
Posted on 2009-06-17 10:49:08-07 by exiftool in response to 10978
Re: -geotag not working on jpg files extracted from .avi. Files incldued!
It is superfluous to add a timezone to a date/time value which already contains a timezone. Your FileModifyDate is "2009:06:16 11:33:30+02:00", which converts to "2009:06:16 09:33:30 UTC". Quite simply, this is not inside the track. The only alternative is to shift the FileModifyDate before geotagging the image:

exiftool -filemodifydate+=2 /pics

- Phil
Direct Responses: Write a response