All Projects → BarakChamo → uTextureSendReceive

BarakChamo / uTextureSendReceive

Licence: MIT License
Unity network texture sender and receiver for video and frame streaming

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to uTextureSendReceive

Hls.js
HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
Stars: ✭ 10,791 (+9621.62%)
Mutual labels:  streaming, video-streaming
deflix-stremio
Deflix addon for Stremio
Stars: ✭ 31 (-72.07%)
Mutual labels:  streaming, streaming-video
Node Tcp Streaming Server
Experimental TCP video streaming server written in node.js. Streaming over TCP and redistributing using WebSockets.
Stars: ✭ 100 (-9.91%)
Mutual labels:  streaming, video-streaming
Live Stream Face Detection
Live Streaming and Face Detection with Flask in Browser
Stars: ✭ 47 (-57.66%)
Mutual labels:  streaming, video-streaming
VITA2PC
Stream PSVITA gaming sessions over WiFi.
Stars: ✭ 61 (-45.05%)
Mutual labels:  streaming, streaming-video
Core
Implementation of P2PSP: An application layer protocol for the real-time streaming of multimedia content over the Internet.
Stars: ✭ 71 (-36.04%)
Mutual labels:  streaming, video-streaming
Nymphcast
Audio and video casting system with support for custom applications.
Stars: ✭ 2,010 (+1710.81%)
Mutual labels:  streaming, video-streaming
Srs
SRS is a simple, high efficiency and realtime video server, supports RTMP, WebRTC, HLS, HTTP-FLV, SRT and GB28181.
Stars: ✭ 16,734 (+14975.68%)
Mutual labels:  streaming, video-streaming
dewdle
A remote video-feed drawing tool (telestrator) for streaming and broadcast environments.
Stars: ✭ 29 (-73.87%)
Mutual labels:  video-streaming, streaming-video
UnityTexture3DAtlasImportPipeline
A Texture3D Atlas Import Pipeline for Unity 2019.3 and newer.
Stars: ✭ 24 (-78.38%)
Mutual labels:  texture, unity3d-plugin
Rx Player
DASH/Smooth HTML5 Video Player
Stars: ✭ 600 (+440.54%)
Mutual labels:  streaming, video-streaming
RokuKast
A Chrome extension to stream web videos to Roku devices.
Stars: ✭ 63 (-43.24%)
Mutual labels:  video-streaming, streaming-video
Awesome Video
A curated list of awesome streaming video tools, frameworks, libraries, and learning resources.
Stars: ✭ 397 (+257.66%)
Mutual labels:  streaming, video-streaming
Streama
Self hosted streaming media server. https://docs.streama-project.com/
Stars: ✭ 8,948 (+7961.26%)
Mutual labels:  streaming, video-streaming
Movienight
Single instance video streaming server with integrated chat.
Stars: ✭ 387 (+248.65%)
Mutual labels:  streaming, video-streaming
Nginx Vod Module
NGINX-based MP4 Repackager
Stars: ✭ 1,378 (+1141.44%)
Mutual labels:  streaming, video-streaming
api.video-go-client
The official Go client library for api.video
Stars: ✭ 16 (-85.59%)
Mutual labels:  streaming, video-streaming
Vidgear
A High-performance cross-platform Video Processing Python framework powerpacked with unique trailblazing features 🔥
Stars: ✭ 2,048 (+1745.05%)
Mutual labels:  streaming, video-streaming
Ott Packager
OTT/ABR streaming encoder (H264/HEVC) and packager for DASH and HLS
Stars: ✭ 148 (+33.33%)
Mutual labels:  streaming, video-streaming
browserLiveStream
Use webcam, browser and Node to stream live video. From api.video (https://api.video)
Stars: ✭ 141 (+27.03%)
Mutual labels:  streaming, video-streaming

uTextureSendReceive

Unity threaded network texture sender and receiver plugin for video and texture streaming

This is a small package that provides a threaded interface for sending and receiving any Unity texture over TCP/IP. It can be used to stream video, webcams as well as any 2D or Render texture, like parts of your visuals, minimaps, etc.

Check out these examples of the same app streaming and receiving with a 20k-count particle-system running uninterrupted in the background ;)

Streaming live webcam feed

Streaming live webcam feed

Streaming a Video Player

Streaming a Video Player

Streaming in-game Camera view

Streaming in-game Camera view

