docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class VideoStreamSender

    Component for sending video streams.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    StreamSenderBase
    VideoStreamSender
    Implements
    IStreamSender
    Inherited Members
    StreamSenderBase.Transceivers
    StreamSenderBase.OnStartedStream
    StreamSenderBase.OnStoppedStream
    StreamSenderBase.Track
    StreamSenderBase.isPlaying
    StreamSenderBase.SetTransceiver(string, RTCRtpTransceiver)
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    Namespace: Unity.RenderStreaming
    Assembly: Unity.RenderStreaming.dll
    Syntax
    [AddComponentMenu("Render Streaming/Video Stream Sender")]
    public class VideoStreamSender : StreamSenderBase, IStreamSender

    Properties

    autoRequestUserAuthorization

    Whether request permission to use any video input sources.

    Declaration
    public bool autoRequestUserAuthorization { get; set; }
    Property Value
    Type Description
    bool

    codec

    Gets the codec information for the video stream.

    Declaration
    public VideoCodecInfo codec { get; }
    Property Value
    Type Description
    VideoCodecInfo

    frameRate

    Gets the frame rate of the video stream.

    Declaration
    public float frameRate { get; }
    Property Value
    Type Description
    float

    height

    Gets or sets the height of the frame buffer used for streaming.

    Declaration
    public uint height { get; set; }
    Property Value
    Type Description
    uint

    maxBitrate

    Gets the maximum bitrate of the video stream.

    Declaration
    public uint maxBitrate { get; }
    Property Value
    Type Description
    uint

    minBitrate

    Gets the minimum bitrate of the video stream.

    Declaration
    public uint minBitrate { get; }
    Property Value
    Type Description
    uint

    scaleResolutionDown

    The scale factor by which to reduce the video resolution to conserve bandwidth.

    Declaration
    public float scaleResolutionDown { get; }
    Property Value
    Type Description
    float

    source

    Gets or sets the source of the video stream.

    Declaration
    public VideoStreamSource source { get; set; }
    Property Value
    Type Description
    VideoStreamSource

    sourceCamera

    Gets or sets the camera used as the video stream source.

    Declaration
    public Camera sourceCamera { get; set; }
    Property Value
    Type Description
    Camera

    sourceDeviceIndex

    The index of WebCamTexture.devices.

    Declaration
    public int sourceDeviceIndex { get; set; }
    Property Value
    Type Description
    int

    sourceTexture

    Gets or sets the texture used as the video stream source.

    Declaration
    public Texture sourceTexture { get; set; }
    Property Value
    Type Description
    Texture

    sourceWebCamTexture

    Gets the WebCamTexture used as the video stream source.

    Declaration
    public WebCamTexture sourceWebCamTexture { get; }
    Property Value
    Type Description
    WebCamTexture

    width

    Gets or sets the width of the frame buffer used for streaming.

    Declaration
    public uint width { get; set; }
    Property Value
    Type Description
    uint

    Methods

    GetAvailableCodecs()

    Declaration
    public static IEnumerable<VideoCodecInfo> GetAvailableCodecs()
    Returns
    Type Description
    IEnumerable<VideoCodecInfo>

    SetBitrate(uint, uint)

    Sets the bitrate range for the video stream.

    Declaration
    public void SetBitrate(uint minBitrate, uint maxBitrate)
    Parameters
    Type Name Description
    uint minBitrate

    The minimum bitrate in kbps. Must be greater than zero.

    uint maxBitrate

    The maximum bitrate in kbps. Must be greater than or equal to the minimum bitrate.

    Examples
    videoStreamSender.SetBitrate(1000, 2500);
    Exceptions
    Type Condition
    ArgumentException

    Thrown when the maximum bitrate is less than the minimum bitrate.

    SetCodec(VideoCodecInfo)

    Sets the codec for the video stream.

    Declaration
    public void SetCodec(VideoCodecInfo codec)
    Parameters
    Type Name Description
    VideoCodecInfo codec

    The codec information to set.

    Examples
    var codec = VideoStreamSender.GetAvailableCodecs().FirstOrDefault(x => x.mimeType.Contains("VP9"));
    videoStreamSender.SetCodec(codec);

    SetFrameRate(float)

    Sets the frame rate for the video stream.

    Declaration
    public void SetFrameRate(float frameRate)
    Parameters
    Type Name Description
    float frameRate

    The new frame rate. Must be greater than zero.

    Examples
    videoStreamSender.SetFrameRate(30.0f);
    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown when the frame rate is less than or equal to zero.

    SetScaleResolutionDown(float)

    Sets the scale factor by which to reduce the video resolution to conserve bandwidth.

    Declaration
    public void SetScaleResolutionDown(float scaleFactor)
    Parameters
    Type Name Description
    float scaleFactor

    The scale factor by which to reduce the resolution. Must be greater than 1.0f.

    Examples
    videoStreamSender.SetScaleResolutionDown(2.0f);
    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown when the scale factor is less than or equal to 1.0f.

    SetTextureSize(Vector2Int)

    Sets the size of the frame buffer used for streaming.

    Declaration
    public void SetTextureSize(Vector2Int size)
    Parameters
    Type Name Description
    Vector2Int size

    The new size of the texture as a Vector2Int.

    Examples
    SetTextureSize(new Vector2Int(1920, 1080));

    Implements

    IStreamSender
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)