提取视频中的音频 (Updated 9 months, 3 weeks ago)
Input video file
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run hexiaochun/video2mp3 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "hexiaochun/video2mp3:af143509b7803857e584a9f43f254bc7f1865e96398bbf3cf99f8dfbeebdb959", { input: { video: "https://coze-tmp-file.oss-cn-shenzhen.aliyuncs.com/2024-06-06/test.mp4" } } ); // To access the file URL: console.log(output.url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
import replicate
output = replicate.run( "hexiaochun/video2mp3:af143509b7803857e584a9f43f254bc7f1865e96398bbf3cf99f8dfbeebdb959", input={ "video": "https://coze-tmp-file.oss-cn-shenzhen.aliyuncs.com/2024-06-06/test.mp4" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "hexiaochun/video2mp3:af143509b7803857e584a9f43f254bc7f1865e96398bbf3cf99f8dfbeebdb959", "input": { "video": "https://coze-tmp-file.oss-cn-shenzhen.aliyuncs.com/2024-06-06/test.mp4" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
This is a modal window.
Beginning of dialog window. Escape will cancel and close the window.
End of dialog window.
{ "completed_at": "2024-08-21T06:36:46.305425Z", "created_at": "2024-08-21T06:36:22.115000Z", "data_removed": false, "error": null, "id": "r4gnnkmjwdrgc0cheek8xrzaz4", "input": { "video": "https://coze-tmp-file.oss-cn-shenzhen.aliyuncs.com/2024-06-06/test.mp4" }, "logs": "MoviePy - Writing audio in /tmp/4716f0cc-0871-4803-8bff-8f1bd8eb6dfb.mp3\nchunk: 0%| | 0/1079 [00:00<?, ?it/s, now=None]\nchunk: 9%|▉ | 97/1079 [00:00<00:01, 967.42it/s, now=None]\nchunk: 18%|█▊ | 194/1079 [00:00<00:00, 953.52it/s, now=None]\nchunk: 27%|██▋ | 290/1079 [00:00<00:00, 937.10it/s, now=None]\nchunk: 36%|███▌ | 384/1079 [00:00<00:00, 927.81it/s, now=None]\nchunk: 44%|████▍ | 477/1079 [00:00<00:00, 900.12it/s, now=None]\nchunk: 53%|█████▎ | 568/1079 [00:00<00:00, 888.51it/s, now=None]\nchunk: 61%|██████ | 660/1079 [00:00<00:00, 891.52it/s, now=None]\nchunk: 70%|██████▉ | 751/1079 [00:00<00:00, 893.04it/s, now=None]\nchunk: 78%|███████▊ | 841/1079 [00:00<00:00, 891.92it/s, now=None]\nchunk: 86%|████████▋ | 931/1079 [00:01<00:00, 892.19it/s, now=None]\nchunk: 95%|█████████▌| 1028/1079 [00:01<00:00, 915.61it/s, now=None]\nMoviePy - Done.", "metrics": { "predict_time": 5.328657303, "total_time": 24.190425 }, "output": "https://replicate.delivery/czjl/H2pX7iGbFM5uHtIsWuOZbI8ZBShTR6A43cUpDy2eiHXfzzUTA/4716f0cc-0871-4803-8bff-8f1bd8eb6dfb.mp3", "started_at": "2024-08-21T06:36:40.976767Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/r4gnnkmjwdrgc0cheek8xrzaz4", "cancel": "https://api.replicate.com/v1/predictions/r4gnnkmjwdrgc0cheek8xrzaz4/cancel" }, "version": "af143509b7803857e584a9f43f254bc7f1865e96398bbf3cf99f8dfbeebdb959" }
MoviePy - Writing audio in /tmp/4716f0cc-0871-4803-8bff-8f1bd8eb6dfb.mp3 chunk: 0%| | 0/1079 [00:00<?, ?it/s, now=None] chunk: 9%|▉ | 97/1079 [00:00<00:01, 967.42it/s, now=None] chunk: 18%|█▊ | 194/1079 [00:00<00:00, 953.52it/s, now=None] chunk: 27%|██▋ | 290/1079 [00:00<00:00, 937.10it/s, now=None] chunk: 36%|███▌ | 384/1079 [00:00<00:00, 927.81it/s, now=None] chunk: 44%|████▍ | 477/1079 [00:00<00:00, 900.12it/s, now=None] chunk: 53%|█████▎ | 568/1079 [00:00<00:00, 888.51it/s, now=None] chunk: 61%|██████ | 660/1079 [00:00<00:00, 891.52it/s, now=None] chunk: 70%|██████▉ | 751/1079 [00:00<00:00, 893.04it/s, now=None] chunk: 78%|███████▊ | 841/1079 [00:00<00:00, 891.92it/s, now=None] chunk: 86%|████████▋ | 931/1079 [00:01<00:00, 892.19it/s, now=None] chunk: 95%|█████████▌| 1028/1079 [00:01<00:00, 915.61it/s, now=None] MoviePy - Done.
This model runs on CPU hardware. We don't yet have enough runs of this model to provide performance information.
This model doesn't have a readme.
提取视频中的音频
输入图片和音频合并关键帧视频
minicpm 视频理解
图文识别
提取视频中的图片
视频合并
视频识别自动分割场景
视频转换工具包
This model is cold. You'll get a fast response if the model is warm and already running, and a slower response if the model is cold and starting up.
Choose a file from your machine
Hint: you can also drag files onto the input