5 ms·
Interesting. I feel like the code could be simplified and be a lot more resistant to YouTube changes by just using yt-dlp, and selecting (or automatically extra
by makeworld 5y ago
Interesting. I feel like the code could be simplified and be a lot more resistant to YouTube changes by just using yt-dlp, and selecting (or automatically extracting with ffmpeg) the audio-only AAC format YouTube serves. That would get rid of the YouTube request and MP4 parsing code.
- X-Cubed 5y agoI'm not sure it would, as the article seems to say that Sonos requires an ADTS container for the AAC audio, which YouTube doesn't offer. So the app takes an MP4 container, filters its contents to find the AAC audio blocks, then repacks them in an ADTS container.
- deadf00d 5y ago^ good reply
- Guillaume86 5y agoI think ffmpeg adds ADTS by default when extracting AAC from MP4 but don't quote me on that.
- Sesse__ 5y agoTypically the other way around; ADTS is a way to get AAC within MPEG-TS through means of a wrapper. If you remux AAC from MPEG-TS (like e.g. a satellite feed) into MP4, it strips away the ADTS wrapper (and adds a single ASC header for the MP4 stream metadata) using the aac_adtstoasc filter. I never really understood why you couldn't just put AAC directly into MPEG-TS without the ADTS wrapper, but MPEG-TS is pretty weird (and with super-high overhead) anyway.