Bug 485973 - Metadata (DateTimeOriginal) not read from MTS video files
Summary: Metadata (DateTimeOriginal) not read from MTS video files
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-ExifTool (show other bugs)
Version: 8.4.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-22 17:17 UTC by MarcP
Modified: 2024-04-26 05:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.4.0
Sentry Crash Report:


Attachments
Screenshot showing that digikam uses file modification date rather than exiftool's creation date. (426.07 KB, image/png)
2024-04-22 17:17 UTC, MarcP
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MarcP 2024-04-22 17:17:02 UTC
Created attachment 168809 [details]
Screenshot showing that digikam uses file modification date rather than exiftool's creation date.

SUMMARY
Hi. I noticed that the .MTS videos that my Sony camera films, when imported into Digikam, the creation date (dateTimeOriginal) is not read. Instead, the file modification date is used. I have attached a screenshot as a reference.


STEPS TO REPRODUCE
1. Import MTS video file
2. Check date of file in digikam
3. Check date of file in exiftool. 

OBSERVED RESULT
- Digikam uses modification date rather than date in the metadata.

EXPECTED RESULT
The date in the metadata should be used instead.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma:  Kubuntu 22.04 LTS
digiKam-8.4.0-20240421T104710-Qt6-x86-64.appimage
Comment 1 Maik Qualmann 2024-04-22 18:29:01 UTC
digiKam definitely reads the video’s metadata. Here the metadata appears to be in an H264 container. Can you please send me a very short sample video? It's best to film a local digital clock.

Maik
Comment 2 MarcP 2024-04-22 22:00:24 UTC
Here's the link to a sample MTS file I recorded earlier today: 
http://158.101.198.126:9011/share/Hd_I2d7r

Let me know if the download doesn't work for you and I'll use a less exotic sharing method.
Comment 3 Maik Qualmann 2024-04-23 06:19:02 UTC
Git commit 7e0b4d0db8c5c156cad7a3ab5bb04dc76343c2c1 by Maik Qualmann.
Committed on 23/04/2024 at 06:17.
Pushed by mqualmann into branch 'master'.

use excludet metadata from ExifTool if the FFmpeg parser found none

M  +4    -3    core/libs/metadataengine/engine/metaengine.cpp

https://invent.kde.org/graphics/digikam/-/commit/7e0b4d0db8c5c156cad7a3ab5bb04dc76343c2c1
Comment 4 Maik Qualmann 2024-04-23 06:23:49 UTC
A re-read of the metadata will now provide the correct date. I'm just not quite sure if it fits with the time zone. Please test it with the next available AppImage.

Maik
Comment 5 Maik Qualmann 2024-04-25 19:28:43 UTC
A new digiKam-8.4.0 AppImage is available, can you please check the creation date with the MTS video files.

Maik
Comment 6 MarcP 2024-04-25 20:12:47 UTC
Great! I'll test it in a couple hours when I get home.
Comment 7 MarcP 2024-04-25 23:27:48 UTC
Hi Maik, I can confirm it's working perfectly now. Thanks!
Comment 8 MarcP 2024-04-25 23:44:52 UTC
Another thing I noticed, is that even if that DateTimeOriginal date is in the exif info, I can´t edit it using the Edit Metadata tool. Not sure if it's related.
Comment 9 MarcP 2024-04-25 23:55:42 UTC
I just tested using exiftool to change the date, and I get the following error:

"Error: Writing of MTS files is not yet supported". https://exiftool.org/commentary.html#AVCHD

So I guess I'll have to use sidecars for MTS files then.
Comment 10 Maik Qualmann 2024-04-26 05:57:20 UTC
Another note, the metadata that you see for video files in the metadata viewer for Exif/IPTC and XMP are mostly virtual and interpreted to make them usable for digiKam. Video files do not contain Exif or IPTC metadata. ExifTool itself only writes XMP (possibly a QuickTime container) into video files.
To change the dates in video files, the option to change the timestamps with ExifTool should be used in the Time Adjust Tool. Of course, this assumes ExifTool supports this video format.

Maik