ExifTool Forum

ExifTool => Newbies => Topic started by: IUDSSL on September 06, 2020, 12:00:45 PM

Title: Xml and Json options export only a single entry?
Post by: IUDSSL on September 06, 2020, 12:00:45 PM
Hi,

I'm a newbie working on extracting GPS data from a dashcam (.MOV) file. I learnt the basic export ( exiftool.exe -ext mov -ee FILE ), and managed to get all the GPS tags in FILE this way. But if I specify the -X or -j, the XML or JSON exports give only a single GPS entry in FILE. Is there another option that I have missed to get all GPS entries in XML or JSON formats?

Thanks,
IDS.
Title: Re: Xml and Json options export only a single entry?
Post by: StarGeek on September 06, 2020, 12:42:23 PM
From the docs on the -j (-json) option (https://exiftool.org/exiftool_pod.html#j-JSONFILE--json)
   (-g4 may be used to ensure that all tags have unique JSON names.)

The -X (-xmlFormat) (https://exiftool.org/exiftool_pod.html#X--xmlFormat) is different.  In that case the relevant info is
   Another restriction of -s is that only one tag with a given group and name may appear in the output.

So, add -g4 to the json command and remove -s from the xml command.
Title: Re: Xml and Json options export only a single entry?
Post by: IUDSSL on September 06, 2020, 01:56:25 PM
Hi,

-g4 with -j did the trick. The XML one didn't quite work, but I'm OK with the JSON output for the moment.

Thanks,
IDS.
Title: Re: Xml and Json options export only a single entry?
Post by: Phil Harvey on September 08, 2020, 07:40:35 AM
-X should have worked:

> exiftool test.mp4 -ee -X -gpslatitude
<?xml version='1.0' encoding='UTF-8'?>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>

<rdf:Description rdf:about='../testpics/gps_video/70mai.mp4'
  xmlns:et='http://ns.exiftool.ca/1.0/' et:toolkit='Image::ExifTool 12.06'
  xmlns:QuickTime='http://ns.exiftool.ca/QuickTime/QuickTime/1.0/'>
<QuickTime:GPSLatitude>56 deg 9&#39; 57.90&quot; N</QuickTime:GPSLatitude>
<QuickTime:GPSLatitude>56 deg 9&#39; 57.72&quot; N</QuickTime:GPSLatitude>
<QuickTime:GPSLatitude>56 deg 9&#39; 57.54&quot; N</QuickTime:GPSLatitude>
<QuickTime:GPSLatitude>56 deg 9&#39; 57.42&quot; N</QuickTime:GPSLatitude>
[...]
<QuickTime:GPSLatitude>56 deg 10&#39; 6.00&quot; N</QuickTime:GPSLatitude>
<QuickTime:GPSLatitude>56 deg 10&#39; 6.00&quot; N</QuickTime:GPSLatitude>
</rdf:Description>
</rdf:RDF>


- Phil