Skip to main content

Using the composer

what is the Composer/Multiviewer?

With MistServer 3.10 the newly released MistProcComposer has been added. The composer was first created with multiview/grid compositing in mind. It has far outgrown this original purpose and is now capable of so much more. This guide will help you get started with setting up everything to play around with the composer and understand the many use cases available such as:

  • Mixing/Matching multiple video feeds
  • Adding logos
  • Adding backgrounds
  • 24/7 live channels
  • Fallback streaming

We had a presentation about it at FOSDEM2026 It is however also available at our Youtube channel

Composer workflow

Compressed/Encoded audio/video workflow

The following workflow is assumed when compressed tracks come in. It does not matter what kind of compression the audio or video use, so H264/AAC is used for the use-case.

Raw audio/video workflow

When raw audio/video is immediately available from the ingest (such as V4L2 or SDI ingest) the process becomes much easier.

Encoding is necessary

The composer uses raw video and audio to do its work. This means that unless your feed already comes in as a raw feed you will be needing encoding. MistServer can be build with MistProcAV which is an implementation of Libav and the easiest way to create sources for the Composer.

This also means that no matter what you do, you will be using either CPU or GPU to manipulate your feeds. The good news however is that MistServer uses a smart ringbuffer design that allows MistServer to use raw video and audio tracks efficiently for every output that (re)uses them. The main warning to give here is that there is limited scalability, so be aware of the limitations of your hardware.

Step 0. Building MistProcAV

Compiling with MistProcAV you will need to add this to the compile flags. The only reason this isn't done automatically is because to run MistProcAV correctly it will need to be build for your system specifically. This means it will always work if you compile & run locally, however sharing this with another server has no 100% guarantee that it will work. This has made distribution challenging.

  • LibRIST requires installation in order to be used, we recommend either installing it before compiling MistServer, or adding -DNORIST=true as additional compile flag.

Request a build

We can prepare an image for various platforms from our build system. However in order to provide theese properly we'd need to know your OS as creating & leaving a build per OS on our website would just clutter everything.

Contact us and we'd be happy to provide you one, or guide you on self-compiling should we not have one prepared.

Self-compiled

More information on how to compile MistServer can be found in the compile documenation. The short summary would be:

  • Install dependencies
  • Pull in MistServer from github
  • Set the compile flag -DWITH_AV=true
  • Build MistServer

To easily do this you will need the following installed:

  • git, any c++ compiler (e.g. clang, gcc-c++) , meson, libav

Ubuntu 22.04

Ubuntu 22 requires installing meson/ninja through pip. All other requirements are available normally.

apt-get -y update && apt-get -y install build-essential python3-pip ffmpeg pkg-config libavformat-dev libavutil-dev libavcodec-dev libswscale-dev libavfilter-dev m4 wget libgmp-dev  git curl

python3 -m pip install meson ninja

Optionally the Nvidia driver could be added:

nvidia-driver-590-server

Ubuntu 24.04

Ubuntu 24 can install all requirements dire

apt-get -y update && apt-get -y install build-essential cmake python3-pip ffmpeg pkg-config libavformat-dev libavutil-dev libavcodec-dev m4 wget libgmp-dev libswscale-dev libavfilter-dev meson ninja-build git

Arch Linux

Arch linux should only need a very minimal setup in order to compile with MistProcAV.

pacman -Syu ffmpeg meson git ffnvcodec-headers

Docker

The MistServer Bootstrap images should be the easiest to use and provide additional options such as adding HTTPS through caddy.

git clone https://github.com/ddvtech/mistserver-bootstrap
cd mistserver-bootstrap
docker compose up

Step 1. Preparing your sources

Any stream within MistServer that you want to use as a source will require a UYVY track for video and a PCM track for audio. The most suitable solution for this is MistProcAV, should you not have MistProcAV please go back to the previous step!

While we suggest preparing your sources before adding them to the composer the order does not truly matter. So do not fret if you forget this step

You will need to do this for every stream you like to use within your composer

Video

Preparing your video sources is easy. The libav encoder should be selected by default, all you have to do is select UYVY for Video. By default MistServer will attempt to use hardware, and if none is found or available it will fall back to software mode.

The only setting that is used here would be resolution. In an upcoming version the settings will change to reflect this.

image of setting up raw video encoding

Audio

Preparing audio sources is easy as well. You will need to select Audio instead of video, however the libav encoder should stay default when you switch over. Afterwards select PCM for raw audio.

The only setting that can be set here is sample rate, however unless you know what you're doing we recommend not touching it.

Image of setting up raw audio encoding

Step 2. Creating your composer

Setting up the composer

To set up a composer create a new stream and set the source to compose or multiview. You should see the following screen appear:

Image of the compose source set up

The majority of your time will be spend in the designer. You can set up the following:

  • The video sources to use
  • Any custom text that should be shown
  • Positioning
  • Scaling settings per source
  • Aspect ratio setting per source

Start by filling your sources, you can use a stream name as a source for a stream input or an PNG (RGNA encoded) or a still image/background

Image of setting up sources in the designer

Once you've set the sources, you can set the positioning. You can either use the Grid or Focus defaults, or use Free-design to completely customize it to your liking:

Image of setting up the positioning in the designer

tip

If any sources are set up to have a JPEG track this will be shown here. Otherwise the name of the source will be shown.

