Has anyone wrote a script that writes any info to sidecar?

Andrey Goreev aegoreev at gmail.com
Mon May 29 16:36:06 BST 2017


Hello,

Thank you all for your earlier responses.

Here is how I transfer xyz(c) coordinates writen into video files to
digiKam database so far:
https://youtu.be/QpBJaSIPMCk

The "Copy GPS to clipboard script" reads the coordinates using mediainfo
and converts them from something like this:
©xyz                                     : +50.9003-114.0125/
to something like this:
geo:50.900300000,-114.012500000
Then I select the video in digikam, press Ctrl + Shift + G (for some reason
you can only see "G" on the video) and paste the coordinates.
Works as a charm but it is not automated.

Next step would to automate this process which means the scipt would read
the xyz(c) tag using mediainfo and write it to the sidecarfile.

Sidecar looks like this:

<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2">
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:Description rdf:about=""
    xmlns:xmp="http://ns.adobe.com/xap/1.0/"
    xmlns:exif="http://ns.adobe.com/exif/1.0/"
    xmlns:tiff="http://ns.adobe.com/tiff/1.0/"
   xmp:CreatorTool="digiKam-5.6.0"
   exif:GPSLatitudeRef="N"
   exif:GPSLongitudeRef="W"
   exif:GPSVersionID="2.0.0.0"
   exif:GPSLatitude="50,54.0180000N"
   exif:GPSLongitude="114,0.7500000W"
   exif:GPSMapDatum="WGS-84"
   tiff:Software="digiKam-5.6.0"/>
 </rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>

As you see, the coordinates will need to be converted again.

Actually exiftool is able to see more GPS tags written to file and they
look more similar to what digiKam is expecting to see in XMP:
...
[QuickTime]     GPSCoordinates                  : 50 deg 54' 1.08" N, 114
deg 0' 45.00" W
...
[Composite]     GPSLatitude                     : 50 deg 54' 1.08" N
[Composite]     GPSLongitude                    : 114 deg 0' 45.00" W
...
[Composite]     GPSPosition                     : 50 deg 54' 1.08" N, 114
deg 0' 45.00" W
...

Do you think that will be easy to accomplish?

So far  tried inserting:
   exif:GPSLatitudeRef="N"
   exif:GPSLongitudeRef="W"
   exif:GPSVersionID="2.0.0.0"
   exif:GPSLatitude="50,54.0180000N"
   exif:GPSLongitude="114,0.7500000W"
   exif:GPSMapDatum="WGS-84"
to an XMP file but digiKam did not recognize it.


Best regards,

On Tue, May 16, 2017 at 1:10 AM, Mica Semrick <mica at silentumbrella.com>
wrote:

> I'd be happy to help with the XML/XMP part of this; XML startlet is your
> friend.
>
> Find the tags you need using mediainfo and which XMP tags you want to
> write and let us know.
>
> -m
>
> On May 15, 2017 3:14:38 PM PDT, aegoreev at gmail.com wrote:
>>
>> Hello,
>>
>> I am thinking of writing a script that would read GPS coordinates from a video
>> file using mediainfo and paste them to xmp sidecar for digiKam to be able to
>> read.
>> I am looking for a starting point. Does anyone have a script that writes
>> something in a text file?
>>
>> I will probably be using MediaInfo to read the coordinates.
>>
>> mediainfo FILE | grep "©xyz" | head -n 1
>>
>> Thank you in advance for any ideas.
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/digikam-users/attachments/20170529/bb739c23/attachment.html>


More information about the Digikam-users mailing list