Bug 436876 - Cannot write exif data to mp4 video files with Exiv2 - Use ExifTool instead
Summary: Cannot write exif data to mp4 video files with Exiv2 - Use ExifTool instead
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-ExifTool (show other bugs)
Version: 7.2.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-10 15:53 UTC by Ritesh Raj Sarraf
Modified: 2022-04-08 04:39 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 8.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ritesh Raj Sarraf 2021-05-10 15:53:43 UTC
SUMMARY

Digikam reports that:

Digikam::MetaEngine::Private::printExiv2ExceptionError: Cannot save metadata to image using Exiv2   (Error # 11 :  "/media/SSHD/.Pictures/Processed/rmi-note-6/VID_20210419_211910.mp4: The file contains data of an unknown image type"


But the fact remains that I can manually add exif data to an mp4 file using something like the following command:

exiftool -overwrite_original -tagsFromFile "$line" -All:All "$line"".converted.mp4"
Comment 1 Ritesh Raj Sarraf 2021-05-10 16:07:34 UTC
It could possibly be that the Facial Recognition library detects the faces in video files too, but is not able to write facial data to the file.

I don't know how it is supposed to write but in a generic term, using a free flow field, it should be possible to write the exif data. And then other tools (like Digikam) can parse that special header and interpret the data as Facial Data for a Video File.
Comment 2 caulier.gilles 2021-05-10 16:30:34 UTC
Se bug #366348. Using ExifTool to write metadata in video and RAW is planed later 7.3.0.

Gilles Caulier
Comment 3 caulier.gilles 2022-04-07 04:59:37 UTC
Git commit 3a672f38cda7738356f19707a6a634ca91c269e6 by Gilles Caulier.
Committed on 07/04/2022 at 04:45.
Pushed by cgilles into branch 'master'.

Write metadata with ExifTool backend if Exiv2 fails to process, for exemple with RAW files or Video files.
Tested successfuly with a MP4 video to insert a comment.
For RAW and other king of files as MPO or JPEG with more than 64kB of Exif segement, Exiv2 must be bannned to uses in cases of writting operations as files can be corrupted.
This require more regression tests to validate ExifTool uses in place of Exiv2.
Related: bug 406540, bug 416516, bug 237504, bug 384092, bug 264210, bug 326408, bug 421464, bug 134486, bug 309341, bug 219856, bug 377622, bug 325458, bug 170693, bug 448729, bug 338075, bug 366348

M  +1    -0    core/libs/metadataengine/dmetadata/dmetadata.h
M  +43   -0    core/libs/metadataengine/dmetadata/dmetadata_exiftool.cpp
M  +49   -3    core/libs/metadataengine/dmetadata/dmetadata_fileio.cpp
M  +2    -2    core/libs/metadataengine/exiftool/exiftoolparser.h

https://invent.kde.org/graphics/digikam/commit/3a672f38cda7738356f19707a6a634ca91c269e6
Comment 4 caulier.gilles 2022-04-08 04:39:25 UTC
Git commit 6336a52c7f84795e15e7aa9849f668f4a64dd93c by Gilles Caulier.
Committed on 08/04/2022 at 04:38.
Pushed by cgilles into branch 'master'.

Check target file name properly when writing metadata with ExifTool
FIXED-IN: 8.0.0

M  +14   -13   core/libs/metadataengine/dmetadata/dmetadata_exiftool.cpp

https://invent.kde.org/graphics/digikam/commit/6336a52c7f84795e15e7aa9849f668f4a64dd93c