@sewise-dev
2019-09-18T03:20:25.000000Z
字数 1646
阅读 603
transcode
api
编号 | 版本 | 说明 | 作者 | 日期 |
---|---|---|---|---|
1 | v1.0 | 1.创建文档; | GuQiuSheng | 2019-08-05 |
开启文件分片/转码/合并功能
通过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}
开启文件分片/转码/合并功能
/pod/callback
applicaton/json
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时存在
参数 必选 类型 说明 success 是 Boolean 请求结果
Request
Response