api

package
v0.9.152 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MEDIA_PREFIX    = bce.URI_PREFIX + "v3/"
	PIPLINE         = "pipeline"
	TRANSCODING_JOB = "job/transcoding"
	PRESET          = "preset"
	MEDIA_INFO      = "mediainfo"
	THUMBNAIL       = "job/thumbnail"
	WATERMARK       = "watermark"
	NOTIFICATION    = "notification"
)

Variables

This section is empty.

Functions

func CreateNotification

func CreateNotification(cli bce.Client, name, endpoint string) error

func CreatePipeline

func CreatePipeline(cli bce.Client, pipelineName, sourceBucket, targetBucket string, capacity int) error

func CreatePipelineCustomize

func CreatePipelineCustomize()

func CreatePreset

func CreatePreset(cli bce.Client, presetName, description, container string) error

func CreatePrestCustomize

func CreatePrestCustomize(cli bce.Client, preset *Preset) error

func DeleteNotification

func DeleteNotification(cli bce.Client, name string) error

func DeletePipeline

func DeletePipeline(cli bce.Client, pipelineName string) error

func DeleteWaterMark

func DeleteWaterMark(cli bce.Client, watermarkId string) error

func UpdatePipeline

func UpdatePipeline(cli bce.Client, pipelineName string, updatePipelineArgs *UpdatePipelineArgs) error

func UpdatePreset

func UpdatePreset(cli bce.Client, preset *Preset) error

Types

type Area

type Area struct {
	X      int `json:"x,omitempty"`
	Y      int `json:"y,omitempty"`
	Width  int `json:"width,omitempty"`
	Height int `json:"height,omitempty"`
}

type Audio

type Audio struct {
	BitRateInBps   int           `json:"bitRateInBps,omitempty"`
	SampleRateInHz int           `json:"sampleRateInHz,omitempty"`
	Channels       int           `json:"channels,omitempty"`
	PcmFormat      string        `json:"pcmFormat,omitempty"`
	VolumeAdjust   *VolumeAdjust `json:"volumeAdjust,omitempty"`
	Codec          string        `json:"code,omitemptyc"`
}

type AudioInfo

type AudioInfo struct {
	Codec          string `json:"codec"`
	Channels       int    `json:"channels"`
	SampleRateInHz int    `json:"sampleRateInHz"`
	BitRateInBps   int    `json:"bitRateInBps"`
}

type Clip

type Clip struct {
	StartTimeInSecond int `json:"startTimeInSecond,omitempty"`
	DurationInSecond  int `json:"durationInSecond,omitempty"`
}

type CodecOptions

type CodecOptions struct {
	Profile string `json:"profile,omitempty"`
}

type CreateJobArgs

type CreateJobArgs struct {
	PipelineName string  `json:"pipelineName,omitempty"`
	Source       *Source `json:"source"`
	Target       *Target `json:"target"`
}

type CreateJobResponse

type CreateJobResponse struct {
	JobId string `json:"jobId"`
}

func CreateJob

func CreateJob(cli bce.Client, pipelineName, sourceKey, targetKey, presetName string) (*CreateJobResponse, error)

func CreateJobCustomize

func CreateJobCustomize(cli bce.Client, args *CreateJobArgs) (*CreateJobResponse, error)

func CreateThumbnailJob

func CreateThumbnailJob(cli bce.Client, pipelineName, sourceKey string, createThumbnialArgs *CreateThumbnailJobArgs) (
	*CreateJobResponse, error)

type CreateNotificationArgs

type CreateNotificationArgs struct {
	Name     string `json:"name,omitempty"`
	Endpoint string `json:"endpoint,omitempty"`
}

func GetNotification

func GetNotification(cli bce.Client, name string) (*CreateNotificationArgs, error)

type CreatePiplineArgs

type CreatePiplineArgs struct {
	PipelineName string               `json:"pipelineName"`
	Description  string               `json:"description,omitempty"`
	SourceBucket string               `json:"sourceBucket"`
	TargetBucket string               `json:"targetBucket"`
	Config       *CreatePiplineConfig `json:"config"`
}

