From 96b7f6d79015704a4cae2bcf153eb601b290cf0c Mon Sep 17 00:00:00 2001 From: wanjiewu Date: Fri, 10 Sep 2021 20:49:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?add:=E6=94=AF=E6=8C=81=E5=8A=A8=E5=9B=BE?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ci_media.go | 19 +++++++++++++++++++ example/CI/media_process/media_process.go | 21 +++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/ci_media.go b/ci_media.go index bece15f..bca31b3 100644 --- a/ci_media.go +++ b/ci_media.go @@ -118,6 +118,24 @@ type Snapshot struct { Width string `xml:"Width,omitempty"` Height string `xml:"Height,omitempty"` } + +type AnimationVideo struct { + Codec string `xml:"Codec"` + Width string `xml:"Width"` + Height string `xml:"Height"` + Fps string `xml:"Fps"` + AnimateOnlyKeepKeyFrame string `xml:"AnimateOnlyKeepKeyFrame,omitempty"` + AnimateTimeIntervalOfFrame string `xml:"AnimateTimeIntervalOfFrame,omitempty"` + AnimateFramesPerSecond string `xml:"AnimateFramesPerSecond,omitempty"` + Quality string `xml:"Quality,omitempty"` +} + +type Animation struct { + Container *Container `xml:"Container,omitempty"` + Video *AnimationVideo `xml:"Video,omitempty"` + TimeInterval *TimeInterval `xml:"TimeInterval,omitempty"` +} + type MediaProcessJobOperation struct { Tag string `xml:"Tag,omitempty"` Output *JobOutput `xml:"Output,omitempty"` @@ -127,6 +145,7 @@ type MediaProcessJobOperation struct { WatermarkTemplateId []string `xml:"WatermarkTemplateId,omitempty"` ConcatTemplate *ConcatTemplate `xml:"ConcatTemplate,omitempty"` Snapshot *Snapshot `xml:"Snapshot,omitempty"` + Animation *Animation `xml:"Animation,omitempty"` } type CreateMediaJobsOptions struct { diff --git a/example/CI/media_process/media_process.go b/example/CI/media_process/media_process.go index 153abfc..0d2dafd 100644 --- a/example/CI/media_process/media_process.go +++ b/example/CI/media_process/media_process.go @@ -291,6 +291,27 @@ func InvokeMultiTasks() { }, }, }, + cos.MediaProcessJobOperation{ + Tag: "Animation", + Output: &cos.JobOutput{ + Region: "ap-chongqing", + Object: "output/go_117374C.gif", + Bucket: "wwj-cq-1253960454", + }, + Animation: &cos.Animation{ + Container: &cos.Container{ + Format: "gif", + }, + Video: &cos.AnimationVideo{ + Codec: "gif", + AnimateOnlyKeepKeyFrame: "true", + }, + TimeInterval: &cos.TimeInterval{ + Start: "0", + Duration: "", + }, + }, + }, }, QueueId: "paaf4fce5521a40888a3034a5de80f6ca", } From 0263d6a6394a80c87a7c1c1507e048bdeffb15d5 Mon Sep 17 00:00:00 2001 From: wanjiewu Date: Fri, 10 Sep 2021 20:53:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?add:xml=E5=8F=AF=E8=A7=81=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ci_media.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ci_media.go b/ci_media.go index bca31b3..ea11f69 100644 --- a/ci_media.go +++ b/ci_media.go @@ -119,15 +119,16 @@ type Snapshot struct { Height string `xml:"Height,omitempty"` } +// 有意和转码区分,两种任务关注的参数不一样避免干扰 type AnimationVideo struct { Codec string `xml:"Codec"` Width string `xml:"Width"` Height string `xml:"Height"` Fps string `xml:"Fps"` - AnimateOnlyKeepKeyFrame string `xml:"AnimateOnlyKeepKeyFrame,omitempty"` - AnimateTimeIntervalOfFrame string `xml:"AnimateTimeIntervalOfFrame,omitempty"` - AnimateFramesPerSecond string `xml:"AnimateFramesPerSecond,omitempty"` - Quality string `xml:"Quality,omitempty"` + AnimateOnlyKeepKeyFrame string `xml:"AnimateOnlyKeepKeyFrame"` + AnimateTimeIntervalOfFrame string `xml:"AnimateTimeIntervalOfFrame"` + AnimateFramesPerSecond string `xml:"AnimateFramesPerSecond"` + Quality string `xml:"Quality"` } type Animation struct {