Skip to content

Commit

Permalink
add:支持动图任务
Browse files Browse the repository at this point in the history
  • Loading branch information
wanjiewu committed Sep 10, 2021
1 parent ff3b327 commit 96b7f6d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ci_media.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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 {
Expand Down
21 changes: 21 additions & 0 deletions example/CI/media_process/media_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Expand Down

0 comments on commit 96b7f6d

Please sign in to comment.