Appearance
视频字幕生成
请求地址
POST 方法:/api/video/srt
请求参数
参数名 | 类型 | 必填 | 说明 |
---|---|---|---|
content | string | 是 | 输入路径,音频、视频文件或文件夹 |
model | string | 是 | 识别语言,示例:纯英文、中英文 |
示例代码
python
import requests
url = 'http://127.0.0.1:5699/api/video/srt'
data = {
'content': '/path/to/video.mp4',
'model': "中英文"
}
r = requests.post(url, data=data)
print(r.json())
import requests
url = 'http://127.0.0.1:5699/api/video/srt'
data = {
'content': '/path/to/video.mp4',
'model': "中英文"
}
r = requests.post(url, data=data)
print(r.json())
js
let formData = new FormData();
formData.append("content", "/path/to/video.mp4");
formData.append("model", "中英文");
fetch("http://127.0.0.1:5699/api/video/srt", {
method: "POST",
body: formData,
})
.then((response) => response.json())
.then((data) => {
console.log(data);
});
let formData = new FormData();
formData.append("content", "/path/to/video.mp4");
formData.append("model", "中英文");
fetch("http://127.0.0.1:5699/api/video/srt", {
method: "POST",
body: formData,
})
.then((response) => response.json())
.then((data) => {
console.log(data);
});
bash
curl -X POST -F 'content=@/path/to/video.mp4' -F 'model=中英文' http://127.0.0.1:5699/api/video/srt
curl -X POST -F 'content=@/path/to/video.mp4' -F 'model=中英文' http://127.0.0.1:5699/api/video/srt
响应结果
json
{ "status": "success", "msg": "ok" }
{ "status": "success", "msg": "ok" }