/VIDEO/video-background-removal
视频

Video Background Removal API

Isolate the subject in a video and export it with a transparent or solid-color background. Keep the original audio if needed.

  • Video to video

起价

$0.005

每秒输出

4 个参数 · 1 种价格选项

Video Background Removal API 价格

选项每秒价格
标准$0.005
1curl -X POST https://api.api-stock.com/api/v1/generation/create \
2 -H "Authorization: Bearer $API_STOCK_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "model": "video-background-removal",
6 "input": {
7 "videoUrl": "https://example.com/input.png",
8 "backgroundColor": "transparent",
9 "outputFormat": "webm",
10 "preserveAudio": true
11 }
12 }'

参数

名称类型必填默认值描述
videoUrlstring是—Public source video URL. MP4, MOV or WebM, up to 100 MiB.
backgroundColorstring否transparentBackground for the output. Transparent backgrounds require WebM.以下之一:transparent, black, white, gray, red, green, blue, yellow, cyan, magenta, orange
outputFormatstring否webmOutput format. WebM uses VP9 and supports transparency. MP4 uses H.264 and requires a solid background.以下之一:webm, mp4
preserveAudioboolean否trueKeep the original audio track when possible.

常见问题

Video Background Removal 的费用是多少?

Video Background Removal 通过 API Stock API 的起价为 $0.005 每秒输出。您按使用量从单个预付余额中支付——无需订阅——最终价格会根据分辨率或时长等参数浮动。

如何获取 Video Background Removal 的 API 密钥?

注册 API Stock 账号,使用可用的付款方式充值,然后在控制台创建 API 密钥即可,整个过程只需几分钟,无需签订合同。同一个密钥可调用目录中的所有模型,因此无需为 Video Background Removal 单独申请密钥。

如何调用 Video Background Removal API?

向 https://api.api-stock.com/api/v1/generation/create 发送 POST 请求,并附上您的 API 密钥和模型 ID "video-background-removal"。请求会返回一个任务 ID,您可以轮询该 ID;或者在结果准备就绪时通过 webhook 回调通知。上方的快速开始部分提供了一个可直接运行的示例。

Video Background Removal 接受哪些输入参数?

Video Background Removal 接受 4 个输入参数, 包括必填字段 videoUrl。参数表中列出了它们的类型、默认值和允许值。

如果 Video Background Removal 请求失败,会发生什么?

API Stock 会自动通过备用提供商重试请求。如果所有提供商均失败,费用将退还至您的余额。

我可以使用与其他模型相同的 API 密钥来调用 Video Background Removal 吗?

可以。API Stock 上的每个模型——视频、图像、音乐和聊天——共享一个 API 密钥和一个预付余额,因此您无需新的凭据即可切换到 Video Background Removal。