# Output Alignment (Streamer)

Output Alignment is an entity that helps the user to align one or multiple video sources in the output video texture that Oden Streamer sends to OdenVR. The Output Alignment entity gives the ability to set the exact pixel position and size for each video source in a quick way. Along with helping the user align the video sources it also packs the alignment data and transmits it to OdenVR. OdenVR can then automatically split the incoming video texture into separate video streams.

To use the Output Alignment entity you need to add your [2D Video](entity-2d-video.md) entities as child objects to the Output Alignment, as seen in the figure below.

![output alignment](_images/output-alignment.png)

Figure 1. The [2D Video](entity-2d-video.md) that is being aligned must be a child object to the Output Alignment entity

The Output Alignment entity has several settings which can change how the output alignment works, as well as settings for aligning the video sources, explained in detail in chapter [Settings](#settings).

![output alignment settings](_images/output-alignment-settings.png)

Figure 2. The settings of an Output Alignment entity.

Oden Streamer will stream everything visible as one texture. The Output Alignment entity helps layout video streams in that texture. It will also stream the alignment data along with the video so the Remote Streamer entity can automatically crop the texture into separate video stream. When cloning from a Remote Streamer, three different types can come from an Output Alignment:

-   LLTP - The complete video stream with all sub videos
    
-   Stream - This is the cropped video stream that correlates to one of the input video sources
    
-   Focus Region Composite - This is a focus region video stream which is a combination of two or multiple video streams to create a region of interest video.
    

![output alignment player](_images/output-alignment-player.png)

Figure 3. The output of an Output Alignment stream.

## Settings

There are a few settings that can be changed in the Output Alignment entity; some affect the entity as a whole and some affect each individual video source.

Enabled

This locks the camera to show the output alignment layout. It can be disabled to allow the user to move freely in 3D space. The alignment data will be wrong if disabled when streaming.

Snap to Output

When setting up a focus region that has one original source and multiple focus sources that is combined into one output, there are some restrictions on where video sources can be placed. This boils down to how the encoder works and if not placed correctly it could add artifacts to the video stream. If this setting is enabled, the software will move entities so that it fulfills the requirement so no artifacts occur. This setting is strongly recommended to have enabled if using focus regions with multiple quality regions.

Auto-Layout

When pressed the software will try to layout the 2D surfaces automatically in the given space.

### Video Source Settings

Each video source has individual settings for how it should be placed in the output texture. The [2D Video](entity-2d-video.md) needs to have an active input source for the settings to show up in the Output Alignment entity.

![output alignment settings video](_images/output-alignment-settings-video.png)

Figure 4. The available settings for each video stream.

Id

Id is the identification number that will be shown at the OdenVR end when retrieving the video sources, as seen in figure [The output of an Output Alignment stream.](#output-alignment-player).

Position

This sets the position of the video source where (0, 0) corresponds to the top left pixel in the output resolution. Video sources can be placed outside of the output texture.

Scale

This setting sets the scale of the entity relatively to the size of the source. This can be done either by percentage or pixel scale which is set by the [Scale Mode](#size-mode) setting.

Scale Mode

Scale mode sets how the video source size is controlled. The alternatives are **Percent** or **Pixels**, the aspect ratio is always kept.

Rotation

Rotation is used to rotate the video entity by full 90, 180, or 270 degrees to better fit all video streams into the output resolution. If the video source has a focus region attached to it that focus region will also be rotated.

Mirror

The mirror checkbox can be used to flip the video. If the video source has a focus region attached to it that video will also be mirrored.

## Limitations

Output Alignment only works with [2D Video](entity-2d-video.md) entities. No other entities will be effected by the Output Alignment.

When using focus region together with auto mode switch there could be some encoder bleeding on the edges when the resolution scale is not 1. This is because of how the encoder works, to combat this we recommend checking so all the resolution scales work with the focus region before deploying. If not, check out different positions or slightly different resolution scales.