create pipline args

type CreatePiplineConfig

type CreatePiplineConfig struct {
	Capacity     int    `json:"capacity"`
	Notification string `json:"notification,omitempty"`
	PipelineType string `json:"pipelineType,omitempty"`
}

type CreateThumbnailJobArgs

type CreateThumbnailJobArgs struct {
	PipelineName     string            `json:"pipelineName,omitempty"`
	ThumbnailSource  *ThumbnailSource  `json:"source"`
	PresetName       string            `json:"presetName,omitempty"`
	ThumbnailTarget  *ThumbnailTarget  `json:"target,omitempty"`
	ThumbnailCapture *ThumbnailCapture `json:"capture,omitempty"`
	Area             *Area             `json:"delogoArea,omitempty"`
	Crop             *Area             `json:"crop,omitempty"`
}

type CreateWaterMarkArgs

type CreateWaterMarkArgs struct {
	Bucket                  string    `json:"bucket,omitempty"`
	Key                     string    `json:"key,omitempty"`
	VerticalAlignment       string    `json:"verticalAlignment,omitempty"`
	HorizontalAlignment     string    `json:"horizontalAlignment,omitempty"`
	VerticalOffsetInPixel   int       `json:"verticalOffsetInPixel,omitempty"`
	HorizontalOffsetInPixel int       `json:"horizontalOffsetInPixel,omitempty"`
	Timeline                *Timeline `json:"timeline,omitempty"`
	Repeated                int       `json:"repeated,omitempty"`
	AllowScaling            bool      `json:"allowScaling,omitempty"`
	Dx                      string    `json:"dx,omitempty"`
	Dy                      string    `json:"dy,omitempty"`
	Width                   string    `json:"width,omitempty"`
	Height                  string    `json:"height,omitempty"`
}

type CreateWaterMarkResponse

type CreateWaterMarkResponse struct {
	WatermarkId string `json:"watermarkId"`
}

func CreateWaterMark

func CreateWaterMark(cli bce.Client, watermark *CreateWaterMarkArgs) (*CreateWaterMarkResponse, error)

type Encryption

type Encryption struct {
	Strategy     string `json:"strategy,omitempty"`
	AesKey       string `json:"aesKey,omitempty"`
	KeyServerURL string `json:"keyServerUrl,omitempty"`
}

type Error

type Error struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type ExtraCfg

type ExtraCfg struct {
	WatermarkDisableWhitelist []string `json:"watermarkDisableWhitelist,omitempty"`
	SegmentDurationInSecond   float64  `json:"segmentDurationInSecond,omitempty"`
	GopLength                 int      `json:"gopLength,omitempty"`
	SkipBlackFrame            bool     `json:"skipBlackFrame,omitempty"`
}

type Font

type Font struct {
	Family      string `json:"family,omitempty"`
	SizeInPoint int    `json:"sizeInPoint,omitempty"`
}

type GetMediaInfoOfFileResponse

type GetMediaInfoOfFileResponse struct {
	Bucket                string     `json:"bucket"`
	Key                   string     `json:"key"`
	FileSizeInByte        int        `json:"fileSizeInByte"`
	Container             string     `json:"container"`
	DurationInSecond      int        `json:"durationInSecond"`
	DurationInMillisecond int        `json:"durationInMillisecond"`
	Etag                  string     `json:"etag"`
	Type                  string     `json:"type"`
	VideoInfo             *VideoInfo `json:"video"`
	AudioInfo             *AudioInfo `json:"audio"`
}

func GetMediaInfoOfFile

func GetMediaInfoOfFile(cli bce.Client, bucket, key string) (*GetMediaInfoOfFileResponse, error)

type GetPresetResponse

