human: 如何处理七牛云的实时音视频QNCustomVideoTrack

gpt: [实时音视频](https://developer.qiniu.com/rtc) > API 文档 > Linux >QNCustomVideoTrack

#  QNCustomVideoTrack

最近更新时间: 2022-05-24 22:05:49

本地视频自定义导入 Track 类

Hierarchy

  * [QNTrack](https://developer.qiniu.com/rtc/11205/QNCustomVideoTrack-Linux/11222/QNTrack-Linux)
    * [QNLocalTrack](https://developer.qiniu.com/rtc/11205/QNCustomVideoTrack-Linux/11208/QNLocalTrack-Linux)
      * [QNLocalVideoTrack](https://developer.qiniu.com/rtc/11205/QNCustomVideoTrack-Linux/11209/QNLocalVideoTrack-Linux)
        * [QNCameraVideoTrack](https://developer.qiniu.com/rtc/11205/QNCustomVideoTrack-Linux/11198/QNCameraVideoTrack-Linux)
        * QNCustomVideoTrack 
      * [QNLocalAudioTrack](https://developer.qiniu.com/rtc/11205/QNCustomVideoTrack-Linux/11207/QNLocalAudioTrack-Linux)
        * [QNMicrophoneAudioTrack](https://developer.qiniu.com/rtc/11205/QNCustomVideoTrack-Linux/11210/QNMicrophoneAudioTrack-Linux)
        * [QNCustomAudioTrack](https://developer.qiniu.com/rtc/11205/QNCustomVideoTrack-Linux/11203/QNCustomAudioTrack-Linux)
    * [QNRemoteTrack](https://developer.qiniu.com/rtc/11205/QNCustomVideoTrack-Linux/11213/QNRemoteTrack-Linux)
      * [QNRemoteVideoTrack](https://developer.qiniu.com/rtc/11205/QNCustomVideoTrack-Linux/11215/QNRemoteVideoTrack-Linux)
      * [QNRemoteAudioTrack](https://developer.qiniu.com/rtc/11205/QNCustomVideoTrack-Linux/11212/QNRemoteAudioTrack-Linux)

Index

Core Methods

  * GetTrackID
  * GetUserID
  * GetTag
  * IsAudio
  * IsVideo
  * IsMuted
  * SetMuted
  * SetVideoFrameListener
  * SendSEI
  * PushVideoFrame

Core Methods

GetTrackID

  * virtual const std::string& GetTrackID() = 0
  * 获取 TrackID

Returns string

GetUserID

  * virtual const std::string& GetUserID() = 0
  * 获取 UserID

Returns string

GetTag

  * virtual const std::string& GetTag() = 0
  * 获取 Tag

Returns string

IsAudio

  * virtual bool IsAudio() = 0
  * 是否为音频 track

Returns bool

IsVideo

  * virtual bool IsVideo() = 0
  * 是否为视频 track

Returns bool

IsMuted

  * virtual bool IsMuted() = 0
  * 是否 muted

Returns bool

SetMuted

  * virtual void SetMuted(bool muted) = 0
  * 设置是否静默该 track，静默后，SDK 将会发送静默帧数据

> 对于推 H264 源的 track，不支持 mute 操作

Parameters

    * muted: bool 

是否静默

SetVideoFrameListener

  * virtual void SetVideoFrameListener([QNVideoFrameListener](https://developer.qiniu.com/rtc/11205/QNCustomVideoTrack-Linux/11226/QNVideoFrameListener-Linux)* listener) = 0
  * 设置视频数据监听

Parameters

    * listener: [QNVideoFrameListener](https://developer.qiniu.com/rtc/11205/QNCustomVideoTrack-Linux/11226/QNVideoFrameListener-Linux)

视频数据监听接口

SendSEI

  * virtual void SendSEI(std::string& message,std::string& uuid,int32_t repeat_count) = 0
  * 发送 SEI

Parameters

    * message: string 

消息内容

    * uuid: string 

唯一 ID

    * repeat_count: int 

重复次数, -1 为每一帧都发送

PushVideoFrame

  * virtual int PushVideoFrame(const uint8_t* data,const uint32_t data_size,const int32_t width,const int32_t height,const int64_t timestamp_us,QNVideoFrameType video_frame_type,QNVideoRotation rotation,bool mirror = false) = 0
  * 推送自定义视频帧

Parameters

    * data: uint8_t* 

视频数据

    * data_size: uint32_t 

数据长度

    * width: int32_t 

视频宽

    * height: int32_t 

视频高

    * int64_t: timestamp_us 

时间戳，单位:微妙

    * video_frame_type: [QNVideoFrameType](https://developer.qiniu.com/rtc/11205/QNCustomVideoTrack-Linux/11300/QNVideoFrameType-Linux)

视频原始格式，支持：kI420 kYUY2 kRGB24

    * rotation: [QNVideoRotation](https://developer.qiniu.com/rtc/11205/QNCustomVideoTrack-Linux/11301/QNVideoRotation-Linux)

导入后旋转角度，如果不需要旋转则使用默认值 kVideoRotation0 即可

    * mirror: bool 

是否镜像

以上内容是否对您有帮助？