A simple streaming application. Can do multiple streams at the same time.
Find a file
2026-04-27 17:31:54 +02:00
.gitignore example config file 2026-04-12 03:43:10 +02:00
example.toml user command output is displayed at the bottom 2026-04-18 00:58:46 +02:00
ffmpeg.py fix recording format 2026-04-27 17:31:54 +02:00
mandala.py make app more themeable via CSS 2026-04-18 01:12:38 +02:00
README.md make app more themeable via CSS 2026-04-18 01:12:38 +02:00
worker.py user command output is displayed at the bottom 2026-04-18 00:58:46 +02:00

Mandala

A simple software to have streaming + recording at the same time. Simple GUI. Internally based on ffmpeg. Easy to extend.

Usage

A simple UI with only a "play" button. This will start all the streamers and all the recorders you ask to.

When you press play, you will now see information about the current status.

Technicalities

Task

Mandala has 2 tasks: streaming and recording. But both those tasks can be delegated to any number of workers. This means that you can have 2 streams at the same time (yes, it's useful sometimes).

A task is in one of these status:

  • GOOD, when all its workers are RUNNING
  • DEGRADED, when some of its workers are RUNNING
  • LOADING, when some of its workers are LOADING
  • ERROR, when all of its workers are reporting errors

Workers

In order to gain some modularity, mandala will just spawn whatever command you ask it to spawn. that program (which we'll call a "worker") will actually do the streaming (or the recording). We're providing ffmpeg as the only integration, but you're free to use whatever you want, as long as your command follows a simple protocol:

  • the helper should take care of restarting in case of errors itself. mandala will not. Thank you.
  • it must report its status on stdout, with a single line of JSON.
    • you can send it with the frequency you want. You're also free to only send it in case the status changes.
    • the schema is really simple: a single status field, whose value can be LOADING, RUNNING or ERROR
  • it must honor the SIGTERM signal

It should be easy enough to wrap whatever command you want to make it behave exactly like this.

Config

A TOML configuration file will allow you to configure all workers

We provide an example.toml file which should give you a living example.

Configuration file should be in ~/.config/mandala/mandala.toml, but you can override it by setting the MANDALA_CONFIG environment variable to a different file path.

Advanced configuration

Mandala allows you to change its appearance, too.

The config file allows you to override many strings of the UI.

You can use gtk CSS. The whole window of Mandala has a .mandala-main-window class, which makes it easy to write CSS selectors that won't match other apps. This will make it easy to change fonts, colors, and the like.

You can have the output of a custom program be displayed at the bottom, by setting ui.user_command.cmd. This can come in handy if you have some program that gives useful info to the DJ about what's going on. The command will be continuously run.

TODO

  • UX: specify error
  • Maintenance proper logging
  • document TOML config
  • recording in $BASEDIR/%Y-%m/%d/
  • easily open recording directory
  • Nice: recording should save time as metadata
  • Nice: recording should save basic, static metadata