Features

  1. Simple texture-based interface for sending images/video/textures/etc. over TCP/IP.
  2. Threaded sending and receiving for improved performance of the rest of the project.
  3. Configurable encoding and quality settings.
  4. Example Webcam, Video Player and in-game Camera streaming components and scenes.

Installation

To install the package head to the releases section and download the latest release .unitypackage.

Follow these instructions to import the custom package into your project. The package should show up under TextureSendReceive in your project's Assets folder.

capture

Example scenes

Example usage scenes are provided in the Example folder and show a range of use cases for the libary, how to set up streaming and how to use incoming textures in Unity scenes.

All projects are set up with a sender and a receiver and a 20,000-count particle-system that runs smoothly when sending and receiving 720p video on an MSI laptop with a 260GhZ i7 and GTX970M running Windows 10.

Webcam streaming example

The webcam example sends a receives a WebCamTexure and is included with a small utility to capture webcam textures and select the webcam you want to use.

Check out the WebcamSender file to learn how to use uTextureSendReceive with a webcam and Unity's WebCamTexture.

Video file streaming example

The video file example sends a receives a RenderTexture from a VideoPlayer.

Check out the VideoFileSender file to learn how to use uTextureSendReceive with a VideoPlayer, VideoClips and Unity's RenderTexture mode for video playback.

Camera texture streaming example

The camera example sends a receives an in-game camera RenderTexture from a Camera aimed at the test particle system.

Check out the CameraSender file to learn how to use uTextureSendReceive with a Camera and Unity's RenderTexture mode for streaming the view from in-game cameras.

Setup and Usage

To begin using the package add a TextureReceiver or TextureSender component to your project. Both components share some common properties, such as the port used for TCP/IP connection and the Message byte length that indicates the size of each video chunk sent and received.

All classes and properties are encapsulated under the TextureSendReceive namespace.

TextureSender

The texture sender component accepts connection from receivers for streaming and, encodes textures and sends them over TCP/IP. Once the sendTexture, an instance of 2DTexture, is assigned with a SetSourceTexture(Texture2D sendTexture) the TextureSender will send the contents of the texture once per frame.

captu1re

Configuration

Begin by adding a TextureSender component to a new or existing GameObject and configure the port and Encoding. By default, the component is configured to encode textures as JPGs. It's recommended that you stick to JPGs unless strictly required as this cuts the encoding size by roughly half.

Scripting

Streaming a texture is done in code and only requires a single line for setting the streaming source texture. The SetSourceTexture(Texture2D sendTexutre) accepts an instance or 2DTexture and will continuously read from it once it's initialized.

using TextureSendReceive;

...

TextureSender sender;
Texture2D sendTexture;

void Start () {
  // Get sender instance
  sender = GetComponent<TextureSender>();
  
  // Initialize Texture2D, in this case with webcamTexture dimensions
  sendTexture = new Texture2D(webcam.width, webcam.height);
  
  // Set send texture
  sender.SetSourceTexture(sendTexture);
}
...

TextureReceiver

The texture sender component connects to remote senders and accepts texture frames over TCP/IP, currently there's no distinction between senders to handle multiple sources but that might change in the future.

ca2pture

Once the receiveTexture, an instance of 2DTexture, is assigned with a SetTargetTexture(Texture2D sendTexture) the TextureReceiver will write each received frame to the target texture. Note that the texture will be automatically resized to fit the received frame.

Configuration

Begin by adding a TextureReceiver component to a new or existing GameObject and configure the ip, port and Encoding. By default, the component is configured to send over localhost (127.0.0.1) and you can see a working setup of local streaming in the example scenes.

Scripting

Receiving a texture, like streaming, is done in code and only requires a single line for setting the target receiving texture. The SetTargetTexture(Texture2D sendTexutre) accepts an instance or 2DTexture and will continuously write to it as new frames are received.

using TextureSendReceive;

...

TextureReceiver receiver;
Texture2D targetTexture;

void Start () {
  // Get sender instance
  receiver = GetComponent<TextureReceiver>();

  // initialize new target texture
  targetTexture = new Texture2D(1, 1);
			
  // Set target texture
  receiver.SetTargetTexture(targetTexture);
}
...

Usage tips

Sending and receiving multiple sources

You can initialize as many TextureReceiver and TextureSenders as you want and handle more than one receiving or sending source. An example for multi-sending and multi-receiving will be added soon.

Switching sources and targets

The source and target textures can be swapped on the fly by making calls to SetSourceTexture and SetTargetTexture at runtime.

Made by Barak Chamo, released under MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].