Skip to content

Commit

Permalink
新增边转边播多任务创建接口
Browse files Browse the repository at this point in the history
  • Loading branch information
wanjiewu committed Oct 24, 2024
1 parent 1f64e94 commit b335033
Showing 1 changed file with 77 additions and 1 deletion.
78 changes: 77 additions & 1 deletion example/CI/workflow_and_job/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,82 @@ func JobNotifyCallback() {
}
}

func InvokeMultiGeneratePlayListJobs() {
c := getClient()
createJobOpt := &cos.CreateMultiGeneratePlayListJobsOptions{
Tag: "GeneratePlayList",
Input: &cos.JobInput{
Object: "speed.mp4",
},
Operation: []cos.GeneratePlayListJobOperation{
{
Tag: "GeneratePlayList",
Output: &cos.JobOutput{
Region: "ap-beijing",
Bucket: "test-1234567890",
Object: "live/a.m3u8",
},
Transcode: &cos.LiveTanscode{
Video: &cos.LiveTanscodeVideo{
Codec: "H.264",
Width: "1280", // 设置480、720、960、1080
Bitrate: "293",
Maxrate: "5000",
Fps: "25",
},
Container: &cos.Container{
Format: "hls",
ClipConfig: &cos.ClipConfig{
Duration: "3",
},
},
TransConfig: &cos.LiveTanscodeTransConfig{
// HlsEncrypt: &cos.HlsEncrypt{
// IsHlsEncrypt: true,
// },
InitialClipNum: "10",
CosTag: "a=a&b=b",
},
},
},
{
Tag: "GeneratePlayList",
Output: &cos.JobOutput{
Region: "ap-beijing",
Bucket: "test-1234567890",
Object: "live/b.m3u8",
},
Transcode: &cos.LiveTanscode{
Video: &cos.LiveTanscodeVideo{
Codec: "H.264",
Width: "1280", // 设置480、720、960、1080
Bitrate: "293",
Maxrate: "5000",
Fps: "25",
},
Container: &cos.Container{
Format: "hls",
ClipConfig: &cos.ClipConfig{
Duration: "3",
},
},
TransConfig: &cos.LiveTanscodeTransConfig{
// HlsEncrypt: &cos.HlsEncrypt{
// IsHlsEncrypt: true,
// },
InitialClipNum: "10",
CosTag: "a=a&b=b",
},
},
},
},
}
createJobRes, _, err := c.CI.CreateMultiGeneratePlayListJobs(context.Background(), createJobOpt)
log_status(err)
fmt.Printf("%+v\n", createJobRes.JobsDetail)
}

func main() {
InvokeTranscodeJob()
// InvokeTranscodeJob()
InvokeMultiGeneratePlayListJobs()
}

0 comments on commit b335033

Please sign in to comment.