type GetPresetResponse struct {
	PresetName  string      `json:"presetName"`
	Description string      `json:"description"`
	Container   string      `json:"container"`
	Transmux    bool        `json:"transmux"`
	Clip        Clip        `json:"clip"`
	Audio       Audio       `json:"audio"`
	Video       *Video      `json:"video"`
	Encryption  *Encryption `json:"encryption"`
	WatermarkID string      `json:"watermarkId"`
	Watermarks  *Watermarks `json:"watermarks"`
	TransCfg    *TransCfg   `json:"transCfg"`
	ExtraCfg    *ExtraCfg   `json:"extraCfg"`
	State       string      `json:"state"`
	CreatedTime string      `json:"createdTime"`
}

type GetThumbnailJobResponse

type GetThumbnailJobResponse struct {
	JobID        string                 `json:"jobId,omitempty"`
	JobStatus    string                 `json:"jobStatus,omitempty"`
	PipelineName string                 `json:"pipelineName,omitempty"`
	Source       *ThumbnailSource       `json:"source,omitempty"`
	PresetName   string                 `json:"presetName,omitempty"`
	Target       *ThumbnailTargetStatus `json:"target,omitempty"`
	Capture      *ThumbnailCapture      `json:"capture,omitempty"`
	DelogoArea   *Area                  `json:"delogoArea,omitempty"`
	Error        *Error                 `json:"error,omitempty"`
}

func GetThumbanilJob

func GetThumbanilJob(cli bce.Client, jobId string) (*GetThumbnailJobResponse, error)

type GetTranscodingJobResponse

type GetTranscodingJobResponse struct {
	JobID        string `json:"jobId"`
	PipelineName string `json:"pipelineName"`
	Source       Source `json:"source"`
	Target       Target `json:"target"`
	JobStatus    string `json:"jobStatus"`
	StartTime    string `json:"startTime"`
	EndTime      string `json:"endTime"`
	Error        Error  `json:"error"`
}

func GetTranscodingJob

func GetTranscodingJob(cli bce.Client, jobId string) (*GetTranscodingJobResponse, error)

type GetWaterMarkResponse

type GetWaterMarkResponse struct {
	Bucket                  string    `json:"bucket"`
	Key                     string    `json:"key"`
	VerticalAlignment       string    `json:"verticalAlignment"`
	HorizontalAlignment     string    `json:"horizontalAlignment"`
	VerticalOffsetInPixel   int       `json:"verticalOffsetInPixel"`
	HorizontalOffsetInPixel int       `json:"horizontalOffsetInPixel"`
	Timeline                *Timeline `json:"timeline"`
	Repeated                int       `json:"repeated"`
	AllowScaling            bool      `json:"allowScaling"`
	Dx                      string    `json:"dx"`
	Dy                      string    `json:"dy"`
	Width                   string    `json:"width"`
	Height                  string    `json:"height"`
}

func GetWaterMark

func GetWaterMark(cli bce.Client, watermarkId string) (*GetWaterMarkResponse, error)

type HighlightOutputCfg

type HighlightOutputCfg struct {
	DurationInSecond float64 `json:"durationInSecond,omitempty"`
	FrameRate        float64 `json:"frameRate,omitempty"`
	PlaybackSpeed    float64 `json:"playbackSpeed,omitempty"`
	ReverseConcat    bool    `json:"reverseConcat,omitempty"`
}

type Insert

type Insert struct {
	Bucket   string    `json:"bucket,omitempty"`
	Key      string    `json:"key,omitempty"`
	Type     string    `json:"type,omitempty"`
	Text     string    `json:"text"`
	Font     *Font     `json:"font,omitempty"`
	Timeline *Timeline `json:"timeline"`
	Layout   *Layout   `json:"layout,omitempty"`
}

type Job

type Job struct {
	JobID        string `json:"jobId"`
	PipelineName string `json:"pipelineName"`
	Source       Source `json:"source"`
	Target       Target `json:"target"`
	JobStatus    string `json:"jobStatus"`
	StartTime    string `json:"startTime"`
	EndTime      string `json:"endTime"`
	Error        Error  `json:"error"`
}

type JobStatus

type JobStatus struct {
	Total   int `json:"total,omitempty"`
	Running int `json:"running,omitempty"`
	Pending int `json:"pending,omitempty"`
	Failed  int `json:"failed,omitempty"`
}

