@@ -448,7 +448,13 @@ type Subtitles struct {
448448
449449// Subtitle TODO
450450type Subtitle struct {
451- Url []Subtitle `xml:"Url,omitempty"`
451+ Url string `xml:"Url,omitempty"`
452+ Embed string `xml:"Embed,omitempty"`
453+ FontType string `xml:"FontType,omitempty"`
454+ FontSize string `xml:"FontSize,omitempty"`
455+ FontColor string `xml:"FontColor,omitempty"`
456+ OutlineColor string `xml:"OutlineColor,omitempty"`
457+ VMargin string `xml:"VMargin,omitempty"`
452458}
453459
454460// VideoTag TODO
@@ -753,6 +759,9 @@ type MediaProcessJobOperation struct {
753759 VocalScoreResult * VocalScoreResult `xml:"VocalScoreResult,omitempty"`
754760 ImageInspect * ImageInspect `xml:"ImageInspect,omitempty"`
755761 ImageInspectResult * ImageInspectResult `xml:"ImageInspectResult,omitempty"`
762+ SnapshotPrefix string `xml:"SnapshotPrefix,omitempty"`
763+ ImageOCR * ImageOCRTemplate `xml:"ImageOCR,omitempty"`
764+ Detection * ImageOCRDetection `xml:"Detection,omitempty"`
756765}
757766
758767// CreatePicJobsOptions TODO
@@ -887,11 +896,12 @@ type WorkflowExecutionNotifyBody struct {
887896 ObjectCount int `xml:"ObjectCount"`
888897 SpriteObjectCount int `xml:"SpriteObjectCount"`
889898 ObjectInfo []struct {
890- ObjectName string `xml:"ObjectName"`
891- ObjectUrl string `xml:"ObjectUrl"`
892- InputObjectName string `xml:"InputObjectName"`
893- Code string `xml:"Code"`
894- Message string `xml:"Message"`
899+ ObjectName string `xml:"ObjectName"`
900+ ObjectUrl string `xml:"ObjectUrl"`
901+ InputObjectName string `xml:"InputObjectName"`
902+ Code string `xml:"Code"`
903+ Message string `xml:"Message"`
904+ ImageOcrResult * ImageOCRDetection `xml:"ImageOcrResult,omitempty"`
895905 } `xml:"ObjectInfo,omitempty"`
896906 SpriteObjectInfo []struct {
897907 ObjectName string `xml:"ObjectName"`
@@ -1731,6 +1741,9 @@ type NodeOperation struct {
17311741 Condition * WorkflowNodeCondition `xml:"Condition,omitempty" json:"Condition,omitempty"`
17321742 SegmentVideoBody * SegmentVideoBody `xml:"SegmentVideoBody,omitempty" json:"SegmentVideoBody,omitempty"`
17331743 ImageInspect * ImageInspect `xml:"ImageInspect,omitempty" json:"ImageInspect,omitempty"`
1744+ TranscodeConfig * struct {
1745+ FreeTranscode string `xml:"FreeTranscode,omitempty" json:"FreeTranscode,omitempty"`
1746+ } `xml:"TranscodeConfig,omitempty" json:"TranscodeConfig,omitempty"`
17341747}
17351748
17361749// Node TODO
@@ -2327,6 +2340,7 @@ type Template struct {
23272340 NoiseReduction * NoiseReduction `xml:"NoiseReduction,omitempty" json:"NoiseReduction,omitempty"`
23282341 VideoEnhance * VideoEnhance `xml:"VideoEnhance,omitempty" json:"VideoEnhance,omitempty"`
23292342 VideoTargetRec * VideoTargetRec `xml:"VideoTargetRec,omitempty" json:"VideoTargetRec,omitempty"`
2343+ ImageOCR * ImageOCRTemplate `xml:"ImageOCR,omitempty" json:"ImageOCR,omitempty"`
23302344}
23312345
23322346// CreateMediaSnapshotTemplate 创建截图模板
@@ -3072,6 +3086,7 @@ type InventoryTriggerJobOperation struct {
30723086 Tag string `xml:"Tag,omitempty"`
30733087 JobParam * InventoryTriggerJobOperationJobParam `xml:"JobParam,omitempty"`
30743088 Output * JobOutput `xml:"Output,omitempty"`
3089+ FreeTranscode string `xml:"FreeTranscode,omitempty"`
30753090}
30763091
30773092// InventoryTriggerJobOperationJobParam TODO
@@ -3110,6 +3125,8 @@ type InventoryTriggerJobOperationJobParam struct {
31103125 VocalScoreResult * VocalScoreResult `xml:"VocalScoreResult,omitempty"`
31113126 ImageInspect * ImageInspect `xml:"ImageInspect,omitempty"`
31123127 ImageInspectResult * ImageInspectResult `xml:"ImageInspectResult,omitempty"`
3128+ ImageOCR * ImageOCRTemplate `xml:"ImageOCR,omitempty"`
3129+ Detection * ImageOCRDetection `xml:"Detection,omitempty"`
31133130}
31143131
31153132// InventoryTriggerJob TODO
@@ -3711,3 +3728,120 @@ func (s *CIService) CosImageInspect(ctx context.Context, name string, opt *CosIm
37113728 resp , err := s .client .send (ctx , & sendOpt )
37123729 return & res , resp , err
37133730}
3731+
3732+ // CreateOCRTemplateOptions TODO
3733+ type CreateOCRTemplateOptions struct {
3734+ XMLName xml.Name `xml:"Request"`
3735+ Tag string `xml:"Tag,omitempty"`
3736+ Name string `xml:"Name,omitempty"`
3737+ ImageOCR * ImageOCRTemplate `xml:"ImageOCR,omitempty" json:"ImageOCR,omitempty"`
3738+ }
3739+
3740+ // ImageOCRTemplate TODO
3741+ type ImageOCRTemplate struct {
3742+ Type string `xml:"Type,omitempty"`
3743+ LanguageType string `xml:"LanguageType,omitempty"`
3744+ IsPdf string `xml:"IsPdf,omitempty"`
3745+ PdfPageNumber string `xml:"PdfPageNumber,omitempty"`
3746+ IsWord string `xml:"IsWord,omitempty"`
3747+ EnableWordPolygon string `xml:"EnableWordPolygon,omitempty"`
3748+ }
3749+
3750+ // CreateOCRTemplate 创建OCR模板
3751+ func (s * CIService ) CreateOCRTemplate (ctx context.Context , opt * CreateOCRTemplateOptions ) (* CreateMediaTemplateResult , * Response , error ) {
3752+ var res CreateMediaTemplateResult
3753+ sendOpt := sendOptions {
3754+ baseURL : s .client .BaseURL .CIURL ,
3755+ uri : "/template" ,
3756+ method : http .MethodPost ,
3757+ body : opt ,
3758+ result : & res ,
3759+ }
3760+ resp , err := s .client .send (ctx , & sendOpt )
3761+ return & res , resp , err
3762+ }
3763+
3764+ // UpdateOCRTemplate 更新OCR模板
3765+ func (s * CIService ) UpdateOCRTemplate (ctx context.Context , opt * CreateOCRTemplateOptions , templateId string ) (* CreateMediaTemplateResult , * Response , error ) {
3766+ var res CreateMediaTemplateResult
3767+ sendOpt := sendOptions {
3768+ baseURL : s .client .BaseURL .CIURL ,
3769+ uri : "/template/" + templateId ,
3770+ method : http .MethodPut ,
3771+ body : opt ,
3772+ result : & res ,
3773+ }
3774+ resp , err := s .client .send (ctx , & sendOpt )
3775+ return & res , resp , err
3776+ }
3777+
3778+ // ImageOCRDetection TODO
3779+ type ImageOCRDetection struct {
3780+ InputObjectName string `xml:"InputObjectName,omitempty"`
3781+ InputObjectUrl string `xml:"InputObjectUrl,omitempty"`
3782+ ObjectName string `xml:"ObjectName,omitempty"`
3783+ ObjectUrl string `xml:"ObjectUrl,omitempty"`
3784+ Code string `xml:"Code,omitempty"`
3785+ State string `xml:"State,omitempty"`
3786+ Message string `xml:"Message,omitempty"`
3787+ TextDetections []ImageOCRTextDetections `xml:"TextDetections,omitempty"`
3788+ Language string `xml:"Language,omitempty"`
3789+ Angel string `xml:"Angel,omitempty"`
3790+ PdfPageSize int `xml:"PdfPageSize,omitempty"`
3791+ }
3792+
3793+ // ImageOCRTextDetections TODO
3794+ type ImageOCRTextDetections struct {
3795+ DetectedText string `xml:"DetectedText,omitempty"`
3796+ Confidence int `xml:"Confidence,omitempty"`
3797+ Polygon []ImageOCRTextPolygon `xml:"Polygon,omitempty"`
3798+ ItemPolygon []ImageOCRTextItemPolygon `xml:"ItemPolygon,omitempty"`
3799+ Words []ImageOCRTextWords `xml:"Words,omitempty"`
3800+ WordPolygon []ImageOCRTextWordPolygon `xml:"WordPolygon,omitempty"`
3801+ }
3802+
3803+ // ImageOCRTextPolygon TODO
3804+ type ImageOCRTextPolygon struct {
3805+ X int `xml:"X,omitempty"`
3806+ Y int `xml:"Y,omitempty"`
3807+ }
3808+
3809+ // ImageOCRTextItemPolygon TODO
3810+ type ImageOCRTextItemPolygon struct {
3811+ X int `xml:"X,omitempty"`
3812+ Y int `xml:"Y,omitempty"`
3813+ Width int `xml:"Width,omitempty"`
3814+ Height int `xml:"Height,omitempty"`
3815+ }
3816+
3817+ // ImageOCRTextWords TODO
3818+ type ImageOCRTextWords struct {
3819+ Confidence int `xml:"Confidence,omitempty"`
3820+ Character string `xml:"Character,omitempty"`
3821+ WordCoordPoint []struct {
3822+ WordCoordinate []struct {
3823+ X int `xml:"X,omitempty"`
3824+ Y int `xml:"Y,omitempty"`
3825+ } `xml:"WordCoordinate,omitempty"`
3826+ } `xml:"WordCoordPoint,omitempty"`
3827+ }
3828+
3829+ // ImageOCRTextWordPolygon TODO
3830+ type ImageOCRTextWordPolygon struct {
3831+ LeftTop []struct {
3832+ X int `xml:"X,omitempty"`
3833+ Y int `xml:"Y,omitempty"`
3834+ } `xml:"LeftTop,omitempty"`
3835+ RightTop []struct {
3836+ X int `xml:"X,omitempty"`
3837+ Y int `xml:"Y,omitempty"`
3838+ } `xml:"RightTop,omitempty"`
3839+ LeftBottom []struct {
3840+ X int `xml:"X,omitempty"`
3841+ Y int `xml:"Y,omitempty"`
3842+ } `xml:"LeftBottom,omitempty"`
3843+ RightBottom []struct {
3844+ X int `xml:"X,omitempty"`
3845+ Y int `xml:"Y,omitempty"`
3846+ } `xml:"RightBottom,omitempty"`
3847+ }
0 commit comments