Skip to main content
Currently not released yet. Beta documentation

Compositor - Multiview - MistProcMultiview

This is a compositor made to serve as an input process. It's in a bit of a special place as it's meant to create a new stream, but only from processing existing streams, using the raw track of these streams and compositing them into one output.

While the input/output are directly compatible with SDI, should you wish to show them in browser or over IP you will need to add an encoder.

In it's current state this tool can be used to:

  • Combine/mix multiple streams into one
  • Add pictures to a stream
  • Layer streams/pictures above each other
  • Dynamically alter what is shown
  • Sync up multiple outputs to each other
  • Both audio and video can be added while it's in use.
tip
  • The multiviewer tries to generate a frame at the requested framerate. This means that depending on how sources line up a frame can be behind. In this case the last frame will be used.
  • While the multiviewer tries to uphold the requested framerate your hardware will determine whether it is possible. Sometimes frames are duplicated

Configuration

The multiviewer is best configured through the interface. The most notable thing is that every stream added to the Multiview will be put into the given resolution. This means that the stream will need to scale/resize, so setting this correctly is key. Other than that a size and position can be given to each source to customize the positioning. If no position or size has been given a grid will be created with "best fit".

Interface

The multiviewer is quite complex, however if you do it in a few steps it's much easier.

Setting up multiview

First you will need to set up the source to multiview and you will see the designer and additional options appear.

image of how to set up the multiview

Multiview designer

For adding/removing/compositing we recommend opening the designer, it makes the task much easier.

image of how the designer looks like

How to add sources

You can add a source for the multiview to use by adding it as the first value for every row within the multiview. The source can link to either a stream name within MistServer, or a PNG image with RGBA pixelformat within the system. To browse for a picture you can select the browse button to the right of the source field.

image of sources and labels

Once added you can set up additional rules such as location within the stream, but also how it should behave over the location restraints it has received.

image of the source additional setup

tip
  • Any stream that has a JPG output will show the JPG instead of the source name
  • PNG needs RGBA pixelformat or it won't load
  • The aspect ratio handling and scaling algorithm determine the quality and how the selection is filled. Don't forget to experiment!

Changing the multiview live

If you made edits to the designer, whether it is adding, removing or changing positions of sources you will see the changes appear at the next generated frame.

image

Configuration file / API

The following would be setting up grid for 9 streams using the scaling defaults

    "multiview": {
"always_on": true,
"copyaudio": "0",
"name": "multiview",
"processes": [],
"resolution": "1920x1080",
"source": "multiview",
"sources": [
{
"h": 360,
"stream": "example1",
"text": "custom text",
"w": 640,
"x": 0,
"y": 0
},
{
"h": 360,
"stream": "example2",
"text": "",
"w": 640,
"x": 640,
"y": 0
},
{
"h": 360,
"stream": "example3",
"text": null,
"w": 640,
"x": 1280,
"y": 0
},
{
"h": 360,
"stream": "example4",
"text": null,
"w": 640,
"x": 0,
"y": 360
},
{
"h": 360,
"stream": "example5",
"text": null,
"w": 640,
"x": 640,
"y": 360
},
{
"h": 360,
"stream": "example6",
"text": null,
"w": 640,
"x": 1280,
"y": 360
},
{
"h": 360,
"stream": "example7",
"text": null,
"w": 640,
"x": 0,
"y": 720
},
{
"h": 360,
"stream": "example8",
"text": null,
"w": 640,
"x": 640,
"y": 720
},
{
"h": 360,
"stream": "/path/to/example.png",
"text": null,
"w": 640,
"x": 1280,
"y": 720
}
],
"stop_sessions": false,
"tags": [],
"target_fps": 60
}

It's often much easier to set up the multiview using the interface, saving the configuration and then copying it over from the configuration file.

Command line

Using the command line is not recommended for the Multiview as it doesn't allow you to make live changes, it does allow you to create one on the fly.

Example: Setting up a Multiview through commandline

MistProcMultiview --sources {"h":720,"stream":"example1","text":"give","w":960,"x":0,"y":0} --sources {"h":360,"stream":"example2","text":"me","w":480,"x":960,"y":0} --sources {"h":360,"stream":"example3","text":"that","w":480,"x":1440,"y":0} --sources {"h":360,"stream":"example4","text":"sweet","w":480,"x":960,"y":360} --sources {"h":360,"stream":"example5","text":"sdi","w":480,"x":1440,"y":360} --sources {"h":360,"stream":"example6","text":"image","w":480,"x":0,"y":720} --sources {"h":360,"stream":"example7","text":"or","w":480,"x":480,"y":720} --sources {"h":360,"stream":"example8","text":"bust","w":480,"x":960,"y":720} --sources {"h":360,"stream":"example9","text":"!!!","w":480,"x":1440,"y":720} --copyaudio 0 --resolution 1920x1080 --target_fps 60 -s multiview multiview

Required options

KeyNameTypeDescriptionValidation
sinkTarget streamstringStream to which the generated track will be added. Defaults to the source stream. May contain variables.
sourcesSource to addstringsource and parameters to add to the multiviewer

Source options

KeyNameTypeDefault / ValueUnitHelp / DescriptionOptions (if applicable)
streamstream nameStringStream name within MistServer to use
texttext to displayStringstream name"" or null for empty, string for a value otherwise stream name will be used.
wwidthIntegerautomatic fitpxwidth the stream should use
hheightIntegerautomatic fitpxheight the stream should use
xpositioning XIntegerautomatic fitpxposition the stream gets in
ypositioning YIntegerautomatic fitpxPosition the stream gets in

Optional options

KeyNameTypeDefaultCLI OptionDescriptionChoices
resolutionResolutionstring1920x1080--resolutionResolution of the output stream (e.g. 1920x1080).
aspectAspect ratio handlingselectletterbox--aspectHow to handle aspect ratio mismatches between input and grid cells.letterbox – Preserve aspect, add black bars, crop – Preserve aspect, crop excess, stretch – Stretch to fit (may distort image) pattern - repeat pattern to fit the whole selection
scalingScaling algorithmselectinteger--scalingAlgorithm used to scale input sources to fit grid cells.bilinear – High quality, slower, nearest – Fast, lower quality, integer – Integer-only scaling (fast + HQ)
target_fpsTarget framerateint0--target_fpsTarget output framerate (fps). If 0, waits for all sources to have new frames before output.
copyaudioCopy audiostring--copyaudioCopy audio from one of the input sources.
printtimingPrint timingbinaryfalse--printtiming, -TInserts timing information on the sources to use for syncingtrue, false
sourcesyncSync sourcesbinaryfalse--sourcesync, -YAttempt to automatically sync sources based on UTC informationtrue, false

Examples and usages

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.