Bug 459898

Summary: Import video files into digiKam uses current date but not metadata date.
Product: [Applications] digikam Reporter: georg.lipps
Component: Import-PostProcessingAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: caulier.gilles, metzpinguin
Priority: NOR    
Version: 7.9.0   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed In: 8.0.0
Attachments: screenhot digikam

Description georg.lipps 2022-10-01 16:55:04 UTC
STEPS TO REPRODUCE
1.  Drag video file (MTS, mp4) into digikam
2. 
3. 

OBSERVED RESULT
Time Stamp is current date/time

EXPECTED RESULT
Please use metadata to set date/time (best solution) of file modified or file original date.

The video data directly from the camera has a huge file size. Upon encoding a new file with another date is generated. Thus using the file dates is problematic. 

The correct date is however found in the field DateTimeOriginal.


SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Ubuntu 22.04


ADDITIONAL INFORMATION

Please see attachment: Video (MTS) and picture (ARW) were taken on same day. Filename (with date time information incorporated) is correct, File properties also correct. But in preview window the wrong date is shown 16.01.22 for the video but not the picture.
Comment 1 Maik Qualmann 2022-10-01 17:06:57 UTC
digiKam uses the date in the video file if it exists, a sample video is required.

Maik
Comment 2 georg.lipps 2022-10-02 08:59:20 UTC
Created attachment 152544 [details]
screenhot digikam
Comment 3 georg.lipps 2022-10-02 09:06:30 UTC
Sorry the video file is too large. I sent by email directly.

The video was taken yesterday evening  (1.10.22) with the camera and was transferred today (2.10.22) to the computer. It was then dragged into digikam (see attachment 152544 [details], upper part). In preview window the date from today is shown.

The procedure was repeated with the import function directly from the camera. During import the correct date for the folder is selected and the file name is set correctly. But in the preview window we still have the date from today (see attachment lower part)

File properties are as follows:

georg@InaUbuntu:~/Schreibtisch/TEST$ ls -ltr 00069.MTS 
-rwxrwxrwx 1 georg georg 9142272 Okt  1 22:22 00069.MTS
georg@InaUbuntu:~/Schreibtisch/TEST$ exiftool -time:all 00069.MTS 
File Modification Date/Time     : 2022:10:01 22:22:17+02:00
File Access Date/Time           : 2022:10:02 10:29:20+02:00
File Inode Change Date/Time     : 2022:10:02 10:29:03+02:00
Date/Time Original              : 2022:10:01 20:22:14+02:00 DST
georg@InaUbuntu:~/Schreibtisch/TEST$ 

(Sorry for the missing code block - how is that done?)
Comment 4 Maik Qualmann 2022-10-02 15:31:19 UTC
Thanks for the test video. Yes, our favorite FFmpeg metadata parser doesn't find the date in the video. Here with digiKam-8.0.0 there is also an ExifTool parser available and this would find the date.

Maik
Comment 5 Maik Qualmann 2022-10-02 15:52:44 UTC
Git commit a53fa89477597ae96246141cb700d7f7f55e2fb5 by Maik Qualmann.
Committed on 02/10/2022 at 15:51.
Pushed by mqualmann into branch 'master'.

fall back to ExifTool parser if no valid date is present
The date of a video file is an important piece of metadata.
FIXED-IN: 8.0.0

M  +1    -1    NEWS
M  +1    -1    core/libs/metadataengine/dmetadata/dmetadata_fileio.cpp

https://invent.kde.org/graphics/digikam/commit/a53fa89477597ae96246141cb700d7f7f55e2fb5
Comment 6 Maik Qualmann 2022-10-03 06:14:58 UTC
Git commit fea2a72f7f1bb6957638b741489b226537e50e92 by Maik Qualmann.
Committed on 03/10/2022 at 06:12.
Pushed by mqualmann into branch 'master'.

merge metadata from FFMpeg and ExifTool for video
Related: bug 432369, bug 459928

M  +1    -1    core/libs/metadataengine/dmetadata/dmetadata.h
M  +9    -2    core/libs/metadataengine/dmetadata/dmetadata_exiftool.cpp
M  +11   -4    core/libs/metadataengine/dmetadata/dmetadata_fileio.cpp
M  +59   -0    core/libs/metadataengine/engine/metaengine.cpp
M  +7    -0    core/libs/metadataengine/engine/metaengine.h

https://invent.kde.org/graphics/digikam/commit/fea2a72f7f1bb6957638b741489b226537e50e92
Comment 7 georg.lipps 2022-10-03 17:17:27 UTC
Thanks!