alyoss

package
v1.20.114 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: Zlib Imports: 14 Imported by: 0

Documentation

Overview

*

//获取媒体信息 http://mts.cn-hangzhou.aliyuncs.com/?Action=SubmitMediaInfoJob&Input=%7B%22Bucket%22%3A%22example-bucket%22%2C%22Location%22%3A%22oss-cn-hangzhou%22%2C%0A%22Object%22%3A%22example.flv%22%7D%0A&PipelineId=88c6ca184c0e47098a5b665e2a126797<公共参数>

//转码 http://mts.cn-hangzhou.aliyuncs.com/?PipelineId=88c6ca184c0e47098a5b665e2a126799&Action=SubmitJobs&Input=%7b%22Bucket%22%3a%22example-bucket%22%2c%22Location%22%3a%22oss-cn-hangzhou%22%2c%22Object%22%3a%22example.flv%22%7d&Outputs=%5b%7b%22OutputObject%22%3a%22example-output.flv%22%2c%22TemplateId%22%3a%22S00000000-000010%22%2c%22WaterMarks%22%3a%5b%7b%22InputFile%22%3a%7b%22Bucket%22%3a%22example-bucket%22%2c%22Location%22%3a%22oss-cn-hangzhou%22%2c%22Object%22%3a%22example-logo.png%22%7d%2c%22WaterMarkTemplateId%22%3a%2288c6ca184c0e47098a5b665e2a126797%22%7d%5d%7d%5d&OutputBucket=example-bucket&公共参数>

//转码状态 http://mts.cn-hangzhou.aliyuncs.com/?Action=QueryJobList&JobIds=88c6ca184c0e47098a5b665e2a126797&<公共参数>

//截图 http://mts.cn-hangzhou.aliyuncs.com?Action=SubmitSnapshotJob&Input=%7b%22Bucket%22%3a%22example-bucket%22%2c%22Location%22%3a%22oss-cn-hangzhou%22%2c%22Object%22%3a%22example.flv%22%7d&SnapshotConfig=%7B%22OutputFile%22%3A%7B%22Bucket%22%3A%22example-001%22%2C%22Location%22%3A%22oss-cn-hangzhou%22%2C%22Object%22%3A%22example.jpg%22%7D%2C%22Time%22%3A%225%22%7D&PipelineId=88c6ca184c0e47098a5b665e2a126797<Public parameter>

Index

Constants

View Source
const DefaultCallbackBody = "filename=${object}&size=${size}&mimeType=${mimeType}&height=${imageInfo.height}&width=${imageInfo.width}"
View Source
const DefaultCallbackBodyType = "application/x-www-form-urlencoded"

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioStream

type AudioStream struct {
	Index          string
	CodecName      string
	CodecLongName  string
	Profile        string
	CodecTimeBase  string
	CodecTagString string
	CodecTag       string
	SampleFmt      string
	Samplerate     string
	Channels       string
	ChannelLayout  string
	Timebase       string
	StartTime      string
	Duration       string
	Bitrate        string
	NumFrames      string
	Lang           string
}

type AudioStreamList

type AudioStreamList struct {
	AudioStreams []AudioStream `json:"AudioStream,omitempty"`
}

type CallbackParam

type CallbackParam struct {
	CallbackUrl      string `json:"callbackUrl"`
	CallbackBody     string `json:"callbackBody"`
	CallbackBodyType string `json:"callbackBodyType"`
}

func GetCallbackParam

func GetCallbackParam(callback string) CallbackParam

type ConfigStruct

type ConfigStruct struct {
	Expiration string     `json:"expiration"`
	Conditions [][]string `json:"conditions"`
}

type Error

type Error struct {
	RequestId string
	HostId    string
	Code      string
	Message   string
}

type Format

type Format struct {
	NumStreams     string
	NumPrograms    string
	FormatName     string
	FormatLongName string
	StartTime      string
	Duration       string
	Size           string
	Bitrate        string
}

type HeadReq

type HeadReq struct {
	Format string //  返回值的类型,支持JSON与XML,默认为XML。

	AccessKeyId      string //  阿里云颁发给用户的访问服务所用的密钥ID。
	Signature        string //	签名结果串,关于签名的计算方法,参见 签名机制。
	SignatureMethod  string //	签名方式,目前支持HMAC-SHA1。
	Timestamp        string //	请求的时间戳。日期格式按照ISO8601标准表示,并需要使用UTC时间。格式为:YYYY-MM-DDThh:mm:ssZ例如,2014-7-29T12:00:00Z(为北京时间2014年7月29日的20点0分0秒。
	SignatureVersion string //  签名算法版本,目前版本是1.0。
	SignatureNonce   string //	唯一随机数,用于防止网络重放攻击。用户在不同请求间要使用不同的随机数值。
	// contains filtered or unexported fields
}

