HydrogenAudio

Lossless Audio Compression => FLAC => Topic started by: cranesky on 2024-03-22 03:58:36

Title: The FLAC lossless audio is contained within an M4A file?
Post by: cranesky on 2024-03-22 03:58:36
The FLAC lossless audio is contained within an M4A file, is this normal?

I downloaded some Hires lossless (like 24/96) music files from Tidal, which are M4A files. My sony WM1Z cannot play them, file not supported.
When I put them in Foobar, I can see this:
X

So M4A file has a FLAC file in it as a container? Then I converted this M4A into FLAC via foobar, now my WM1Z finally can play it normally.

My confusions are:
1. Is this normal that Tidal uses M4A files to contain FLAC lossless files, and what for?
2. Actually, there is flac file inside the m4a file, but when I converted the m4a into flac via foobar, the file size still changes a little. Will the audio quality be negatively impacted by this conversion? Will it result in a decrease in the overall quality of the music?

Thanks a lot! because there are a lot lossless music contained in M4A format in Tidal, I really want to figure it out.
Title: Re: The FLAC lossless audio is contained within an M4A file?
Post by: itisljar on 2024-03-22 06:21:18
I didn't even know that mp4 container supports FLAC.
Title: Re: The FLAC lossless audio is contained within an M4A file?
Post by: Case on 2024-03-22 06:40:50
Audio quality won't be affected by the conversion. The size changes most because the audio is re-encoded from the decoded data using compression settings that you chose. Even without re-encoding size should decrease a bit because native FLAC container is more efficient than MP4. There can also be small size differences because metadata padding amount can change, Tidal would have no need to use padding but not sure if it does.
If you want to avoid re-encoding you can use for example ffmpeg to extract the FLAC as is. But according to my test the file extracted that way won't be bit-identical to what went in the container.
Title: Re: The FLAC lossless audio is contained within an M4A file?
Post by: ktf on 2024-03-22 10:55:41
I didn't even know that mp4 container supports FLAC.
Yes, there has been a formal specification (https://github.com/xiph/flac/blob/master/doc/isoflac.txt) and ffmpeg support since 2016, this has been formally registered (https://github.com/mp4ra/mp4ra.github.io/pull/147) in 2022 as part of the IETF FLAC spec RFC effort. You can find FLAC in this authorative list (https://mp4ra.org/registered-types/codecs).
Title: Re: The FLAC lossless audio is contained within an M4A file?
Post by: cranesky on 2024-03-25 02:58:04
I didn't even know that mp4 container supports FLAC.

not MP4, it is m4a. usually the container of AAC or ALAC from apple.
Title: Re: The FLAC lossless audio is contained within an M4A file?
Post by: cranesky on 2024-03-25 02:59:45
Audio quality won't be affected by the conversion. The size changes most because the audio is re-encoded from the decoded data using compression settings that you chose. Even without re-encoding size should decrease a bit because native FLAC container is more efficient than MP4. There can also be small size differences because metadata padding amount can change, Tidal would have no need to use padding but not sure if it does.
If you want to avoid re-encoding you can use for example ffmpeg to extract the FLAC as is. But according to my test the file extracted that way won't be bit-identical to what went in the container.

Thanks a lot! But it's not MP4, it is m4a. usually the container of AAC or ALAC from apple.
I hope the answer remains the same? lol
Title: Re: The FLAC lossless audio is contained within an M4A file?
Post by: Octocontrabass on 2024-03-25 03:56:05
But it's not MP4, it is m4a.
MP4 and M4A are the same thing.