Version: 2023.1

VideoTrackEncoderAttributes

struct in UnityEditor.Media

切换到手册

描述

Descriptor for video track format.

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; } }

变量

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.
includeAlpha如果轨道将包含可在传递到 AddFrame 的纹理中找到的 Alpha 通道,则为 true。否则为 False。
targetBitRateThe target bit rate for the encoder.
widthThe image width in pixels.

构造函数

VideoTrackEncoderAttributesCreate a new VideoTrackEncoderAttributes with specific H.264 encoding options.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961