[ad_1]
IT marketing consultant Didelot Maurice-Michel was displeased with the inaccessibility of Google’s YouTube video streaming platform on SONOS speaker techniques — and set about fixing the issue by reverse engineering the SONOS desktop app.
“Even when YouTube movies are publicly out there and their content material are free,” Maurice-Michel explains, “SONOS cannot play them with out the usage of YouTube Music which isn’t cool. YouTube is a giant place for locating music, particularly previous dwell live performance, or forgotten songs. So, how will we play YouTube movies on a SONOS?”
Unwilling to subscribe to YouTube Music, Didelot Maurice-Michel turned to reverse engineering to play YouTube audio streams. (📷: Didelot Murice-Michel)
The reply: Digging into the operation of the SONOS desktop utility and constructing a system for pulling content material down from YouTube in an appropriate format and feeding it to SONOS for playback, all with out having to the touch YouTube Music — or utilizing an iOS gadget to stream through Airplay, unavailable to these outdoors the Apple ecosystem.
“After some digging, I discover a actually fascinating request that’s linked to the Internet-Radio function of the gadget,” Maurice-Michel explains. “Certainly, a part of the SONOS function is that it might probably stream Internet-Radios by selecting them on a listing from the app, or add your individual! Be aware the customized URL protocol, that point out that it attempt to play a MP3 Radio. However later checks will present that it really works not just for MP3 however for [almost] each supported encoding.”
Maurice-Michel’s strategy depends on changing YouTube’s stream right into a “Internet Radio” stream for the SONOS audio system. (📷: Didelot Murice-Michel)
Experiments, nonetheless, revealed that the issue wasn’t going to be so simple as feeding a YouTube MP4 into the SONOS system. Nor was it doable to extract and use the AAC audio stream alone, with SONOS requiring an ADTS streaming container.
“My new plan [was] to construct an online server that serve ADTS formatted YouTube video content material,” Maurice-Michel writes. “The SONOS ask a useful resource containing a YouTube video ID, then the server ask to YouTube the corresponding video. For every packet obtained: Parse MP4; Extract AAC; Format it to ADTS; Ship it again to the SONOS.”
A Python-based server handles the streaming and conversion, with cell apps to observe. (📷: Didelot Murice-Michel)
Having picked aside the MP4 format to parse its metadata and atomic information, Maurice-Michel was capable of construct a system which might extract the AAC audio and reformat it as ADTS. Written in Python with Flask and pytube, a Python software for interfacing with YouTube, the ensuing server efficiently handles the conversion and streaming with a easy cat and pipe — and is within the strategy of being rewritten as a fully-featured SONOS-compatible streaming app for Android and iOS gadgets.
Maurice-Michel’s full write-up is accessible on deadf00d.com, together with the supply code beneath an unspecified open-source license.
[ad_2]