type Layout

type Layout struct {
	VerticalAlignment       string `json:"verticalAlignment,omitempty"`
	HorizontalAlignment     string `json:"horizontalAlignment,omitempty"`
	VerticalOffsetInPixel   int    `json:"verticalOffsetInPixel,omitempty"`
	HorizontalOffsetInPixel int    `json:"horizontalOffsetInPixel,omitempty"`
}

type ListNotificationsResponse

type ListNotificationsResponse struct {
	Notifications []CreateNotificationArgs `json:"notifications"`
}

func ListNotification

func ListNotification(cli bce.Client) (*ListNotificationsResponse, error)

type ListPipelinesResponse

type ListPipelinesResponse struct {
	Pipelines []PipelineStatus `json:"pipelines"`
}

func ListPipelines

func ListPipelines(cli bce.Client) (*ListPipelinesResponse, error)

type ListPresetsResponse

type ListPresetsResponse struct {
	Presets []Preset `json:"presets"`
}

func ListPresets

func ListPresets(cli bce.Client) (*ListPresetsResponse, error)

type ListThumbnailJobsResponse

type ListThumbnailJobsResponse struct {
	Thumbnails []ThumbnailJobStatus `json:"thumbnails"`
}

func ListThumbnailJobs

func ListThumbnailJobs(cli bce.Client, pipelineName string) (*ListThumbnailJobsResponse, error)

type ListTranscodingJobsResponse

type ListTranscodingJobsResponse struct {
	Jobs []Job `json:"jobs"`
}

func ListTranscodingJobs

func ListTranscodingJobs(cli bce.Client, pipelineName string) (*ListTranscodingJobsResponse, error)

type ListWaterMarkResponse

type ListWaterMarkResponse struct {
	Watermarks []Watermark `json:"watermarks"`
}

func ListWaterMark

func ListWaterMark(cli bce.Client) (*ListWaterMarkResponse, error)

type PipelineStatus

type PipelineStatus struct {
	PipelineName string              `json:"pipelineName"`
	Description  string              `json:"description,omitempty"`
	SourceBucket string              `json:"sourceBucket"`
	TargetBucket string              `json:"targetBucket"`
	Config       CreatePiplineConfig `json:"config"`
	State        string              `json:"state,omitempty"`
	Createtime   string              `json:"createtime,omitempty"`
	JobStatus    JobStatus           `json:"jobStatus,omitempty"`
}

func GetPipeline

func GetPipeline(cli bce.Client, pipelineName string) (*PipelineStatus, error)

type Preset

type Preset struct {
	PresetName  string      `json:"presetName,omitempty"`
	Description string      `json:"description,omitempty"`
	Container   string      `json:"container,omitempty"`
	Transmux    bool        `json:"transmux,omitempty"`
	Clip        *Clip       `json:"clip,omitempty"`
	Audio       *Audio      `json:"audio,omitempty"`
	Video       *Video      `json:"video,omitempty"`
	Encryption  *Encryption `json:"encryption,omitempty"`
	WatermarkID string      `json:"watermarkId,omitempty"`
	Watermarks  *Watermarks `json:"watermarks,omitempty"`
	TransCfg    *TransCfg   `json:"transCfg,omitempty"`
	ExtraCfg    *ExtraCfg   `json:"extraCfg,omitempty"`
	State       string      `json:"state,omitempty"`
	CreatedTime string      `json:"createdTime,omitempty"`
}

func GetPreset

func GetPreset(cli bce.Client, presetName string) (*Preset, error)

type Source

type Source struct {
	SourceKey string        `json:"sourceKey,omitempty"`
	Clips     *[]SourceClip `json:"clips,omitempty"`
}

type SourceClip

