46 lines
2.1 KiB
Go
46 lines
2.1 KiB
Go
package video
|
||
|
||
import "github.com/gogf/gf/v2/frame/g"
|
||
|
||
// ConcatReq 视频拼接请求(JSON body / URL 方式)
|
||
type ConcatReq struct {
|
||
g.Meta `path:"/concat" method:"post" tags:"视频拼接" summary:"视频拼接(URL模式)" dc:"从视频URL下载并拼接"`
|
||
VideoURLs []string `json:"video_urls" v:"required#视频URL列表不能为空" dc:"视频URL列表(按此顺序拼接)"`
|
||
Method string `json:"method" dc:"拼接方式(auto/fast/reencode)" d:"auto"`
|
||
Upload bool `json:"upload" dc:"是否上传到MinIO" d:"false"`
|
||
}
|
||
|
||
// ConcatUploadReq 视频拼接请求(文件上传模式)
|
||
type ConcatUploadReq struct {
|
||
g.Meta `path:"/concat/upload" method:"post" tags:"视频拼接" summary:"视频拼接(文件上传)" dc:"上传视频文件并拼接(至少2个视频)"`
|
||
Method string `json:"method" dc:"拼接方式(auto/fast/reencode)" d:"auto"`
|
||
Upload bool `json:"upload" dc:"是否上传到MinIO" d:"false"`
|
||
}
|
||
|
||
// ConcatRes 视频拼接响应
|
||
type ConcatRes struct {
|
||
OutputPath string `json:"outputPath" dc:"输出文件路径"`
|
||
FileSize int64 `json:"fileSize" dc:"文件大小(字节)"`
|
||
Duration float64 `json:"duration" dc:"总时长(秒)"`
|
||
DurationStr string `json:"durationStr" dc:"可读时长"`
|
||
MethodUsed string `json:"methodUsed" dc:"实际使用的拼接方式"`
|
||
InputFiles int `json:"inputFiles" dc:"输入文件数"`
|
||
FileURL string `json:"fileURL" dc:"MinIO访问地址(上传后返回)"`
|
||
}
|
||
|
||
// UploadFileBytesReq 上传文件请求(字节流)
|
||
type UploadFileBytesReq struct {
|
||
FileName string `json:"fileName" dc:"文件名"`
|
||
FileBytes []byte `json:"fileBytes" dc:"文件字节流"`
|
||
FileStoreURL string `json:"fileStoreURL" dc:"文件存储路径"`
|
||
}
|
||
|
||
// UploadFileBytesRes 上传文件响应
|
||
type UploadFileBytesRes struct {
|
||
FileURL string `json:"fileURL" dc:"上传地址"`
|
||
FileSize int `json:"fileSize" dc:"文件大小"`
|
||
FileName string `json:"fileName" dc:"文件名称"`
|
||
FileFormat string `json:"fileFormat" dc:"文件格式"`
|
||
FileAddressPrefix string `json:"fileAddressPrefix"`
|
||
}
|