Xml and Json options export only a single entry?

Started by IUDSSL, September 06, 2020, 12:00:45 PM

Previous topic - Next topic

IUDSSL

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.

StarGeek

From the docs on the -j (-json) option
   (-g4 may be used to ensure that all tags have unique JSON names.)

The -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.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

IUDSSL

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.

Phil Harvey

-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
...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 ($).