type SourceClip struct {
	Bucket                 string `json:"bucket,omitempty"`
	SourceKey              string `json:"sourceKey,omitempty"`
	StartTimeInSecond      int    `json:"startTimeInSecond,omitempty"`
	DurationInSecond       int    `json:"durationInSecond,omitempty"`
	StartTimeInMillisecond int    `json:"startTimeInMillisecond,omitempty"`
	DurationInMillisecond  int    `json:"durationInMillisecond,omitempty"`
	AsMasterClip           bool   `json:"asMasterClip,omitempty"`
	EnableCrop             bool   `json:"enableCrop,omitempty"`
}

type SpriteOutputCfg

type SpriteOutputCfg struct {
	Rows         int    `json:"rows,omitempty"`
	Columns      int    `json:"columns,omitempty"`
	Margin       int    `json:"margin,omitempty"`
	Padding      int    `json:"padding,omitempty"`
	KeepCellPic  bool   `json:"keepCellPic,omitempty"`
	SpriteKeyTag string `json:"spriteKeyTag,omitempty"`
}

type Target

type Target struct {
	TargetKey    string    `json:"targetKey,omitempty"`
	PresetName   string    `json:"presetName,omitempty"`
	DelogoMode   string    `json:"delogoMode,omitempty"`
	DelogoArea   *Area     `json:"delogoArea,omitempty"`
	DelogoAreas  *[]Area   `json:"delogoAreas,omitempty"`
	AutoCrop     bool      `json:"autoCrop,omitempty"`
	Crop         *Area     `json:"crop,omitempty"`
	WatermarkIds []string  `json:"watermarkIds,omitempty"`
	Inserts      *[]Insert `json:"inserts,omitempty"`
}

type ThumbnailCapture

type ThumbnailCapture struct {
	Mode                string              `json:"mode,omitempty"`
	StartTimeInSecond   float64             `json:"startTimeInSecond,omitempty"`
	EndTimeInSecond     float64             `json:"endTimeInSecond,omitempty"`
	IntervalInSecond    float64             `json:"intervalInSecond,omitempty"`
	MinIntervalInSecond float64             `json:"minIntervalInSecond,omitempty"`
	FrameNumber         int                 `json:"frameNumber,omitempty"`
	SkipBlackFrame      bool                `json:"skipBlackFrame,omitempty"`
	HighlightOutputCfg  *HighlightOutputCfg `json:"highlightOutputCfg,omitempty"`
	SpriteOutputCfg     *SpriteOutputCfg    `json:"spriteOutputCfg,omitempty"`
}

type ThumbnailJobStatus

type ThumbnailJobStatus struct {
	JobID        string                 `json:"jobId"`
	JobStatus    string                 `json:"jobStatus"`
	PipelineName string                 `json:"pipelineName"`
	Source       *ThumbnailSource       `json:"source,omitempty"`
	Target       *ThumbnailTargetStatus `json:"target,omitempty"`
	Capture      *Area                  `json:"capture,omitempty"`
	DelogoArea   *Area                  `json:"delogoArea,omitempty"`
	Error        *Error                 `json:"error,omitempty"`
}

type ThumbnailOptional

type ThumbnailOptional struct {
	PresetName      string
	Target          *ThumbnailTarget
	Capture         *ThumbnailCapture
	DelogoArea      *Area
	Crop            *Area
	ThumbnailSource *ThumbnailSource
}

type ThumbnailSource

type ThumbnailSource struct {
	Key string `json:"key,omitempty"`
}

type ThumbnailTarget

type ThumbnailTarget struct {
	KeyPrefix       string           `json:"keyPrefix,omitempty"`
	Format          string           `json:"format,omitempty"`
	FrameRate       float64          `json:"frameRate,omitempty"`
	GifQuality      string           `json:"gifQuality,omitempty"`
	SizingPolicy    string           `json:"sizingPolicy,omitempty"`
	WidthInPixel    int              `json:"widthInPixel,omitempty"`
	HeightInPixel   int              `json:"heightInPixel,omitempty"`
	SpriteOutputCfg *SpriteOutputCfg `json:"spriteOutputCfg,omitempty"`
}

type ThumbnailTargetStatus