type Job

type Job struct {
	JobId        string
	Input        Object `json:"Input"`
	Output       Output `json:"Output"`
	State        string
	Code         string
	Message      string
	Percent      int
	PipelineId   string
	CreationTime string
}

type JobList

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

type JobQuery

type JobQuery struct {
	Job
}

JobQuery 转码状态

type JobResult

type JobResult struct {
	Success string
	Code    string
	Message string
	Job     Job
}

type JobResultList

type JobResultList struct {
	JobResults []JobResult `json:"result"`
}

type MediaInfo

type MediaInfo struct {
	JobId      string
	Input      Object
	Properties Properties
}

MediaInfo 媒体信息

type MediaInfoResult

type MediaInfoResult struct {
	RequestId string
	MediaInfo []MediaInfo `json:"MediaInfoJob"`
}

MediaInfoResult 媒体信息返回结果

type NetworkCost

type NetworkCost struct {
	PreloadTime   string
	CostBandwidth string
	AvgBitrate    string
}

type Object

type Object struct {
	Bucket   string
	Location string
	Object   string
}

type OssFile

type OssFile struct {
	// contains filtered or unexported fields
}

func NewOssFile

func NewOssFile(config fileconfig.Config) *OssFile

func (*OssFile) FileUpload

func (of *OssFile) FileUpload(fileResult *fileconfig.Result, data *fileconfig.Base, bucket *oss.Bucket) error

FileUpload 文件上传

func (*OssFile) GetPolicyToken

func (of *OssFile) GetPolicyToken(objBucket config.Bucket, callbackParam CallbackParam, uploadDir string) (PolicyToken, error)

GetPolicyToken 产生一个临时的上传token

func (*OssFile) IsObjectExist

func (of *OssFile) IsObjectExist(data *fileconfig.Base) (bool, error)

IsObjectExist 文件是否存在

func (*OssFile) StreamUpload

func (of *OssFile) StreamUpload(fileResult *fileconfig.Result, data *fileconfig.Stream, bucket *oss.Bucket) error

StreamUpload 流式上传

func (*OssFile) UploadFile

func (of *OssFile) UploadFile(fileResult *fileconfig.Result, data *fileconfig.Base) error

func (*OssFile) UploadStream

func (of *OssFile) UploadStream(fileResult *fileconfig.Result, data *fileconfig.Stream) error

type Output

type Output struct {
	OutputFile    Object        `json:"OutputFile,omitempty"`
	TemplateId    string        `json:"TemplateId,omitempty"`
	UserData      string        `json:"UserData,omitempty"`
	Properties    Properties    `json:"Properties,omitempty"`
	WaterMarkList WaterMarkList `json:"WaterMarkList,omitempty"`
}

type OutputObject

type OutputObject struct {
	OutputObject string
	TemplateId   string
	WaterMarks   []WaterMark
	UserData     string `json:"UserData"`
}

type PolicyToken

type PolicyToken struct {
	AccessKeyId string `json:"accessId"`
	Host        string `json:"host"`
	Expire      int64  `json:"expire"`
	Signature   string `json:"signature"`
	Policy      string `json:"policy"`
	Directory   string `json:"dir"`
	Callback    string `json:"callback"`
}

type Properties

type Properties struct {
	Streams Streams
}

type QueryJobResult

type QueryJobResult struct {
	RequestId string
	JobList   JobList
}

QueryJobResult 查询转码状态结果

type QueryReq

type QueryReq struct {
	Action string
	JobIds string //是转码作业ID列表,逗号分隔,一次最多10个
}

QueryReq Action = QueryJobList

type Snapshot

type Snapshot struct {
	Id           string
	State        string
	Code         string
	Message      string
	Config       SnapshotConfig
	PipelineId   string
	UserData     string
	CreationTime string
}

type SnapshotConfig

type SnapshotConfig struct {
	OutputFile Object
	Time       string
}

type SnapshotConfigReq

type SnapshotConfigReq struct {
	Format         string
	BlackLevel     string
	OutputFile     Object
	TileOutputFile Object
	Interval       string
	Num            string
	Width          string
	Height         string
	FrameType      string
	TileOut        TileOut
	SubOut         SubOut
}

