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

#### 函数功能

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


#### 函数原型

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


#### 参数说明

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


#### 返回值说明

数据类型：GpuEncoderErrorCode

取值如下：

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