HydrogenAudio

Lossless Audio Compression => FLAC => Topic started by: BongMixtape on 2021-04-05 21:19:54

Title: FLAC APPLICATION metadata block
Post by: BongMixtape on 2021-04-05 21:19:54
Hey everyone,
has anyone been successful in adding files to flac's APPLICATION metadata block?
it would be very useful do embed a zip file containing all scans instead of adding multiple images on the PICTURE block.

I have found two apps that can do that, but they don't have a windows executable pre-compiled.
I created a repository for them, since the original site isn't available anymore:
https://github.com/bongmixtape/flac-image
https://github.com/bongmixtape/FlacFile

I've tried to compile them myself, but with no success.
If anyone could compile them for windows, I would be immensely grateful.
Title: Re: FLAC APPLICATION metadata block
Post by: lvqcl on 2021-04-06 16:59:48
it would be very useful do embed a zip file containing all scans instead of adding multiple images on the PICTURE block.

What if the size of this .zip file exceeds 16 MBytes?
Title: Re: FLAC APPLICATION metadata block
Post by: BongMixtape on 2021-04-06 17:16:23
What if the size of this .zip file exceeds 16 MBytes?

That wouldn't be a problem.
for what I understand, this size limitation is only on the PICTURE metadata block, that each image can have a maximum of 16 Mb.
For the APPLICATION block, I couldn't find any limitation of size in the documentation
Title: Re: FLAC APPLICATION metadata block
Post by: danadam on 2021-04-06 20:24:17
for what I understand, this size limitation is only on the PICTURE metadata block, that each image can have a maximum of 16 Mb.
For the APPLICATION block, I couldn't find any limitation of size in the documentation
Length field in METADATA_BLOCK_HEADER (https://xiph.org/flac/format.html#metadata_block_header) is 24 bit, so the 16 MB limit applies to all block types.
Title: Re: FLAC APPLICATION metadata block
Post by: BongMixtape on 2021-04-06 20:56:25
Length field in METADATA_BLOCK_HEADER (https://xiph.org/flac/format.html#metadata_block_header) is 24 bit, so the 16 MB limit applies to all block types.

Damn, that sucks.
It could still be useful though if you compress the scans. Some albuns can have a dozen or more images including the leaflet pages.
If you used webp compression for example, or even pdf's - it can save a lot of time being able to store any file extension.
Title: Re: FLAC APPLICATION metadata block
Post by: Porcus on 2021-04-06 21:31:46
If all you got are a bunch of pictures, then embed as art if you want anything to be able to read it.

If you want an attachment - like, a .pdf file that has value in its own right - then you might want to use some kind of container that can contain both the flac stream and the .pdf. You are trying to do this with flac's native container, but that is not a very compatible solution. Probably better are

* the file system's own container ... the directory. Cons: not well treated as "file".
(Let's not hack into alternative data streams eh?)

* .zip/.rar/.7z with the .flac and the .pdf. Cons: You need an audio player that can open an archive and look inside.

* check if for example Matroska (https://www.matroska.org/technical/attachments.html) gives you better luck. Cons: no flac file if you want flac.
Title: Re: FLAC APPLICATION metadata block
Post by: BongMixtape on 2021-04-06 21:48:50
If all you got are a bunch of pictures, then embed as art if you want anything to be able to read it.

If you want an attachment - like, a .pdf file that has value in its own right - then you might want to use some kind of container that can contain both the flac stream and the .pdf. You are trying to do this with flac's native container, but that is not a very compatible solution. Probably better are

* the file system's own container ... like a directory. Cons: not well treated as "file".

* .zip/.rar/.7z with the .flac and the .pdf. Cons: You need an audio player that can open an archive and look inside.

* check if for example Matroska (https://www.matroska.org/technical/attachments.html) gives you better luck. Cons: no flac file if you want flac.

I know that it's an unconventional solution, but I already tried all of the lossless formats, and although I admit that Matroska is the most flexible container, it's the worst, by far, to tag the files, do maintenance and compatibility.
Matroska uses xml for tagging and I've encountered all types of playback and metadata issues on different software and conversion to lossy formats to use on mobile while keeping the metadata is also a headache.
SimplePortal 1.0.0 RC1 © 2008-2021