type ThumbnailTargetStatus struct {
	KeyPrefix       string           `json:"keyPrefix,omitempty"`
	Format          string           `json:"format,omitempty"`
	FrameRate       float64          `json:"frameRate,omitempty"`
	GifQuality      string           `json:"gifQuality,omitempty"`
	SizingPolicy    string           `json:"sizingPolicy,omitempty"`
	WidthInPixel    int              `json:"widthInPixel,omitempty"`
	HeightInPixel   int              `json:"heightInPixel,omitempty"`
	SpriteOutputCfg *SpriteOutputCfg `json:"spriteOutputCfg,omitempty"`
	Keys            []string         `json:"keys,omitempty"`
}

type Timeline

type Timeline struct {
	StartTimeInMillisecond int `json:"startTimeInMillisecond,omitempty"`
	DurationInMillisecond  int `json:"durationInMillisecond,omitempty"`
}

type TransCfg

type TransCfg struct {
	TransMode string `json:"transMode,omitempty"`
}

type UpdatePipelineArgs

type UpdatePipelineArgs struct {
	PipelineName         string                `json:"pipelineName,omitempty"`
	Description          string                `json:"description,omitempty"`
	SourceBucket         string                `json:"sourceBucket,omitempty"`
	TargetBucket         string                `json:"targetBucket,omitempty"`
	UpdatePipelineConfig *UpdatePipelineConfig `json:"config,omitempty"`
}

func GetPipelineUpdate

func GetPipelineUpdate(cli bce.Client, pipelineName string) (*UpdatePipelineArgs, error)

type UpdatePipelineConfig

type UpdatePipelineConfig struct {
	Capacity     int    `json:"capacity,omitempty"`
	Notification string `json:"notification,omitempty"`
}

type Video

type Video struct {
	Codec                string        `json:"codec,omitempty"`
	CodecOptions         *CodecOptions `json:"codecOptions,omitempty"`
	BitRateInBps         int           `json:"bitRateInBps,omitempty"`
	MaxFrameRate         float64       `json:"maxFrameRate,omitempty"`
	MaxWidthInPixel      int           `json:"maxWidthInPixel,omitempty"`
	MaxHeigtInPixel      int           `json:"maxHeigtInPixel,omitempty"`
	SizingPolicy         string        `json:"sizingPolicy,omitempty"`
	PlaybackSpeed        float64       `json:"playbackSpeed,omitempty"`
	Crf                  int           `json:"crf,omitempty"`
	AutoAdjustResolution bool          `json:"autoAdjustResolution,omitempty"`
}

type VideoInfo

type VideoInfo struct {
	Codec         string  `json:"codec"`
	HeightInPixel int     `json:"heightInPixel"`
	WidthInPixel  int     `json:"widthInPixel"`
	BitRateInBps  int     `json:"bitRateInBps"`
	FrameRate     float64 `json:"frameRate"`
	Rotate        int     `json:"rotate"`
	Dar           string  `json:"dar"`
}

type VolumeAdjust

type VolumeAdjust struct {
	Mute bool `json:"mute,omitempty"`
	Norm bool `json:"norm,omitempty"`
	Gain int  `json:"gain,omitempty"`
}

type Watermark

type Watermark struct {
	Bucket                  string    `json:"bucket"`
	Key                     string    `json:"key"`
	VerticalOffsetInPixel   int       `json:"verticalOffsetInPixel"`
	HorizontalOffsetInPixel int       `json:"horizontalOffsetInPixel"`
	WatermarkID             string    `json:"watermarkId"`
	CreateTime              string    `json:"createTime"`
	VerticalAlignment       string    `json:"verticalAlignment"`
	HorizontalAlignment     string    `json:"horizontalAlignment"`
	Dx                      string    `json:"dx"`
	Dy                      string    `json:"dy"`
	Width                   string    `json:"width"`
	Height                  string    `json:"height"`
	Timeline                *Timeline `json:"timeline,omitempty"`
	Repeated                int       `json:"repeated"`
	AllowScaling            bool      `json:"allowScaling"`
}

type Watermarks

type Watermarks struct {
	Image []string `json:"image,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL