Error extracting tags for video

182 views
Skip to first unread message

Sian Green

unread,
Sep 4, 2020, 10:21:56 AM9/4/20
to camtrapR
Hello,

I have a data set comprising of both photos and videos that I have tagged in digikam. I have been able to use recordTable in camtrapR to extract metadata for my images with no problems however when I modify the code for video it does not work. Is there something I am missing?

This is the code I am trying to use for video

rec.db.speciesvideo <- recordTable(inDir  = wd_vids_ID,
                                   IDfrom = "metadata",
                                   metadataSpeciesTag = "Species",
                                   removeDuplicateRecords = FALSE,
                                   video  = list(file_formats = "mp4",
                                                 dateTimeTag  = "QuickTime:CreateDate",
                                                 db_directory = "C:/Users/Sian/Pictures",
                                                 db_filename = "digikam4.db"),
                                   writecsv = TRUE)

But the error I am getting is "metadataspeciestag 'Species' not found in image metadata tag 'HierarchicalSubject'. Skipping.

I have tagged both photos and videos in the same way and using the same tag tree in digikam. Could it be a problem with reading the database as I know the video data is read straight from there? This is the only difference I can think of compared to the photos. Do you know if there is a way to fix this?

Best wishes
Sian

Juergen Niedballa

unread,
Sep 8, 2020, 6:42:49 AM9/8/20
to camtrapR
Hi Sian, 
it should be a warning for a specific station, and not an error. Basically informing you that at a specific station not a single item (no mp4 file in your case) had a species tag assigned, and that that station will therefore be omitted. Normally, if only a single file has a species tag, the warning should not appear for a particular station.
Do you get the warning for all station directories or some only? And is there any function output or does it fail altogether (in that case, what is the error message)?

And can you confirm that you did assign species tags to the mp4 files in the specific directory / directories stated in the warning?

Thank you,
Jürgen

Sian Green

unread,
Sep 8, 2020, 9:38:24 AM9/8/20
to camtrapR
Hi Jürgen,

Yes, sorry, this warning comes up for every station in that directory (my photos are in a separate directory). There is no output at the end and this is the error message shown:

Error: something went wrong. I looked through all those 74 folders and now your table is empty. Did you exclude too many species? Or were date/time information not readable?

I have assigned species tags to all the videos but attached a screen shot of my digikam tag set-up in case there is something I have done wrong there

Best wishes

Sian

digikam_screen.png

Juergen Niedballa

unread,
Sep 8, 2020, 10:40:04 AM9/8/20
to camtrapR
Hi Sean,
the screenshot looks good from what I can tell. Is it digiKam 6.0.0 or higher? Videos are only supported from 6.0.0. But seeing thumbnails I guess that's the case. 
Since you can extract image metadata normally I'd assume the digiKam database is set up properly too.

So now it gets a little complicated, since it is hard to diagnose without running the internal functions of camtrapR that access the digiKam database. 
If you're ok with it and if the digikam4.db file is not too big, you could share a copy of the file with me through dropbox or GDrive and I will try to run the relevant functions to see where it goes wrong (you can email me the link to keep it confidential). 
Would that work for you?

Otherwise, if you are quite comfortable in R, you could also try running these two internal functions:
processVideoArgument and addVideoHierarchicalSubject
(see here for source code and here for how they work together in recordTable).

Otherwise, feel free to email me.
Best regards,
Jürgen
Reply all
Reply to author
Forward
0 new messages