ExifTool Forum

ExifTool => Developers => Topic started by: Aarto on June 09, 2025, 03:10:11 PM

Title: Developer needed - Mass import of metadata in JSON format to original files
Post by: Aarto on June 09, 2025, 03:10:11 PM
Hello!
I hope this post is allowed in the forum

I am willing to pay for someone to create a solution to convert .JSON metadata from QNAP Qumagie export .JSON files to the actual files.  I just do not feel safe having all the metadata in database only (Qumagie does not update the files if you change date taken or ratings etc.)
I just do not have the time to do this myself, time is money also for me

.JSON files from QNAP Qumagie metadata export are created in folder structure like this
/share/Famiglia/Uploaded/.@__thumb
One .JSON for each photo/video file in the parent folder

Examples:
.JSON for MP4
/share/Famiglia/Uploaded/Aarto/.@__thumb/20250607_155240.mp4.json

{
    "MediaType": "video",
    "Path": "/share/Famiglia/Uploaded/Aarto/20250606_231010.mp4",
    "Title": "20250606_231010",
    "Comment": "null",
    "Keywords": "Karaoke;Home;Denmark;Nick;Singing",
    "ColorLevel": "0",
    "Longitude": "12.374200",
    "Latitude": "55.730900",
    "Time": "2025-06-06 23:10:22",
    "Favorite": "0",
    "Rating": "1",
    "Objects": [{
            "object": {
                "id": "GtDVc0",
                "name": "Person"
            }
        }
    ],
    "Faces": [{
            "face": {
                "name": "Naa",
                "FaceId": "9I9lmI",
                "X": "1376",
                "Y": "725",
                "Width": "385",
                "Height": "531",
                "GroupId": "QdF0MY",
                "iFaceCover": "RRoMCG"
            }
        }, {
            "face": {
                "name": "---",
                "FaceId": "lbsZeh",
                "X": "998",
                "Y": "714",
                "Width": "400",
                "Height": "497",
                "GroupId": "u_kXJnnQ",
                "iFaceCover2": null,
                "iFaceCover": "lbsZeh"
            }
        }
    ],
    "Albums": [],
    "Qtag": "601871622cfe4285b3b62c28f833165f245ebe8d62fd",
    "DataVersion": "1.0"
}

.JSON for JPG
/share/Famiglia/Uploaded/Aarto/.@__thumb/20250608_180152.jpg.json
{
    "MediaType": "photo",
    "Path": "/share/Famiglia/Uploaded/Aarto/20250608_180152.jpg",
    "Title": "20250608_180152",
    "Comment": "null",
    "Keywords": "Highscore;Fields;Play;Denmark;Nick",
    "ColorLevel": "0",
    "Longitude": "12.578753",
    "Latitude": "55.629697",
    "Time": "2025-06-08 18:01:52",
    "Favorite": "0",
    "Rating": "1",
    "Objects": [],
    "Faces": [{
            "face": {
                "name": "Nick",
                "FaceId": "WXY397",
                "X": "1740",
                "Y": "828",
                "Width": "375",
                "Height": "502",
                "GroupId": "2wxoEx",
                "iFaceCover": "k2jHff"
            }
        }
    ],
    "Albums": [],
    "Qtag": "7930bdde1ab5417890f88809b13cb00b245ebe8d62fd",
    "DataVersion": "1.0"
}

Actual files are stored here (in parent folder)
/share/Famiglia/Uploaded/Aarto20250607_155240.mp4
/share/Famiglia/Uploaded/20250608_180152.jpg

I would ask someone to write a script for me to update the atcual files with the metadata from .JSON files
.mp4 -> Keywords like "Keywords":"Karaoke;Home;Denmark;Nick;Singing" from JSON to "Tags" in file
.MP4 -> "Time":"2025-06-06 23:10:22"  to ITPC/XMP "Media Created" in file
.MP4 -> "Rating":"1"  to ITPC/XMP "Rating" in file
.MP4 -> Geo coordinates whereever these are supposed to go

.JPG -> Keywords like "Keywords":"Highscore;Fields;Play;Denmark;Nick"  from JSON to "Tags" in ITPC of the file
.JPG -> "Time":"2025-06-06 23:10:22"  to ITPC/XMP "Date taken" in ITPC of the file file
.JPG -> "Rating":"1"  to ITPC/XMP "Rating" in ITPC of the file
.JPG -> Geo coordinates whereever these are supposed to go

.MOV/PNG support - Not really needed

Special conditions
.JSON may exist but not the jpg/MP4. This is perfectly fine, just continue to next

Should be able to run this for all files/subfolder under the main parent folder (recursively) in one run

Shuold have an option to (praameter driven) to "touch" the file so it can be automatically reindexed (date/time udpated) i.e update date/time updated of the .jpeg/mp4 file

If people/face data can be supported for JPG  and MP4 (Ofcourse i understand the Qumagie faceID is no possible but something that is more "standard")  that would be an added bonus. Examples of people data are in the .JSON data above (i have no idea what possibilities there are when it comes to face tags in ITPC/XMP)

The target system is QNAP NAS running QTS so essetially Linux. 

Command line of graphical interface, all the same to me

I will not reserve any rights to the code if the price is "reasonable".  The invoice will be paid by my company registered in Denmark and will be 50% upfront, 50% at completion or as negotiated

End target: To have a possibility to import the photos/videos to another management system which can import ITPC/XMP data

Please send me a message or reply here if this is something that is doable and with estimated price.  This is not something that i am in a hurry to do but will need to complete this within a month or so to have peace of mind :-)

With kind regards
Aarto

Title: Re: Developer needed - Mass import of metadata in JSON format to original files
Post by: Phil Harvey on June 09, 2025, 03:26:19 PM
Hi Aarto,

Writing keywords/time/rating is trivial.  The only question is exactly where do you want them written.  Writing face information is certainly possible as well, but with a bit more effort.

The basic command would be:

exiftool -ext jpg -ext mp4 -tagsfromfile "%d/.@__thumb/%f.%e.json" "-subject<keywords" -sep ";" "-createdate<time" "-rating<rating" -r DIR

The file is touched on writing by default.  Add -P to preserve the original date/time, and -overwrite_original to avoid saving the "_original" backups.

- Phil
Title: Re: Developer needed - Mass import of metadata in JSON format to original files
Post by: Aarto on June 09, 2025, 03:36:20 PM
Quote from: Phil Harvey on June 09, 2025, 03:26:19 PMHi Aarto,

Writing keywords/time/rating is trivial.  The only question is exactly where do you want them written.  Writing face information is certainly possible as well, but with a bit of effort.

The basic command would be:

exiftool -ext jpg -ext mp4 -tagsfromfile "%d/.@__thumb/%f.%e.json" "-subject<keywords" -sep ";" "-createdate<time" "-rating<rating" -r DIR

- Phil

Thanks Phil and i really appreciate your work
However, it is the Script of the same which i really need help with (like a script or something) and as i'm always willing to pay my way, i will also do the same here instead of asking for help and work on the automation part for hours..  I am not well versed with Linux and feel like this is a win-win situation :-)
And the faces/people metadat would be a bonus, i have no idea (yet) where i will omport the photos/videos next
Aarto