---
title: Encode
description: "调用GPU进行视频编码，将输入buffer中的数据编码后写入输出buffer中。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/240RC1/armnative/kunpengcpsvideo_16_0090.html
sourcePath: /source/zh/kunpengboostkithistory/240RC1/armnative/kunpengcpsvideo_16_0090.html
indexId: ce48710746d42af792f0410cf4ea991bacc93e463f8ed2f5f366e4fc90cacdfa79
---
# Encode

#### 函数功能

调用GPU进行视频编码，将输入buffer中的数据编码后写入输出buffer中。


#### 约束说明

NA


#### 函数原型

int32_t Encode(GpuEncoderBufferT &inBuffer, GpuEncoderBufferT &outBuffer) = 0


#### 参数说明

| 字段名称 | 输入/输出 | 字段类型 | 字段描述 |
| --- | --- | --- | --- |
| inBuffer | 输入 | GpuEncoderBufferT & | 需要进行编码的输入buffer。 |
| outBuffer | 输入 | GpuEncoderBufferT & | 接收编码后数据的输出buffer。 |


#### 返回值说明

数据类型：GpuEncoderErrorCode

取值如下：

- OK：编码成功。
- 其他：编码失败。
