비디오 · 오디오
소셜 영상 자동 변환
resize-video
Social Video Resizer 기능을 Zavilo SDK에서 사용하는 방법입니다. 아래에서 입력 제한, 파라미터, 출력 형식과 지원 모드를 확인할 수 있습니다.
H · HeadlessI · Interactive
빠른 이동
입력 파일 1출력 파일 1–4
입력
이 Tool이 허용하는 입력 형식과 파일 개수입니다.
| 입력 종류 | file |
|---|---|
| 파일 수 | 1 – 1 |
| 허용 MIME 형식 | video/mp4, video/webm, video/quicktime |
파라미터
아래 값은 request.options에 전달합니다.
| 파라미터 | 타입 | 필수 | 기본값 | 허용값 / 범위 | 설명 |
|---|---|---|---|---|---|
targets |
enum[] | 선택 | — | — | Social output presets to generate. vertical=1080×1920 (9:16 TikTok/Reels/Shorts), portrait=1080×1350 (4:5 feeds), square=1080×1080 (1:1), landscape=1920×1080 (16:9). Multiple values generate multiple MP4 files. |
layout |
enum | 선택 | auto |
auto | fill | fit | blur | How the source fits each target. auto fills when aspect ratios are close and switches to a blurred background for large ratio changes; fill may crop; fit preserves the entire source with padding; blur preserves the entire source over a blurred background. |
cropFocus |
enum | 선택 | center |
center | top | bottom | left | right | Crop anchor used by fill/auto when cropping is required. This is a fixed framing anchor, not AI subject tracking. |
quality |
enum | 선택 | balanced |
high | balanced | small | 출력 품질을 설정합니다. |
keepAudio |
boolean | 선택 | true |
— | Keep the original audio track when one is present. false exports silent video. |
width |
integer | 선택 | — | 2 – 7680 | 출력 너비(px)를 설정합니다. |
height |
integer | 선택 | — | 2 – 4320 | 출력 높이(px)를 설정합니다. |
keepAspectRatio |
boolean | 선택 | true |
— | 원본의 가로세로 비율을 유지합니다. |
출력
처리가 완료되면 반환되는 결과 형식입니다.
| 출력 종류 | files+data |
|---|---|
| 파일 수 | 1 – 4 |
| 출력 MIME | video/mp4 |
| Metadata | duration, sourceWidth, sourceHeight, outputCount, inputBytes, outputBytes, targets, layout, quality, keepAudio |
| ZIP 묶음 | 지원 · threshold 2 |
기본 사용 예제
지원되는 연동 모드를 확인하고 생성된 시작 코드를 바로 복사할 수 있습니다.
Headless
const result = await client.run("resize-video", {
file,
options: { layout: "auto", cropFocus: "center", quality: "balanced" }
});
console.log(result.files, result.data, result.metadata);
Interactive
await client.open({
tool: "resize-video",
input: { file },
options: { layout: "auto", cropFocus: "center", quality: "balanced" },
onComplete(result) { console.log(result.files, result.data, result.metadata); }
});
Embedded
await client.mount({ tool: "resize-video", target: "#zavilo-tool", mode: "embedded" });
이 명세는 실제 SDK 런타임이 사용하는 Tool Definition을 기준으로 자동 생성됩니다.