-----Original Message----- From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Gerion Entrup Sent: Mittwoch, 9. April 2025 00:18 To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [RFC] AVDictionary2
Am Dienstag, 8. April 2025, 22:29:37 Mitteleuropäische Sommerzeit schrieb Michael Niedermayer:
On Tue, Apr 08, 2025 at 11:10:21AM -0500, Romain Beauxis wrote:
Le mar. 8 avr. 2025 à 05:20, Michael Niedermayer <michael@niedermayer.cc> a écrit : [...] * Any interest in storing multiple values for the same key? This seems like a niche case but, as you pointed out in another thread, typically vorbis metadata do allow multiple key/values for the same field.
For a single key multiple values should not be stored You can do Author1=Eve Author2=Adam or Author=Adam and Eve
But dont do Author=Eve Author=Adam because if you do that and then you get later a Author=Lilith what does that mean? that its now 1 Author or 3 Authors or 2 and if 2 then which 2 ?
Or said another way, you cant have multiple identical keys like that AND allow updates.
AFAIK, Matroska also has Metadata that are explicitly a tree and can have the same key. A good example is the ACTOR tag: Most movies have more than one actor, the CHARACTER should be a subtag of ACTOR [1]. Currently, FFmpeg just seem to ignore keys with multiple values and display the first.
An AVDictionary can support duplicate keys via AV_DICT_MULTIKEY flag, but as Michael had pointed out, this gets messy. Whether such multiple key entries are displayed anywhere depends on the implementation. ID3v2 tags can be multi-valued as well, in which case the values are null-separated. In my patchset [1] enabling support for that, I'm not adding duplicate keys but appending values separated by semicolons, because that's how most audio tagging apps are presenting it (or even supporting this as input and saving that with null-separation eventually. sw [1] https://github.com/ffstaging/FFmpeg/pull/54/files#diff-e6bc3ebad40a50e6eed63...