Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


VideoTrackEncoderAttributes

Descriptor for video track format.
Read time 1 minuteLast updated 10 days ago

Definition

public struct VideoTrackEncoderAttributes

Examples

using UnityEditor.Media;using UnityEditor;using UnityEngine;public class Recorder{ public VideoTrackEncoderAttributes CreateEncoderAttributes() { H264EncoderAttributes h264Attr = new H264EncoderAttributes { gopSize = 25, numConsecutiveBFrames = 2, profile = VideoEncodingProfile.H264High }; var videoAttr = new VideoTrackEncoderAttributes(h264Attr) { frameRate = new MediaRational(50), width = 320, height = 200, targetBitRate = 3000000 }; return videoAttr; }}

Fields

Value

Description

bitRateModeThe VideoBitrateMode for the encoded video.
frameRateThe frame rate for the encoded video, in frames per second, expressed as a fraction.
heightThe image height in pixels.
includeAlphaTrue if the track is to include the alpha channel found in the texture passed to AddFrame. False otherwise.
targetBitRateThe target bit rate for the encoder.
widthThe image width in pixels.

Constructors

Constructor

Description

VideoTrackEncoderAttributes(UnityEditor.Media.H264EncoderAttributes)Create a new VideoTrackEncoderAttributes with specific H.264 encoding options.
VideoTrackEncoderAttributes(UnityEditor.Media.VP8EncoderAttributes)Create a new VideoTrackEncoderAttributes with specific VP8 encoding options.