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

#### 函数功能

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


#### 函数原型

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


#### 参数说明

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


#### 返回值说明

数据类型：GpuEncoderErrorCode

取值如下：

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