Skip to content

Commit b335033

Browse files
author
wanjiewu
committed
新增边转边播多任务创建接口
1 parent 1f64e94 commit b335033

File tree

1 file changed

+77
-1
lines changed

1 file changed

+77
-1
lines changed

example/CI/workflow_and_job/jobs.go

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,82 @@ func JobNotifyCallback() {
11111111
}
11121112
}
11131113

1114+
func InvokeMultiGeneratePlayListJobs() {
1115+
c := getClient()
1116+
createJobOpt := &cos.CreateMultiGeneratePlayListJobsOptions{
1117+
Tag: "GeneratePlayList",
1118+
Input: &cos.JobInput{
1119+
Object: "speed.mp4",
1120+
},
1121+
Operation: []cos.GeneratePlayListJobOperation{
1122+
{
1123+
Tag: "GeneratePlayList",
1124+
Output: &cos.JobOutput{
1125+
Region: "ap-beijing",
1126+
Bucket: "test-1234567890",
1127+
Object: "live/a.m3u8",
1128+
},
1129+
Transcode: &cos.LiveTanscode{
1130+
Video: &cos.LiveTanscodeVideo{
1131+
Codec: "H.264",
1132+
Width: "1280", // 设置480、720、960、1080
1133+
Bitrate: "293",
1134+
Maxrate: "5000",
1135+
Fps: "25",
1136+
},
1137+
Container: &cos.Container{
1138+
Format: "hls",
1139+
ClipConfig: &cos.ClipConfig{
1140+
Duration: "3",
1141+
},
1142+
},
1143+
TransConfig: &cos.LiveTanscodeTransConfig{
1144+
// HlsEncrypt: &cos.HlsEncrypt{
1145+
// IsHlsEncrypt: true,
1146+
// },
1147+
InitialClipNum: "10",
1148+
CosTag: "a=a&b=b",
1149+
},
1150+
},
1151+
},
1152+
{
1153+
Tag: "GeneratePlayList",
1154+
Output: &cos.JobOutput{
1155+
Region: "ap-beijing",
1156+
Bucket: "test-1234567890",
1157+
Object: "live/b.m3u8",
1158+
},
1159+
Transcode: &cos.LiveTanscode{
1160+
Video: &cos.LiveTanscodeVideo{
1161+
Codec: "H.264",
1162+
Width: "1280", // 设置480、720、960、1080
1163+
Bitrate: "293",
1164+
Maxrate: "5000",
1165+
Fps: "25",
1166+
},
1167+
Container: &cos.Container{
1168+
Format: "hls",
1169+
ClipConfig: &cos.ClipConfig{
1170+
Duration: "3",
1171+
},
1172+
},
1173+
TransConfig: &cos.LiveTanscodeTransConfig{
1174+
// HlsEncrypt: &cos.HlsEncrypt{
1175+
// IsHlsEncrypt: true,
1176+
// },
1177+
InitialClipNum: "10",
1178+
CosTag: "a=a&b=b",
1179+
},
1180+
},
1181+
},
1182+
},
1183+
}
1184+
createJobRes, _, err := c.CI.CreateMultiGeneratePlayListJobs(context.Background(), createJobOpt)
1185+
log_status(err)
1186+
fmt.Printf("%+v\n", createJobRes.JobsDetail)
1187+
}
1188+
11141189
func main() {
1115-
InvokeTranscodeJob()
1190+
// InvokeTranscodeJob()
1191+
InvokeMultiGeneratePlayListJobs()
11161192
}

0 commit comments

Comments
 (0)