요청 방법
| 항목 | 값 |
|---|---|
| API Action | ProcessMedia |
| 엔드포인트 | mps.tencentcloudapi.com |
| API 버전 | 2019-06-12 |
| 인증 | TC3-HMAC-SHA256 (SecretId/SecretKey 서명) |
| 요청 방식 | HTTP POST, JSON |
TaskId가 발급되며, 결과는 DescribeTaskDetail로 조회하거나 TaskNotifyConfig로 완료 콜백을 받을 수 있습니다.
요청 파라미터
| 파라미터 | 타입 | 필수 여부 | 예시 | 설명 |
|---|---|---|---|---|
| InputInfo | Object | 필수 | {"Type":"COS","CosInputInfo":{"Bucket":"mybucket-125xxx","Region":"ap-guangzhou","Object":"/input/video.mp4"}} | 입력 미디어 정보. Type은 URL 또는 COS |
| OutputStorage | Object | 선택 | {"Type":"COS","CosOutputStorage":{"Bucket":"mybucket-125xxx","Region":"ap-guangzhou"}} | 출력 저장소. COS Bucket과 Region 지정 |
| OutputDir | String | 선택 | /output/highlight/ | 출력 디렉터리. /로 시작하고 /로 끝나야 함 |
| AiAnalysisTask.Definition | Integer | 필수 | 26 | AI 분석 태스크 템플릿 ID. 고정값 26 |
| AiAnalysisTask.ExtendedParameter | String | 필수 | 아래 호출 예시 참조 | 하이라이트 설정(JSON 문자열). hht 키 아래 프리셋 시나리오 값 사용 |
| TaskNotifyConfig.NotifyUrl | String | 선택 | https://example.com/callback | 태스크 완료 콜백 URL. NotifyType은 URL |
hht 객체는 시나리오별 프리셋 값을 그대로 사용합니다.
| 시나리오 | 용도 | 과금 버전 | top_clip 조정 |
|---|---|---|---|
vlog | VLOG, 풍경, 드론 영상 | 대모델 버전 | 가능(기본 5) |
vlog-panorama | 파노라마 카메라(파노라마 최적화 포함) | 대모델 버전 | 가능(기본 5) |
short-drama | 숏드라마, TV 시리즈. 주인공 등장/BGM 하이라이트 추출 | 대모델 버전 | 불가 |
football | 축구 경기. 슛/골/레드, 옐로카드/리플레이 인식 | Advanced 버전 | 불가 |
basketball | 농구 경기 | Advanced 버전 | 불가 |
custom | 커스텀 시나리오. prompts와 scenario 지정 가능 | 대모델 버전 | 가능(기본 5) |
hht 프리셋 값은 다음과 같습니다.
| 시나리오 | hht 프리셋 |
|---|---|
vlog | {"top_clip":5,"force_cls":10020,"model_segment_limit":[3,6]} |
vlog-panorama | {"top_clip":5,"force_cls":10020,"model_segment_limit":[3,6],"use_panorama_direct":1,"panorama_video":1} |
short-drama | {"force_cls":"10010","merge_type":0,"need_vad":1,"top_clip":100,"res_save_type":1,"scenario":"TV series highlights"} |
football | {"force_cls":"4001","merge_type":0,"need_vad":1,"top_clip":100,"res_save_type":1} |
basketball | {"force_cls":"4002","merge_type":0,"need_vad":1,"top_clip":100,"res_save_type":1} |
custom | {"top_clip":5,"force_cls":10020,"prompts":{"multimodal_prompt":"<prompt>"},"scenario":"<scenario>","model_segment_limit":[3,6]} |
응답 파라미터
| 파라미터 | 타입 | 필수 여부 | 예시 | 설명 |
|---|---|---|---|---|
| TaskId | String | 항상 | 2600011633-WorkflowTask-xxxxx | 발급된 태스크 ID. 결과 조회에 사용 |
| RequestId | String | 항상 | 3c140219-cfe9-470e-b241-907877d6fb03 | 요청 식별자 |
호출 예시
import json
from tencentcloud.common import credential
from tencentcloud.common.profile.client_profile import ClientProfile
from tencentcloud.common.profile.http_profile import HttpProfile
from tencentcloud.mps.v20190612 import mps_client, models
cred = credential.Credential("<SecretId>", "<SecretKey>")
http_profile = HttpProfile()
http_profile.endpoint = "mps.tencentcloudapi.com"
client = mps_client.MpsClient(cred, "ap-guangzhou", ClientProfile(httpProfile=http_profile))
# 축구 경기 하이라이트
params = {
"InputInfo": {
"Type": "COS",
"CosInputInfo": {
"Bucket": "mybucket-125xxx",
"Region": "ap-guangzhou",
"Object": "/input/football.mp4"
}
},
"OutputStorage": {
"Type": "COS",
"CosOutputStorage": {"Bucket": "mybucket-125xxx", "Region": "ap-guangzhou"}
},
"OutputDir": "/output/highlight/",
"AiAnalysisTask": {
"Definition": 26,
"ExtendedParameter": json.dumps({
"hht": {
"force_cls": "4001",
"merge_type": 0,
"need_vad": 1,
"top_clip": 100,
"res_save_type": 1
}
})
}
}
req = models.ProcessMediaRequest()
req.from_json_string(json.dumps(params))
resp = client.ProcessMedia(req)
print(resp.to_json_string())
# VLOG 시나리오, 최대 10개 클립 출력
params["AiAnalysisTask"]["ExtendedParameter"] = json.dumps({
"hht": {
"top_clip": 10,
"force_cls": 10020,
"model_segment_limit": [3, 6]
}
})
# 커스텀 시나리오 (스키)
params["AiAnalysisTask"]["ExtendedParameter"] = json.dumps({
"hht": {
"top_clip": 8,
"force_cls": 10020,
"prompts": {"multimodal_prompt": "Skiing scenario, output character highlights"},
"scenario": "skiing",
"model_segment_limit": [3, 6]
}
})
응답 예시
{
"TaskId": "2600011633-WorkflowTask-xxxxx",
"RequestId": "3c140219-cfe9-470e-b241-907877d6fb03"
}
주의사항
오프라인 파일만 지원하며 라이브 스트림은 처리할 수 없습니다.
ExtendedParameter의 hht 값은 위 프리셋 표의 필드만 사용해야 하며, 임의로 필드를 추가하거나 조합해서 조립하면 안 됩니다.top_clip 조정은 vlog / vlog-panorama / custom 시나리오에서만 가능합니다(기본 5). short-drama / football / basketball은 프리셋 값을 변경하지 않습니다. prompts와 scenario는 custom 시나리오에서만 유효하며 둘 다 필수는 아닙니다.하이라이트 추출은 처리 시간이 긴 편입니다. 결과 클립은 태스크 완료 후
OutputDir에 기록되며 Task Query로 진행 상태를 조회합니다.