Finally you can click on any cell, no matter what layout you're using to set up specific scaling and aspect ratio handling options:

Image of selecting a stream for scaling and aspect handling

Optional parameters

Optional parameters can help you add audio to the composer, set the defaults for scaling and aspect ratio handling and set sync timing. None are required when using the composer, but knowing when to set them can drasticly improve your results. So we recommend looking over the options regardless.

tip

We recommend setting the composer to always on for the best availability. However this does mean you will need to restart it if you change the copy audio setting.

Image of the optional parameters

Step 3. Adding compressed audio/video for playback or push out

The raw feeds created by the multiviewer cannot easily be used directly, you will need to add an encoder for both audio and video. Luckily this is quite easy and the reverse of Step 1.

When you have finished setting up the composer go to the bottom of the options and add a stream process.

Video

Like decoding, the default for MistServer is to attempt hardware encoding and fall back to software encoding should hardware fail or be unavailable. The defaults for H264 might be a bit heavy on the bitrate, but we consider it a good starting point. Generally we would recommend start with the H264 defaults, verify it gives a good image and then start editing settings until you're happy with both the performance and the quality of the feed.

Image of the h264 video defaults

Audio

Audio can only be done through software encoding. You will want to create either Opus or AAC audio, while AAC would be recommended as the best supported protocol the MistServer default is Opus at it is assumed you generally have AAC audio. So you will most likely want to change this to AAC.

Image of the aac audio defaults

Step 4. Preview & Edit

Now you're at the step where we would recommend watching what your composer does, verify if you're happy with it and then edit the feed to your liking!

Image of a multiview preview

Trouble-shooting

Generally within MistServer you can always try and reset a stream by sending a stop sessions call towards it. This can be done from the streams panel through the action menu or by right-clicking on the stream itself.

Alternatively you can send a nuke stream signal to forcefully close it completely & have it attempt a clean restart. This is only recommended should a stop sessions not work, as it could in rare cases cause a stream to get stuck instead.

Preview stays black no matter what

This typically means one of two options:

  1. You're not feeding in UYVY or PNG(RGBA encoded) sources to your multiview
  2. The composer has no UYVY to H264 (or AV1) stream process

You can see the difference based on whether there is an H264 or AV1 track available, if there is then your sources are incorrect. If there is only UYVY video, you will need to add a stream process and pick a video codec.

There is no audio

Audio needs to be added as an optional parameter. We will likely change this when we have finished our planned audio mixer to allow similar mixing for audio feeds as we do for video. However currently this would mean:

  1. You have not set up an audio source
  2. The audio source has no PCM audio
  3. The composer has no Audio to AAC/Opus stream process
  4. You added the audio after the composer has activated.

This one is a bit more complex, if there is PCM audio, but no AAC or Opus you're in case 3 and need to add a stream process to and pick an audio codec. If there's no PCM audio at all you will want to check the optional settings. If there's no stream set at the copy audio field you will need to fill that in and restart the composer by right clicking the stream name in the streams page and selecting stop sessions (case 1) If the copy audio is set up you have either forgotten to restart the composer or you need to add PCM audio to the source (cases 2 and 4).

Some feeds are missing

This can happen in two scenarios:

  1. The source has no UYVY stream process
  2. The decode is behind

In the case of 1 you simply need to add a stream process. In the case of 2 and you're receiving the stream, it means the source is slower than real time or running into issues. If you are decoding yourself it likely means you've reached the limits of your current setup and your hardware of CPU cannot handle additional tasks.

The composed stream feels stuttery

This usually happens because of unsteady frame rate or because you're mixing a lot of multiple frame rate sources. This is partly on purpose as the composer by default will generate a frame whenever one of the sources updates. This can however be limited to a steady frame rate by setting the frame rate in the optional parameters.

Examples and usages

All of the examples below will assume that you have:

  1. Set up any UYVY and PCM decoding at the sources
  2. Set up any H264/AV1 and AAC/Opus encoding at the composer

Due to the very flexible nature of this tool it can be used for multiple purposes. While some purposes are narrowly related they do differ slightly and certain optional parameters become key players depending on the wanted behaviour.

Falback & Always active

Live streaming has a very obvious limitation that if a stream isn't live, it does not exist. You will need "something" to generate a stream even if your live source is gone. The MistProcMultiview process is the best way to make sure that not only does your stream stay active, but you can replace it with whatever you want to show instead. Whether that is another live stream or simply an picture showing there are technical difficulties. This allows you to keep your stream active to wherever it is being pushed/shown even if your source drops.

Key Settings

  • You will require setting up at least 2 sources, The first one is the fallback to drop to and the last one should be the stream to show.
  • Always on should be activated
  • Your stream sources need to be decoded to UYVY and PCM
  • You will need an encoder to H264 and AAC or Opus
  • You will need to use free design mode to layer sources over each other.

Setting up a fallback

Free design

  • You will want to have the fallback be the first (highest) source
  • The source to watch should be below your first source and be layered on top of it.

Setting up a fallback2

For this example we have only done a very small video over the fallback picture, we recommend filling the entire stream generally.

Once set up the stream will become available instantly with the stream just showing the PNG: fallback when offline

Then whenever the stream live in this case comes online the stream will add the video and audio of that stream: fallback when online

Whenever the live stream goes offline or loses connection just the pictures will be shown again, keeping the stream live in the process.