SnapshotConfigReq

BlackLevel 多帧截图针对首帧过滤黑屏图片判定阀值。

默认值:空
取值范围:[30,100]
值越小,图片黑色像素的占比越小。

Time>0 ,参数设置无效,放弃过滤黑屏功能;
Time =0 ,Num>1,参数有效,且只作用于第一张图,只检测开始5秒数据,如果没有非黑屏图片,依旧返回第一帧黑屏图片;
Time =0 ,Num=1,强制过滤黑屏,参数无效。
如果需要首帧图片过滤纯黑屏,建议参数值设置成100。

使用示例:Time=0&Num=10 需要对首图做纯黑屏过滤,则设置BlackLevel= 100。

*

type SnapshotResult

type SnapshotResult struct {
	RequestId string
	Snapshot  Snapshot `json:"SnapshotJob"`
}

SnapshotResult 截图返回结果

type Streams

type Streams struct {
	Format             Format
	State              string
	Code               string
	Message            string
	PipelineId         string
	CreationTime       string
	UserData           string
	VideoStreamList    VideoStreamList    `json:"VideoStreamList,omitempty"`
	AudioStreamList    AudioStreamList    `json:"AudioStreamList,omitempty"`
	SubtitleStreamList SubtitleStreamList `json:"SubtitleStreamList,omitempty"`
}

type SubOut

type SubOut struct {
	IsSptFrag string // 图片是否拼合输出。 true表示拼合输出, 默认:false
}

type SubmitMediaInfoReq

type SubmitMediaInfoReq struct {
	Action   string
	Input    Object `json:"Input"`
	UserData string
}

SubmitMediaInfoReq Action = SubmitMediaInfo

type SubmitReq

type SubmitReq struct {
	Action         string
	Input          Object `json:"Input"`
	OutputBucket   string
	OutputLocation string
	Outputs        []OutputObject
	PipelineId     string
}

SubmitReq Action = SubmitJobs

type SubmitResult

type SubmitResult struct {
	RequestId string
	JobResult JobResultList `json:"JobResultList"`
}

SubmitResult 提交转码返回结果

type SubmitSnapshotReq

type SubmitSnapshotReq struct {
	Action     string
	Input      Object            `json:"Input"`
	Config     SnapshotConfigReq `json:"SnapshotConfig"`
	PipelineId string
	UserData   string
}

SubmitSnapshotReq Action = SubmitSnapshotJob

type SubtitleStream

type SubtitleStream struct {
	Index string
	Lang  string
}

type SubtitleStreamList

type SubtitleStreamList struct {
	SubtitleStreams []SubtitleStream `json:"SubtitleStream,omitempty"`
}

type TileOut

type TileOut struct {
	Lines         string // 图片拼合行数, 取值范围:(0,10000], 默认:10
	Columns       string // 图片拼合列数, 取值范围:(0,10000], 默认:10
	CellWidth     string // 单图片宽度。默认截图输出分辨率宽度。
	CellHeight    string // 单图片高度。 默认截图输出分辨率高度。
	Margin        string // 外框宽度。
	Padding       string // 图片间距,默认0,单位px
	Color         string // 背景颜色。 默认:black, 其中颜色关键字支持三种格式,比如黑色,支持Black,black,#000000
	IsKeepCellPic string // 是否保留单图片。 取值范围:true、false, 默认:true
}

type VideoStream

type VideoStream struct {
	Index          string
	CodecName      string
	CodecLongName  string
	Profile        string
	CodecTimeBase  string
	CodecTagString string
	CodecTag       string
	Width          string
	Height         string
	HasBFrames     string
	Sar            string
	Dar            string
	PixFmt         string
	Level          string
	Fps            string
	AvgFPS         string
	Timebase       string
	StartTime      string
	Duration       string
	Bitrate        string
	NumFrames      string
	Lang           string
	NetworkCost    NetworkCost
}

type VideoStreamList

type VideoStreamList struct {
	VideoStreams []VideoStream `json:"VideoStream,omitempty"`
}

type WaterMark

type WaterMark struct {
	InputFile           Object `json:"InputFile,omitempty"`
	WaterMarkTemplateId string `json:"WaterMarkTemplateId,omitempty"`
}

type WaterMarkList

type WaterMarkList struct {
	WaterMarks []WaterMark `json:"WaterMark,omitempty"`
}

Jump to

Keyboard shortcuts

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