You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
813 B
33 lines
813 B
# 视频处理
|
|
module AliyunVod::Service::VideoProcess
|
|
# 提交媒体截图作业
|
|
def submit_snapshot_job(video_id, **opts)
|
|
params = {
|
|
Action: 'SubmitSnapshotJob',
|
|
VideoId: video_id
|
|
}.merge(base_params)
|
|
params = opts.merge(params)
|
|
|
|
result = request(:post, params)
|
|
|
|
raise AliyunVod::Error, '提交媒体截图作业失败' if result['SnapshotJob'].blank?
|
|
|
|
result
|
|
end
|
|
|
|
# 提交视频转码任务
|
|
def submit_transcode_job(video_id, group_id, **opts)
|
|
params = {
|
|
Action: 'SubmitTranscodeJobs',
|
|
VideoId: video_id,
|
|
TemplateGroupId: group_id
|
|
}.merge(base_params)
|
|
params = opts.merge(params)
|
|
|
|
result = request(:post, params)
|
|
|
|
raise AliyunVod::Error, '提交视频转码作业失败' if result['TranscodeJobs'].blank?
|
|
|
|
result
|
|
end
|
|
end |