Handling of foreign metadata in flac ( / metaflac); suggestion to retain upon decoding and optionally allow deletion upon re-encoding
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 2.4k
- Forks
- 363
- PR merge metrics
- No merged PRs in 30d
Description
Feature cleanup "wish", with whatever priority should be assigned to foreign metadata handling at the 1.5 stage. Myself I think that it is not at the core of what FLAC is about.
- Encoding. There is issue #680. Could there be a way to verify that the foreign metadata actually is in restorable form? The time it takes is hardly any object (compared to say -V), but the question on whether to repair odd-bytesize chunks does remain.
- Decoding: if a .flac file was generated with foreign metadata stored in it, then presumably the purpose is to restore it. That suggests that decoding should default to keeping if present. A potential is that users might discover that a file of theirs does suddenly decode to .aiff, but how often will that be contrary to intention?
- Re-encoding: as far as I can see, there is no way within flac to remove the foreign metadata from a .flac file except by decoding and encoding, losing tags too. --no-keep-foreign-metadata does nothing upon re-encoding, and you could consider to change that? Surely you can say it is a job for metaflac, but:
- metaflac has no real provision for deleting only the APPLICATION blocks that are foreign metadata - except through inspecting them and selecting precisely the right ones?
So a way out of it for the flac tool, could be to have --keep-foreign-metadata(-if-present) verify the metadata upon encoding; to have decoding (only!) use --keep-foreign-metadata-if-present by default; and for re-encoding, to allow --no-keep-foreign-metadata to delete these particular blocks? The latter must be much simpler than using metaflac?
And despite the worry over running out of letters: "--keep-foreign-metadata-if-present" is a cumbersome way around not wanting to change how --keep-foreign-metadata behaves as errors go.
"-k"? (Question is then, should it take a parameter, determining how it should handle this or that? -k 0 for kill, k 1 for keep but err out if not, -k 2 for repair what can be repaired ... or, that depends on whether you will allow non-compliant metadata to be restored verbatim with warts and all, which maybe is even more worrisome if decoding defaults to keeping.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The proposal concerns the flac and metaflac tools, covering foreign metadata during encoding, decoding, and re-encoding; issue #680 is also relevant. Start by reviewing the existing foreign-metadata behavior and the questions raised in #680. Done requires an agreed, implemented policy for verification, preservation, and deletion of these metadata blocks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- audio-video-rtc
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100