华为云用户手册

  • 为什么签约主体A的发票信息中会有签约主体B的发票? 通常情况下,华为云发票按照不同的签约主体页签展示各签约主体下的发票信息。 示例:如下图所示,“ 华为云计算 技术有限公司”和“华为软件技术有限公司”两个页签分别展示各自的发票。 当某个签约主体下只有欠票或者负向消费发票时: 系统会自动将该签约主体下的发票数据合并到其他签约主体页签下展示。 如果签约主体只有两个,则会隐藏签约主体页签的名称。 其他签约主体发票列表中会展示被合并的签约主体名称。 示例:如下图所示,客户在“华为云计算技术有限公司”和“华为软件技术有限公司”两个签约主体下存在发票。且“华为软件技术有限公司”签约主体下只存在欠票1.50元和负向消费发票88.00元。则: 系统自动将“华为软件技术有限公司”签约主体下的发票数据(欠票和负向消费发票)合并到“华为云计算技术有限公司”签约主体下。 只存在两个签约主体的情况下,签约主体页签均隐藏。 在发票列表中,展示各项发票对应的签约主体信息。 父主题: 发票信息类
  • 错误码表 错误码的格式为:"MPC." +内部错误码。 状态码 错误码 错误信息 描述 处理措施 400 MPC.10089 The template file does not exist. 模板文件不存在 模板文件不存在,请检查 400 MPC.10090 The template file does not exist. 模板文件不存在 模板文件不存在,请检查 400 MPC.10091 The template name already exists. 模板名字重复 模板名字重复,请检查 400 MPC.10202 Invalid request parameter. MPC 请求参数非法 请检查参数是否正确 400 MPC.10204 Incorrect request method. MPC 请求方式不正确 请检查请求方式 400 MPC.10205 Incorrect request content type. MPC 请求内容类型不正确 请检查请求内容类型 400 MPC.10223 An agency has been created. 委托授权已创建 委托授权已创建,请检查 400 MPC.10224 The agency has been deleted. 委托授权已被删除 委托授权已被删除,请检查 400 MPC.10230 The template group already exists. 模板组已存在 模板组已存在,请检查 400 MPC.10231 The template group does not exist. 模板组不存在 模板组不存在,请检查 401 MPC.10203 Identity authentication failed. MPC 认证失败 请检查Token等认证参数是否正确 401 MPC.10206 You have not completed real-name authentication. MPC 用户未实名认证 请检查用户是否实名认证 401 MPC.10207 Your account is in an abnormal state. MPC 用户处于异常状态 请检查用户状态是否正确 401 MPC.10208 Tenant ID verification failed, please check. MPC 租户ID校验失败 请检查租户ID是否正确 403 MPC.10211 The task does not exist. 任务不存在 转码任务不存在,请检查 403 MPC.10212 Operation failed. The task is in progress or has been completed. MPC 操作失败,任务处理中或已经处理完成 任务处理中或已经处理完成,请检查 403 MPC.10214 The topic does not exist. MPC 主题不存在 主题不存在,请检查 403 MPC.10215 The topic already exists. MPC 主题已经存在 主题已经存在,请检查 403 MPC.10226 The resource does not exist. 资源不存在 资源不存在,请检查 403 MPC.10010 Internal error. 服务内部异常,请重试或联系技术工程师 服务内部异常,请重试或联系技术工程师 406 MPC.10051 The selected template is a super-resolution template and is not supported. 所选模板为超分辨率模板,暂不支持 请检查转码模板是否正确 406 MPC.10052 Failed to obtain the input file. 无法获取源文件,请检查路径 无法获取源文件,请检查路径 406 MPC.10053 The input file does not exist. 源文件不存在 源文件不存在,请检查 406 MPC.10054 Failed to obtain the subtitle file. 无法获取字幕文件 无法获取字幕文件,请检查路径 406 MPC.10055 The audio sampling rate 7,350 is not supported. 输出音频AAC时,不支持采样率为7350,请修改 不支持采样率为7350,请修改 406 MPC.10056 This type of output frame rate is not supported. 不支持该类输出帧率 不支持该类输出帧率,请修改 406 MPC.10057 This type of output bitrate is not supported. 不支持该类输出码率 不支持该类输出码率,请修改 406 MPC.10058 This type of output video width is not supported. 不支持该类输出视频宽度 不支持该类输出视频宽度,请修改 406 MPC.10059 This type of output video height is not supported. 不支持该类输出视频高度 不支持该类输出视频高度,请修改 406 MPC.10060 This type of I-frame interval is not supported. 不支持该类输出视频I帧间隔 不支持该类输出视频I帧间隔,请修改 406 MPC.10061 Capturing snapshots at non-fixed intervals is not supported. 不支持非固定时间间隔截图,请修改为固定时间间隔截图 请修改为固定时间间隔截图 406 MPC.10062 Invalid video codec. 截图场景下视频codec错误 截图场景下视频codec错误,请修改 406 MPC.10063 Invalid video format. 截图场景下视频format错误 截图场景下视频format错误,请修改 406 MPC.10064 Multiple watermarks are not supported. 不支持水印多路输入,目前仅支持2路输入 不支持水印多路输入,目前仅支持2路输入,请修改 406 MPC.10065 Invalid output file format. 不支持该类输出文件格式 不支持该类输出文件格式,请检查 406 MPC.10066 The input file format does not match the actual format. 输入文件格式与实际格式不符,请检查 输入文件格式与实际格式不符,请检查 406 MPC.10067 Failed to obtain the ID of the video codec. 获取视频CODEC ID 失败 获取视频CODEC ID 失败,请检查 406 MPC.10068 Failed to obtain the ID of the audio codec. 获取音频CODEC ID 失败 获取音频CODEC ID 失败,请检查 406 MPC.10069 Failed to obtain the ID of the subtitle codec. 获取字幕CODEC ID 失败 获取字幕CODEC ID 失败,请检查 406 MPC.10070 Failed to obtain the encoding/decoding format. 获取编解码格式失败 获取编解码格式失败,请检查 406 MPC.10071 Failed to obtain the parameters of the input video stream. 无法获取输入视频流的相关参数信息 无法获取输入视频流的相关参数信息,请检查 406 MPC.10072 Invalid frame rate of the video stream. 视频流帧率信息错误 视频流帧率信息错误,请检查 406 MPC.10080 Invalid frame rate of the input file. 输入文件视频帧率错误 输入文件视频帧率错误,请检查 406 MPC.10081 The file does not contain audio streams. 文件缺失音频流,请检查输入文件 文件缺失音频流,请检查输入文件 406 MPC.10082 Failed to obtain the input audio or video stream. 无法获取输入视频流(音频或视频),请自检 无法获取输入视频流(音频或视频),请检查 406 MPC.10083 This type of codec is not supported. 不支持该类编码类型 不支持该类编码类型,请检查 406 MPC.10084 This chroma subsampling format is not supported. 不支持此种色度采样格式 不支持此种色度采样格式,请检查 406 MPC.10085 The file format is not supported. 文件格式不支持 文件格式不支持,请检查 406 MPC.10086 Failed to obtain the input file. 无法获取源文件,请检查路径 无法获取源文件,请检查路径 406 MPC.10087 Invalid task parameters. 查询任务参数错误 查询任务参数错误,请检查 406 MPC.10088 The image file does not exist. 图片文件不存在 图片文件不存在,请检查 406 MPC.10092 The image file does not exist. 图片文件不存在 图片文件不存在,请检查 406 MPC.10093 The file name exceeds the maximum length. 文件名过长 文件名过长,请检查 406 MPC.10094 Invalid file format. 文件格式异常 文件格式异常,请检查 406 MPC.10095 The watermark is placed in a wrong position. 水印的位置错误 水印的位置错误,请检查 406 MPC.10096 Invalid watermark size. 水印的大小错误 水印的大小错误,请检查 406 MPC.10097 Invalid watermark scaling ratio. 水印缩放比例错误 水印缩放比例错误,请检查 406 MPC.10098 Invalid watermark duration. 水印持续时长错误 水印持续时长错误,请检查 406 MPC.10099 The media stream type is not supported. 不支持的媒体流类型 不支持的媒体流类型,请检查 406 MPC.10100 An error occurred when parsing the video frame rate information. 解析视频帧率信息错误 解析视频帧率信息错误,请检查 406 MPC.10101 Invalid input parameters. 输入参数错误 输入参数错误,请检查 406 MPC.10102 Failed to open the input file. 源文件打开异常,请检查 源文件打开异常,请检查 406 MPC.10103 Open GOP is not supported. 不支持OPEN GOP素材 不支持OPEN GOP素材,请检查 406 MPC.10104 Internal error. 服务内部异常,请重试或联系技术工程师 服务内部异常,请重试或联系技术工程师 406 MPC.10105 An error occurred during transcoding. 转码进程异常 转码进程异常,请重试或联系技术工程师 406 MPC.10106 The audio sampling rate is lower than 12,000. The audio will be discarded. 音频采样率低于12000,音频被丢弃 音频采样率低于12000,音频被丢弃 406 MPC.10107 Invalid input video resolution. 原始视频分辨率错误 原始视频分辨率错误 406 MPC.10108 The audio sampling rate of the input video is incorrect. 原始视频的音频采样率错误 原始视频的音频采样率错误 406 MPC.10109 Invalid resolution in the template. 模板分辨率错误 模板分辨率错误 406 MPC.10110 The video encoding format of the input file is not supported. 片源视频编码格式特殊,暂不不支持 片源视频编码格式特殊,暂不不支持 406 MPC.10111 Failed to obtain the file from OBS. 获取obs文件失败 获取obs文件失败 406 MPC.10112 The video or audio format of the input file is not supported. 片源的视频或音频格式不支持 片源的视频或音频格式不支持 406 MPC.10113 The DTS of the input file is not supported. 片源的dts异常,暂不支持 片源的dts异常,暂不支持 406 MPC.10114 The header information of the input file is incorrect. 片源文件头信息有误,请检查 片源文件头信息有误,请检查 406 MPC.10115 The watermark cannot be scaled down by more than 256 times. 水印图片缩小倍数超过256倍,暂不支持 水印图片缩小倍数超过256倍,暂不支持 406 MPC.10116 The audio encoding format of the input file is not supported. 片源的音频编码格式,暂不支持 片源的音频编码格式,暂不支持 406 MPC.10117 The audio and video in the input file are not synchronized. 片源的音频和视频不同步 片源的音频和视频不同步 406 MPC.10118 Failed to upload files to the OBS path. 上传文件到obs失败 上传文件到obs失败,请重试或联系技术工程师 406 MPC.10119 Invalid input data. 片源数据无效 片源数据无效,请检查 406 MPC.10120 The task does not exist. 任务不存在 任务不存在,请检查 406 MPC.10121 The subtitle file does not exist. 字幕文件不存在,请检查 字幕文件不存在,请检查 406 MPC.10122 The resolution in the template is greater than the input video resolution. 模板分辨率大于原视频分辨率 模板分辨率大于原视频分辨率,请检查 406 MPC.10123 The header information of the input file is incorrect. 片源文件头信息有误,请检查 片源文件头信息有误,请检查 406 MPC.10124 Some data in the input file are missing. 片源部分数据缺失,请检查片源是否可以完整 片源部分数据缺失,请检查片源是否可以完整 406 MPC.10125 Input data error. 片源数据问题,请检查片源能否播放 片源数据问题,请检查片源能否播放 406 MPC.10126 Input data error. 片源数据问题,请检查片源能否播放 片源数据问题,请检查片源能否播放 406 MPC.10127 Failed to obtain the level-1 m3u8 when an HLS media file is encrypted with DRM. DRM加密,HLS格式获取一级m3u8失败 DRM加密,HLS格式获取一级m3u8失败,请检查 406 MPC.10128 Failed to obtain the level-2 m3u8 when an HLS media file is encrypted with DRM. DRM加密,HLS格式获取二级m3u8失败 DRM加密,HLS格式获取二级m3u8失败,请检查 406 MPC.10129 Failed to obtain the index file when a DASH media file is encrypted with DRM. DRM加密,DASH格式获取索引文件失败 DRM加密,DASH格式获取索引文件失败,请检查 406 MPC.10130 The HLS content fails to be encrypted using DRM. DRM加密,HLS格式加密失败 DRM加密,HLS格式加密失败,请检查 406 MPC.10131 Failed to modify the index file when an HLS media file is encrypted with DRM. DRM加密,HLS格式更新索引文件失败 DRM加密,HLS格式更新索引文件失败,请检查 406 MPC.10132 Failed to obtain the IV during DRM encryption. DRM加密,DASH获取iv失败 DRM加密,DASH获取iv失败,请检查 406 MPC.10133 The DASH content fails to be encrypted using DRM. DRM加密,DASH格式加密失败 DRM加密,DASH格式加密失败,请检查 406 MPC.10134 Failed to modify the index file when a DASH media file is encrypted with DRM. DRM加密,DASH格式更新索引文件失败 DRM加密,DASH格式更新索引文件失败,请检查 406 MPC.10135 Failed to package the digital watermark due to the incorrect xformat configuration. 数字水印转封装失败,配置xformat的错误 数字水印转封装失败,配置xformat的错误,请检查 406 MPC.10136 Failed to package the digital watermark because xformat fails to be started. 数字水印转封装失败,启动xformat失败 数字水印转封装失败,启动xformat失败,请检查 406 MPC.10137 Failed to package the digital watermark because xformat fails to create a task. 数字水印转封装失败,xformat创建task失败 数字水印转封装失败,xformat创建task失败,请检查 406 MPC.10138 Failed to package the digital watermark because xformat fails to query the task. 数字水印转封装失败,xformat查询任务失败 数字水印转封装失败,xformat查询任务失败,请检查 406 MPC.10139 Failed to package the digital watermark because the xformat task timed out. 数字水印转封装失败,xformat任务超时 数字水印转封装失败,xformat任务超时,请重试或联系技术工程师 406 MPC.10140 The I-frame interval exceeds 500. 输出i帧间隔超过500,暂不支持 输出i帧间隔超过500,暂不支持,请修改 406 MPC.10141 The input file is an audio file. The selected template contains video parameters. 片源为纯音频文件,选择模板包含视频参数,暂不支持 片源为纯音频文件,选择模板包含视频参数,请检查 406 MPC.10143 Invalid index file content. 输入的索引文件内容非法 输入的索引文件内容非法 406 MPC.10144 Black bars seem to be on the input video. 无法确定片源黑边的具体位置,片源的四周疑似有黑边,需要对片源进行人工审核 无法确定片源黑边的具体位置,片源的四周疑似有黑边,需要对片源进行人工审核 406 MPC.10145 Data frames imported to the detection module seem to be not enough for identifying the specific position of the black bar. 无法确定片源黑边的具体位置,疑似没有足够的数据帧输入至黑边检测模块,需要对片源进行人工审核 无法确定片源黑边的具体位置,疑似没有足够的数据帧输入至黑边检测模块,需要对片源进行人工审核 406 MPC.10146 The black bar seems to overlap with subtitles. 无法确定片源黑边的具体位置,疑似片源的下黑边和字幕存在重叠,需要对片源进行人工审核 无法确定片源黑边的具体位置,疑似片源的下黑边和字幕存在重叠,需要对片源进行人工审核 406 MPC.10147 The black bar seems to overlap with the watermark. 无法确定片源黑边的具体位置,疑似片源的上黑边和水印存在重叠,需要对片源进行人工审核 无法确定片源黑边的具体位置,疑似片源的上黑边和水印存在重叠,需要对片源进行人工审核 406 MPC.10148 The black bars seem to be asymmetric. 无法确定片源黑边的具体位置,疑似片源的左右黑边不对称,需要对片源进行人工审核 无法确定片源黑边的具体位置,疑似片源的左右黑边不对称,需要对片源进行人工审核 406 MPC.10149 The specific position of the black bar cannot be identified. 无法确定片源黑边的具体位置,需要对片源进行人工审核 无法确定片源黑边的具体位置,需要对片源进行人工审核 406 MPC.10150 The cropped black bar size exceeds the input video size. 强制黑边裁剪值超出原视频大小,请人工审核 强制黑边裁剪值超出原视频大小,请人工审核 406 MPC.10151 Failed to download the subtitle file in the slicing phase. 切片阶段下载字幕文件失败 切片阶段下载字幕文件失败,请检查 406 MPC.10152 The video encoding format of the input file is not supported. 片源视频编码格式特殊,暂不不支持 片源视频编码格式特殊,暂不不支持 406 MPC.10153 Input file error. 片源问题,请确认片源是否能完整播放 片源问题,请确认片源是否能完整播放 406 MPC.10154 Failed to open the input file. 输入文件无法打开,请检查输入片源是否能播放 输入文件无法打开,请检查输入片源是否能播放 406 MPC.10200 System error. MPC 服务异常,通用状态码 请联系工程师解决 406 MPC.10201 Internal communication error. 服务内部通信异常 请联系工程师解决 406 MPC.10209 Invalid input or output OBS path. MPC 对象存储源地址或者目的地址不正确 请检查对象存储源地址或者目的地址 406 MPC.10210 Failed to obtain the input file from OBS. MPC 获取对象存储源文件失败 对象存储源文件获取失败,请检查 406 MPC.10213 Operation failed. The task is not in the final state. MPC 操作失败,任务未进入终态 任务未进入终态,请检查 406 MPC.10216 Failed to set event notifications. You do not have the permission to publish messages to the topic. MPC 设置 消息通知 失败,无权限发布消息到主题 设置消息通知失败,无权限发布消息到主题,请检查 406 MPC.10217 The usage exceeds the OBT quota. MPC 公测限额,用量超过阈值 用量超过阈值,请检查 406 MPC.10218 The task has completed. MPC 任务处理成功 任务处理成功,请检查 406 MPC.10219 Invalid request parameter. 请求参数非法 请求参数非法,请检查 406 MPC.10220 The task has expired. MPC 任务已过期 任务已过期,请检查 406 MPC.10221 Internal service error. 内部服务异常 请检查模板并重试 406 MPC.10222 Key parameters in the template are inconsistent. 自定义模板参数错误 对象存储源文件获取错误,请检查 406 MPC.10225 KMS service error. HW_KMS 服务处理异常 请联系工程师解决 406 MPC.10227 You do not have the permission to access the requested resource. 没有权限访问 没有权限访问,请检查 406 MPC.10228 Your account is in arrears. Top up your account. 用户已冻结,请尽快充值 用户已冻结,请尽快充值 406 MPC.10229 You do not have the permission to perform this operation. 无角色权限执行该的操作 无角色权限执行该的操作,请检查 406 MPC.10232 GIF task failed. gif任务失败 gif任务失败,请检查 406 MPC.10233 Packaging task failed. 转封装任务失败 转封装任务失败,请检查 406 MPC.10234 The function is temporarily brought offline. 功能下线 功能下线,请检查 406 MPC.10235 Identity authentication failed due to an invalid token. 请求Token为Domain级别,Token无效 请检查Token是否正确 406 MPC.10236 You do not have permission to access the OBS bucket. 帐号桶操作无权限 请联系租户管理员进行桶授权或者租户管理员给子帐号赋予OBS权限 406 MPC.10237 API Gateway rate limiting APIGW流控 服务APIGW流控,请检查 500 MPC.10001 IAM service exception. IAM服务处理异常 请联系工程师解决 500 MPC.10002 OBS service exception. OBS服务处理异常 请联系工程师解决 500 MPC.10003 SMN service exception. SMN服务处理异常 请联系工程师解决 500 MPC.10004 CBC service exception. CBC服务处理异常 请联系工程师解决 500 MPC.10005 SDR service exception. SDR服务处理异常 请联系工程师解决 500 MPC.10006 ZK service exception. ZK服务处理异常 请联系工程师解决 500 MPC.10007 MONGO service exception. MONGO服务处理异常 请联系工程师解决 500 MPC.10008 MPE service exception. MPE处理错误 请联系工程师解决 500 MPC.10050 XCODE service exception. XCODE服务处理异常 请联系工程师解决 父主题: 附录
  • 核心代码 1 2 3 4 5 // 向MPC发送取消独立加密任务的请求 DeleteEncryptTaskRequest req = new DeleteEncryptTaskRequest().withTaskId("3223179"); DeleteEncryptTaskResponse rsp = initMpcClient().deleteEncryptTask(req); // 打印返回消息 System.out.println("rsp=" + JsonUtils.toJSON(rsp));
  • 复合查询 1 2 3 4 5 //复合查询 ListThumbnailsTaskRequest req = new ListThumbnailsTaskRequest().withPage(1).withSize(4) .withStartTime("20201220131400") .withEndTime("20201220131400") .withStatus(ListThumbnailsTaskRequest.StatusEnum.FAILED);
  • 分页查询 1 2 3 4 5 6 //分页查询 ListThumbnailsTaskRequest req = new ListThumbnailsTaskRequest().withPage(1).withSize(4); //发送查询截图任务请求给 媒体处理 服务 ListThumbnailsTaskResponse rsp = initMpcClient().listThumbnailsTask(req); //返回消息 System.out.println("rsp=" + JsonUtils.toJSON(rsp));
  • 根据时间段查询 1 2 3 4 5 ListThumbnailsTaskRequest req = new ListThumbnailsTaskRequest().withStartTime("20201220131400").withEndTime("20201220131400"); // 发送查询截图任务请求给媒体处理服务 ListThumbnailsTaskResponse rsp = initMpcClient().listThumbnailsTask(req); // 返回消息 System.out.println("rsp=" + JsonUtils.toJSON(rsp));
  • 根据任务状态查询 1 2 3 4 5 6 // 根据任务的状态查询 ListThumbnailsTaskRequest req = new ListThumbnailsTaskRequest().withStatus(ListThumbnailsTaskRequest.StatusEnum.FAILED); // 发送查询截图任务请求给媒体处理服务 ListThumbnailsTaskResponse rsp = initMpcClient().listThumbnailsTask(req); // 返回消息 System.out.println("rsp=" + JsonUtils.toJSON(rsp));
  • 根据任务ID查询 1 2 3 4 5 6 //根据任务ID查询,最多支持10个任务ID ListThumbnailsTaskRequest req = new ListThumbnailsTaskRequest().withTaskId(Collections.singletonList("2210744")); // 发送查询截图任务请求给媒体处理服务 ListThumbnailsTaskResponse rsp = initMpcClient().listThumbnailsTask(req); // 返回消息 System.out.println("rsp=" + JsonUtils.toJSON(rsp));
  • 核心代码 1 2 3 DeleteAnimatedGraphicsTaskRequest req = new DeleteAnimatedGraphicsTaskRequest().withTaskId("3198527"); DeleteAnimatedGraphicsTaskResponse rsp = initMpcClient().deleteAnimatedGraphicsTask(req); System.out.println("rsp=" + JsonUtils.toJSON(rsp));
  • 核心代码 1 2 3 4 5 //设置删除转码模板ID,发送删除转码模板请求 DeleteTemplateRequest req = new DeleteTemplateRequest().withTemplateId(346090L); DeleteTemplateResponse rsp = initMpcClient().deleteTemplate(req); //返回消息 System.out.println("rsp=" + JsonUtils.toJSON(rsp) + " httpCode=" + rsp.getHttpStatusCode());
  • 分页查询 1 2 3 4 5 6 // 分页查询 ListExtractTaskRequest req = new ListExtractTaskRequest().withPage(0).withSize(10); // 发送查询请求给媒体处理服务 ListExtractTaskResponse rsp = initMpcClient().listExtractTask(req); // 打印返回消息 System.out.println("rsp=" + rsp.toString());
  • 根据时间段查询 1 2 3 4 5 6 // 根据时间段查询 ListExtractTaskRequest req = new ListExtractTaskRequest().withStartTime("20201220131400").withEndTime("20201221131400"); // 发送查询请求给媒体处理服务 ListExtractTaskResponse rsp = initMpcClient().listExtractTask(req); // 打印返回消息 System.out.println("rsp=" + rsp.toString());
  • 根据任务状态查询 1 2 3 4 5 6 // 根据任务的状态查询 ListExtractTaskRequest req = new ListExtractTaskRequest().withStatus(ListExtractTaskRequest.StatusEnum.FAILED); // 发送查询请求给媒体处理服务 ListExtractTaskResponse rsp = initMpcClient().listExtractTask(req); // 打印返回消息 System.out.println("rsp=" + rsp.toString());
  • 复合查询 1 2 3 4 5 6 7 8 // 复合查询 ListExtractTaskRequest req = new ListExtractTaskRequest().withPage(0).withSize(10) .withStartTime("20201220131400").withEndTime("20201221131400") .withStatus(ListExtractTaskRequest.StatusEnum.FAILED); // 发送查询请求给媒体处理服务 ListExtractTaskResponse rsp = initMpcClient().listExtractTask(req); // 打印返回消息 System.out.println("rsp=" + rsp.toString());
  • 根据任务ID查询 1 2 3 4 5 6 // 根据任务ID查询,最多支持10个任务ID ListExtractTaskRequest req = new ListExtractTaskRequest().withTaskId(Collections.singletonList("3223182")); // 发送查询请求给媒体处理服务 ListExtractTaskResponse rsp = initMpcClient().listExtractTask(req); // 打印返回消息 System.out.println("rsp=" + rsp.toString());
  • 核心代码 创建转封装任务。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 //设置转封装输入视频地址和输出路径 ObsObjInfo input = new ObsObjInfo().withBucket("mpc-east-2").withLocation("region01").withObject("ok.flv"); ObsObjInfo output = new ObsObjInfo().withBucket("mpc-east-2").withLocation("region01").withObject("output"); //创建转封装请求 CreateRemuxTaskRequest req = new CreateRemuxTaskRequest() .withBody(new CreateRemuxTaskReq().withInput(input).withOutput(output) // 设置转封装参数 .withOutputParam(new RemuxOutputParam() //设置转封装格式 .withFormat("HLS") //转成hls切片间隔 .withSegmentDuration(5))); //发送转封装请求 CreateRemuxTaskResponse rsp = initMpcClient().createRemuxTask(req); System.out.println(rsp.toString())
  • SDK介绍 媒体处理SDK提供了创建转码任务、取消转码任务、查询转码任务、创建转码配置模板、删除转码配置模板、更新转码配置模板、查询转码配置模板等。 目前暂提供了JAVA、Python和Go三种语言SDK,若您有其它开发语言的需求,建议您通过媒体处理API进行调用。 媒体处理SDK代码不支持转义。 表1 服务端SDK 语言 Github地址 参考文档 JAVA huaweicloud-sdk-java-v3 Java SDK使用指导 Python huaweicloud-sdk-python-v3 Python SDK使用指导 Go huaweicloud-sdk-go-v3 Go SDK使用指导
  • 核心代码 1 2 3 4 5 // 发送删除水印配置模板请求给媒体处理服务 DeleteWatermarkTemplateRequest req = new DeleteWatermarkTemplateRequest().withTemplateId(215728); DeleteWatermarkTemplateResponse rsp = initMpcClient().deleteWatermarkTemplate(req); // 打印返回消息 System.out.println("httpCode=" + rsp.getHttpStatusCode() + ", rsp=" + JsonUtils.toJSON(rsp));
  • 获取AK和SK 注意:访问密钥对帐号具有完全的访问权限,如果访问密钥泄露,会带来数据泄露风险,为了帐号安全性,建议您定期更换并妥善保存访问密钥。每个帐号最多只能创建2个密钥。 登录管理控制台。 鼠标移动至用户名,在下拉列表中单击“我的凭证”。 在左侧导航栏中选择“访问密钥”。 单击“新增访问密钥”,在弹出的页面中输入帐号密码及短信验证码。 图1 访问密钥 单击“确定”,即可下载一个命名为“credentials.csv”的文件,其中包含AK和SK。
  • 查询单个转码任务 1 2 3 4 5 //按单个TaskId查询任务,TaskId是转码请求响应中返回的任务ID ListTranscodingTaskRequest req = new ListTranscodingTaskRequest().withTaskId(Collections.singletonList(3273178L)); //发送请求 ListTranscodingTaskResponse listTranscodingTaskResponse = initMpcClient().listTranscodingTask(req); System.out.println(JsonUtils.toJSON(listTranscodingTaskResponse));
  • 查询多个转码任务 1 2 3 4 5 //按多个TaskId查询任务,TaskId是转码请求响应中返回的任务ID ListTranscodingTaskRequest req = new ListTranscodingTaskRequest().withTaskId(Arrays.asList(3273178L, 3273179L)); //发送请求 ListTranscodingTaskResponse listTranscodingTaskResponse = initMpcClient().listTranscodingTask(req); System.out.println(JsonUtils.toJSON(listTranscodingTaskResponse));
  • 根据开始时间和结束时间查询 1 2 3 4 5 //根据转码任务开始和结束时间查询 ListTranscodingTaskRequest req = new ListTranscodingTaskRequest().withStartTime("20210401001517").withEndTime("20210402081517"); //发送请求 ListTranscodingTaskResponse listTranscodingTaskResponse = initMpcClient().listTranscodingTask(req); System.out.println(JsonUtils.toJSON(listTranscodingTaskResponse));
  • 根据页码查询 1 2 3 4 5 //根据页码和每页条数查询 ListTranscodingTaskRequest req = new ListTranscodingTaskRequest().withPage(0).withSize(4); //发送请求 ListTranscodingTaskResponse listTranscodingTaskResponse = initMpcClient().listTranscodingTask(req); System.out.println(JsonUtils.toJSON(listTranscodingTaskResponse));
  • 根据状态查询 1 2 3 4 5 //按状态查询任务 ListTranscodingTaskRequest req = new ListTranscodingTaskRequest().withStatus("FAILED"); //发送请求 ListTranscodingTaskResponse listTranscodingTaskResponse = initMpcClient().listTranscodingTask(req); System.out.println(JsonUtils.toJSON(listTranscodingTaskResponse));
  • 核心代码 设置水印模板的参数。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 //创建水印模板请求 CreateWatermarkTemplateRequest req = new CreateWatermarkTemplateRequest() .withBody(new WatermarkTemplate() //设置模板名称 .withTemplateName("watermark_name") //设置模板类型 .withType("Image") //设置图片水印处理方式 .withImageProcess("Grayed") //水印宽度 .withWidth("1920") //水印高度 .withHeight("1080") //水印相对视频顶点水平偏移位置 .withDx("10") //水印相对视频顶点垂直偏移位置 .withDy("10") //水印的位置 //.withReferpos("BottomLeft") //水印开始时间,与timeline_duration配合使用 .withTimelineStart("6") //水印持续时间,默认值“ToEND”,表示持续到视频结束 .withTimelineDuration("8")); 发送新建水印模板请求,并显示返回消息。 1 2 3 4 // 发送新建水印模板请求给媒体处理服务 CreateWatermarkTemplateResponse rsp = initMpcClient().createWatermarkTemplate(req); // 打印返回消息 System.out.println("CreateWatermarkTemplateResponse=" + JsonUtils.toJSON(rsp));
  • 核心代码 创建动图任务。 动图任务需要设置输入视频文件、输出动图路径、动图帧率、动图宽高等参数。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 //设置输入视频地址和输出路径 ObsObjInfo input = new ObsObjInfo().withBucket("mpc-east-2").withLocation("region01").withObject("ok.mp4"); ObsObjInfo output = new ObsObjInfo().withBucket("mpc-east-2").withLocation("region01").withObject("output"); //创建动图请求 CreateAnimatedGraphicsTaskRequest req = new CreateAnimatedGraphicsTaskRequest() .withBody(new CreateAnimatedGraphicsTaskReq().withInput(input).withOutput(output) .withOutputParam(new AnimatedGraphicsOutputParam() //设置动图格式 .withFormat(AnimatedGraphicsOutputParam.FormatEnum.GIF) //设置动图帧率 .withFrameRate(15) //设置起始时间,单位毫秒 .withStart(0) //设置结束时间,单位毫秒,最大时间间隔60s .withEnd(3_000))); // 发起请求 CreateAnimatedGraphicsTaskResponse rsp = initMpcClient().createAnimatedGraphicsTask(req); // 打印结果 System.out.println("CreateAnimatedGraphicsTaskResponse=" + JsonUtils.toJSON(rsp));
  • 分页查询 1 2 3 4 5 6 // 分页查询 ListEncryptTaskRequest req = new ListEncryptTaskRequest().withPage(1).withSize(4); // 向MPC发送查询独立加密任务的请求 ListEncryptTaskResponse rsp = initMpcClient().listEncryptTask(req); // 打印返回消息 System.out.println(rsp.toString());
  • 根据任务ID查询 1 2 3 4 5 6 //根据任务ID查询,最多支持10个任务ID ListEncryptTaskRequest req = new ListEncryptTaskRequest().withTaskId(Collections.singletonList("3223179")); // 向MPC发送查询独立加密任务的请求 ListEncryptTaskResponse rsp = initMpcClient().listEncryptTask(req); // 打印返回消息 System.out.println(rsp.toString());
  • 根据任务状态查询 1 2 3 4 5 6 // 根据任务的状态查询 ListEncryptTaskRequest req = new ListEncryptTaskRequest().withStatus(ListEncryptTaskRequest.StatusEnum.FAILED); // 向MPC发送查询独立加密任务的请求 ListEncryptTaskResponse rsp = initMpcClient().listEncryptTask(req); // 打印返回消息 System.out.println(rsp.toString());
  • 根据时间段查询 1 2 3 4 5 6 // 根据时间段查询 ListEncryptTaskRequest req = new ListEncryptTaskRequest().withStartTime("20201220131400").withEndTime("20201221131400"); // 向MPC发送查询独立加密任务的请求 ListEncryptTaskResponse rsp = initMpcClient().listEncryptTask(req); // 打印返回消息 System.out.println(rsp.toString());
共100000条