3 ms·
The key to understanding this issue seems to be "-movflags +faststart". The TLDR is that Apple apparently isn't "fast-starting" their MPEG-4 files before distri
by CharlesW 5y ago
The key to understanding this issue seems to be "-movflags +faststart". The TLDR is that Apple apparently isn't "fast-starting" their MPEG-4 files before distribution.
This became a thing when distributing QuickTime Movies on the internet became a thing (it's not an issue with random-access media), because one needed Movie metadata at the front of the file in order to support progressive playback. Because the MPEG-4 file format is effectively the QuickTime Movie file format, the need to put metadata at the front of the file continues if you want viewers/listeners to be able to play files as they're downloading.
That Apple isn't performing this extremely trivial pre-distribution process is extremely curious. It makes me wonder if this "common knowledge" was lost along the way, or if the people who would know this kind of super-obvious production step just aren't the same people in charge of Apple Music standards.
For anyone curious about what fast-start implementations look like:
https://github.com/FFmpeg/FFmpeg/blob/master/tools/qt-faststart.c https://github.com/FFmpeg/FFmpeg/blob/master/tools/qt-fastst...
https://github.com/kanongil/node-faststart https://github.com/kanongil/node-faststart
- thrdbndndn 5y agoWhat? Faststart just means the metadata is at the front of the file, which these 500KB padded m4a files do have. They just have excessive paddings between the metadata and the content stream. The author used this flag in FFMPEG because.. well, despite the main goal is to shrink the padding, you still want to have metadata at the beginning.
- CharlesW 5y ago> Faststart just means the metadata is at the front of the file, which these 500KB padded m4a files do have. You're correct in the sense that having metadata at the start of the file means that these files are ready for progressive download/playback, albeit with a chunk of unnecessary data transfer. But the other important part of the "faststart" process is that you get what used to be called a "flattened" file, where the data is contiguous — metadata is followed immediately by compressed media data. (Tools for QuickTime Movies also compressed the 'moov' header, but I'm not sure if that's supported in MPEG-4.)
- thrdbndndn 5y agoThe article already detailed why Apple (or most of AAC encoders) have this padding, and a reasonable amount of them are useful. They just need to be smaller. The author don't actually need it to be"contiguous"; it's just that FFMPEG stream copy is the easiest way to so. In this sense, Apple don't need to "flatten" their files, they just need to have smaller padding just as what iTunes is already doing when ripping user-provided CDs.
- CharlesW 5y agoI think we're talking about two different things. You're talking about the space reserved to allow for in-place metadata updates on songs that you've ripped. As you've noted, it's not much and doesn't "need" to be smaller. I and the TFA are talking about music files purchased from and delivered by the Apple Music Store, which include 500KB of wasted space. The solution the article suggests (and that I added a bit more background to in my post) is to do what any production workflow should do before distributing MPEG-4/Movie files — fast-start those suckers. 0.5 MB is not much, but multiplied by the billions of tracks Apple sells and streams in a year, pretty soon we're talking about a significant amount of wasted storage and transfer. > In this sense, Apple don't need to "flatten" their files, they just need to have smaller padding just as what iTunes is already doing when ripping user-provided CDs. What's the benefit to shipping any empty KBs with every song purchased or streamed?
- thrdbndndn 5y ago>What's the benefit to shipping any empty KBs with every song purchased or streamed? For (quicker) in-place metadata updates? You just said it. You can do so with the purchased music in iTunes. Not sure about the streaming services, but the article isn't about it at all (nor did it talk about if they actually have these 500 KB padding to begin with).
- CharlesW 5y ago> For (quicker) in-place metadata updates? I just tested this, and it takes about ~140ms for ffmpeg to faststart/remux one song-length .m4a file (M1 Air, internal storage).
- deleted 5y ago[deleted]