Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • funkwhale funkwhale
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 388
    • Issues 388
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • funkwhale
  • funkwhalefunkwhale
  • Issues
  • #691

Closed
Open
Created Jan 30, 2019 by Agate@agate💬Owner

[EPIC] Live streaming

After my last, unfortunate attempt with https://github.com/ant-media/Ant-Media-Server/issues/579, to implement live audio streaming in Funkwhale, I have a better idea of a possible setup that could work.

My idea is to leverage Icecast, to handle the audio streaming part. This software is stable, maintained and exist for years, and trying to reimplement our own streaming system cannot end well.

Icecast support a so-called Yellow Page feature which icecast servers can use to notify arbitrary directories of Stream metadata (name, audio codecs, etc.) and status (up, down, etc.).

The reference implementation of such a directory is open-source and available at https://github.com/xiph/Icecast-directory/.

Based on those asumptions, we can design a rather scalable and simple streaming system.

Icecast configuration

Configuration on Icecast side would be extremely simple. The only step would be to add this snippet to the server configuration:

<directory>
    <yp-url>https://funkwhale.domain/api/icecast/yp/unique-token</yp-url>
</directory>

The https://funkwhale.domain/api/icecast/yp/unique-token url would be user-specific and provided in Funkwhale's UI. Having a unique, per-user URL is useful for anti-abuse / blocking unwanted streams.

Streamer workflow

We assume the streamer has access to an icecast server configured as described previously, and is able to stream on this server.

Nothing Funkwhale-specific happen here, but Icecast is smart enough to notify Funkwhale that the stream exist and it's up thanks to the previous configuration.

User workflow

Since the Funkwhale instance is aware of the existence of the stream, if can display it in the UI. Users can list streams and start them. Technically, an <audio> tag is enough (example: http://dir.xiph.org/) to load the stream in the user browser.

Considerations

  • Funkwhale only stream metadata, and audio content is served from the icecast server. This is more scalable than having Funkwhale serving the content directly, and Icecast support relaying to increase scalability even more
  • Funkwhale could federate stream metadata to improve stream discovery
  • We can leverage most if not all of Icecast features using this architecture, such as password-protected streams, because there's nothing between the client and the icecast server
  • Streamers UX is not as good as on concurrent services, like Twitch, because we assume streamer have access to an Icecast server, which is not trivial to install. However, we could provide documentation for installing one, or redirect people to hosted Icecast providers
Edited Jan 30, 2019 by Agate
Assignee
Assign to
Time tracking