Bug 430684 - Renaming mp4 files - metadata fields have no values
Summary: Renaming mp4 files - metadata fields have no values
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: AdvancedRename-metadata (show other bugs)
Version: 7.2.0
Platform: Microsoft Windows Microsoft Windows
: NOR minor
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-21 23:31 UTC by maxwell.keeble
Modified: 2022-01-31 21:41 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description maxwell.keeble 2020-12-21 23:31:45 UTC
SUMMARY

Tagged mp4 files cannot be renamed using metadata options (e.g. [meta:Xmp.dc.title] [meta:Exif.Image.ImageDescription] [meta:Xmp.digiKam.TagsList]), though image formats work correctly.

STEPS TO REPRODUCE

1. Tag an mp4 file with tags, title or description.

2. Rename (F2) including those metadata fields, e.g. 

[date:"yyyy-MM-dd HH.mm.ss"] [meta:Xmp.dc.title] [meta:Exif.Image.ImageDescription] [meta:Xmp.digiKam.TagsList]

OBSERVED RESULT

Renamer's new name shows the fields as blank, e.g. 

2020-03-14 12.50.58   .mp4

where for images the options are replaced by the relevant metadata.

EXPECTED RESULT

Replace [meta:Xmp.dc.title] [meta:Exif.Image.ImageDescription] [meta:Xmp.digiKam.TagsList] in filename with relevant metadata field values.


SOFTWARE/OS VERSIONS

Digikam 7.2.0 beta 1
Windows: 10 19042

ADDITIONAL INFORMATION

This tool is incredibly powerful but this issue frustrates my personal use (where my files are a mix of images and mobile phone videos). If this cannot be resolved by anyone here due to low priority, but someone can signpost me to the relevant part of the code, I am happy to investigate/attempt to fix if I can.
Comment 1 Maik Qualmann 2020-12-22 07:03:49 UTC
This is basically normal behavior. Our library used to write metadata cannot do this in video files.

You can enable sidecar files (read and write to read-only files) in digiKam Metadata Setup.

If you don't want to have any additional files in the directory, you can use the database for renaming like [db: DefaultComment] for example. I see that the title and tag list are not available, we can change that.

Maik
Comment 2 Maik Qualmann 2020-12-22 20:10:17 UTC
Git commit e464667e8c283ff5a276de6918aa3aba66446dac by Maik Qualmann.
Committed on 22/12/2020 at 20:09.
Pushed by mqualmann into branch 'master'.

add title and tags list as database option for renaming
FIXED-IN: 7.2.0

M  +2    -1    NEWS
M  +15   -0    core/utilities/advancedrename/parser/options/database/keys/commonkeys.cpp

https://invent.kde.org/graphics/digikam/commit/e464667e8c283ff5a276de6918aa3aba66446dac
Comment 3 Maik Qualmann 2020-12-22 20:12:44 UTC
You can now rename your video files with "[date:"yyyy-MM-dd HH.mm.ss"] [db:Title] [db:DefaultComment] [db:TagsList]" without any problems.

Maik
Comment 4 maxwell.keeble 2020-12-22 23:27:16 UTC
Hi Maik - that's brilliant - many thanks for the quick work, this will resolve the issue for my workflow.
Comment 5 maxwell.keeble 2020-12-31 12:27:38 UTC
Hi Maik - I've tested this in beta 2 and [db:TagsList] behaves differently to [meta:Xmp.digiKam.TagsList]

Xmp.digiKam.TagsList gives the full tag hierarchy:

"Animal_Dog_Frankie Place_Park"

while db:TagsList gives only the specific tag:

"Frankie Park"

This probably makes perfect sense given how digiKam manages its tags in its database, versus how it stores them in XMP.

I'm not sure if there's a workaround, and it's not critical for my use case as it solves the mp4 issue, but thought I should flag it in case there's an issue with two metadata options with the same name behaving differently. 

Thanks again for the quick fix, and happy new year.
Comment 6 Maik Qualmann 2020-12-31 16:52:47 UTC
We can add another database option that also includes the full path. Then you have the choice.

Maik
Comment 7 Maik Qualmann 2020-12-31 17:08:01 UTC
Git commit 23b3d79b56568d9181da78199f4d1a41ff9f8c2f by Maik Qualmann.
Committed on 31/12/2020 at 17:07.
Pushed by mqualmann into branch 'master'.

add [db:TagsPathList] as database renaming option

M  +10   -0    core/utilities/advancedrename/parser/options/database/keys/commonkeys.cpp
M  +1    -1    core/utilities/advancedrename/parser/options/database/keys/metadatakeys.cpp
M  +1    -1    core/utilities/advancedrename/parser/options/metadataoption.cpp

https://invent.kde.org/graphics/digikam/commit/23b3d79b56568d9181da78199f4d1a41ff9f8c2f