Giter Site home page Giter Site logo

klakspout's Introduction

KlakSpout

gif screenshot

KlakSpout is a Unity plugin that allows sharing video frames with other applications using the Spout system.

Spout is a video sharing system for Windows that allows applications to share frames in real time without incurring significant performance overhead. It's supported by several applications (MadMapper, Resolume, etc.) and frameworks (Processing, openFrameworks, etc.). It works in a similar way to Syphon for Mac, and it's similarly useful for projection mapping and VJing.

System requirements

  • Unity 2019.3
  • KlakSpout only supports Direct3D 11 (DX11) graphics API mode. Other APIs (DX12, OpenGL, Vulkan) are not supported at the moment.

How to install

This package uses the scoped registry feature to resolve package dependencies. Please add the following sections to the manifest file (Packages/manifest.json).

To the scopedRegistries section:

{
  "name": "Keijiro",
  "url": "https://registry.npmjs.com",
  "scopes": [ "jp.keijiro" ]
}

To the dependencies section:

"jp.keijiro.klak.spout": "1.0.0"

After changes, the manifest file should look like below:

{
  "scopedRegistries": [
    {
      "name": "Keijiro",
      "url": "https://registry.npmjs.com",
      "scopes": [ "jp.keijiro" ]
    }
  ],
  "dependencies": {
    "jp.keijiro.klak.spout": "1.0.0",
...

Spout Sender component

The Spout Sender component (SpoutSender) is used to send frames to other Spout compatible applications.

There are two modes in Spout Sender:

Camera capture mode

inspector

The Spout Sender component runs in the camera capture mode when attached to a camera object. It automatically captures frames rendered by the camera and publishes them via Spout. The dimensions of the frames are dependent on the screen/game view size.

Note that the camera capture mode is not compatible with scriptable render pipelines. The render texture mode should be applied in case of using SRP.

Render texture mode

inspector

The Spout Sender component runs in the render texture mode when it's independent from any camera. In this mode, the sender publishes content of a render texture that is specified in the Source Texture property. This render texture should be updated in some way -- by attaching to a camera as a target texture, by custom render texture, etc.

Alpha channel support

This controls if the sender includes alpha channel to published frames. In most use-cases of Unity, the alpha channel in rendered frames is not used and only contains garbage data. It's generally recommended to turn off the Alpha Channel Support option to prevent causing wrong effects on a receiver side.

Spout Receiver component

inspector

The Spout Receiver component (SpoutReceiver) is used to receive frames published by other Spout compatible applications.

Source Name property

The Spout Receiver tries to connect to a sender which has a name specified in the Source Name property. Note that the search is done with exact match (case-sensitive). It can be manually edited with the text field, or selected from the drop-down labelled "Select" that shows currently available Spout senders.

Target Texture property

The Spout Receiver updates a render texture specified in the Target Texture property every frame. Note that the Spout Receiver doesn't care about aspect ratio; the dimensions of the render texture should be manually adjusted to avoid stretching.

Target Renderer property

When a renderer component (in most cases it may be a mesh renderer component) is specified in the Target Renderer property, the Spout Receiver sets the received frames to one of the texture properties of the material used in the renderer. This is a convenient way to display received frames when they're only used in a single renderer instance.

Script interface

The received frames are also accessible via the receivedTexture property of the SpoutReceiver class. Note that the receivedTexture object is destroyed/recreated when the settings (e.g. screen size) are changed. It's recommended to update the reference every frame.

Spout Manager class

The Spout Manager class (SpoutManager) only has one function: getting the list of sender names that are currently available in the system (GetSourceNames). This is useful for implementing a sender selection UI for run time use.

gif

Please check the Source Selector example for detailed use of this function.

Frequently Asked Questions

Can't send/receive more than 10 sources

See issue #33 in the Spout SDK. You can download the SpoutSettings app from the thread that allows changing the maximum number of Spout senders.

Spout vs NDI: Which one is better?

The answer is simple: If you're going to use a single computer, use Spout. If you need connecting multiple computers, use NDI.

Spout is a superior solution for local interoperation. It's faster, low latency, more memory efficient and better quality. It's recommended using Spout unless multiple computers are involved.

License

MIT

klakspout's People

Contributors

keijiro avatar comoc avatar kant avatar rself avatar thriftysnail avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.