[关闭]
@sewise-dev 2019-09-18T03:20:25.000000Z 字数 1646 阅读 603

PengCheng Transcode API

transcode api


更新历史

编号 版本 说明 作者 日期
1 v1.0 1.创建文档; GuQiuSheng 2019-08-05

目录


【备注】

1. 转码任务 (Master -> Pod)

接口功能

开启文件分片/转码/合并功能

接口地址

通过K8s的APIServer接口将参数赋值到环境变量

请求参数
参数 必选 类型 说明
taskid Integer ID
jobid Integer ID
action String 任务类型,包括 segment/transcode/transcodeaudio/concatenate
params String Json格式的转码参数,详细信息对应action标识,如下

Segment

参数 必选 类型 说明
FilePath String 源文件地址
Directory String 分片文件存储目录
Num Integer 分片数量
VCodec String 输入视频编码格式
VDuration Integer 输入视频时长
Format String 分片输出封装格式,默认为TS

Transcode

参数 必选 类型 说明
FilePath String 源文件地址
Directory String 转码文件存储目录
iVcodec String 输入视频编码格式
oVcodec String 输出视频编码格式
hw String 硬件编码器
vFramerate Integer 输出视频帧率
vBitrate Integer 输出视频码率
vWidth String 输出视频分辨率宽
vHeight String 输出视频分辨率高

TranscodeAudio

参数 必选 类型 说明
FilePath String 源文件地址
Directory String 转码文件存储目录
aCodec String 输出音频编码格式
aSamplerate Integer 输出音频采样率
aChannelNum Integer 输出音频通道
aBitrate Integer 输出音频码率

Concatenate

参数 必选 类型 说明
filePath String 视频分片文件目录
audioFilePath String 音频文件目录
Directory String 合并文件存储目录
Num Integer 分片数量
Format String 转码后视频文件封装格式
接口示例

{"action":"segment","params":{"filepath":"/mnt/001.flv","directory":"/mnt/video/segout","num":4},"taskid":0,"jobid":0}

2. 转码任务回调 (Pod -> Master)

接口功能

开启文件分片/转码/合并功能

接口地址

/pod/callback

HTTP Content-Type

applicaton/json

HTTP 请求方式

POST

请求参数
参数 必选 类型 说明
taskid Integer ID
jobid Integer ID
action String 任务类型,包括 segment/transcode/transcodeaudio/concatenate
type String 回调的类型,包括 start process complete
success Integer 任务结果(1:success,0:fail)
failreason String 当任务执行失败时返回原因
output String 当action为concatenate时存在,返回最终文件的绝对路径
process Integer 当type=process时存在
HTTP 响应状态
参数 必选 类型 说明
success Boolean 请求结果
接口示例

Request

Response

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注