typearray
value typefile
{
"files": [
"https://replicate.delivery/pbxt/NYZZGpR5tZINdJQLLp8pUziwdNeouXe1HQt8VkGWEzWNRVqw/vpz04dbqv9rme0crnxg9r1x9j8.mp4",
"https://replicate.delivery/pbxt/NYZZH2dFu1qBUt2PpTKd2ZadLMGT9Z0E9vLzg7hidlLG9NWX/hc7hehnhw5rm80crnxf8j703cm.mp4"
],
"max_attempts": 3,
"prompt": "Concatenate these two videos"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_EuU**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run fofr/smart-ffmpeg using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
files: ["https://replicate.delivery/pbxt/NYZZGpR5tZINdJQLLp8pUziwdNeouXe1HQt8VkGWEzWNRVqw/vpz04dbqv9rme0crnxg9r1x9j8.mp4","https://replicate.delivery/pbxt/NYZZH2dFu1qBUt2PpTKd2ZadLMGT9Z0E9vLzg7hidlLG9NWX/hc7hehnhw5rm80crnxf8j703cm.mp4"],
max_attempts: 3,
prompt: "Concatenate these two videos"
};
const output = await replicate.run("fofr/smart-ffmpeg", { input });
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_EuU**********************************
This is your API token. Keep it to yourself.
import replicate
Run fofr/smart-ffmpeg using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"fofr/smart-ffmpeg",
input={
"files": ["https://replicate.delivery/pbxt/NYZZGpR5tZINdJQLLp8pUziwdNeouXe1HQt8VkGWEzWNRVqw/vpz04dbqv9rme0crnxg9r1x9j8.mp4","https://replicate.delivery/pbxt/NYZZH2dFu1qBUt2PpTKd2ZadLMGT9Z0E9vLzg7hidlLG9NWX/hc7hehnhw5rm80crnxf8j703cm.mp4"],
"max_attempts": 3,
"prompt": "Concatenate these two videos"
}
)
# To access the file URL:
print(output[0].url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output[0].read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_EuU**********************************
This is your API token. Keep it to yourself.
Run fofr/smart-ffmpeg using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"input": {
"files": ["https://replicate.delivery/pbxt/NYZZGpR5tZINdJQLLp8pUziwdNeouXe1HQt8VkGWEzWNRVqw/vpz04dbqv9rme0crnxg9r1x9j8.mp4","https://replicate.delivery/pbxt/NYZZH2dFu1qBUt2PpTKd2ZadLMGT9Z0E9vLzg7hidlLG9NWX/hc7hehnhw5rm80crnxf8j703cm.mp4"],
"max_attempts": 3,
"prompt": "Concatenate these two videos"
}
}' \
https://api.replicate.com/v1/models/fofr/smart-ffmpeg/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "c33s9nztzdrmc0crqmhswbd0nw",
"model": "fofr/smart-ffmpeg",
"version": "hidden",
"input": {
"files": [
"https://replicate.delivery/pbxt/NYZZGpR5tZINdJQLLp8pUziwdNeouXe1HQt8VkGWEzWNRVqw/vpz04dbqv9rme0crnxg9r1x9j8.mp4",
"https://replicate.delivery/pbxt/NYZZH2dFu1qBUt2PpTKd2ZadLMGT9Z0E9vLzg7hidlLG9NWX/hc7hehnhw5rm80crnxf8j703cm.mp4"
],
"max_attempts": 3,
"prompt": "Concatenate these two videos"
},
"logs": "🔎 Detected 2 video(s), 0 image(s)\n🎯 Task: Concatenate these two videos\n🧠 Attempt 1/3: planning command with GPT-5…\n🛠️ Proposed command (attempt 1):\n\nffmpeg -y -i /tmp/sff_inputs_1755519909196/cog-input-3749997689.mp4 -i /tmp/sff_inputs_1755519909196/cog-input-696354944.mp4 -filter_complex '[0:v:0][1:v:0]concat=n=2:v=1:a=0[outv]' -map '[outv]' -c:v libx264 -pix_fmt yuv420p -r 24 /tmp/sff_outputs_1755519909196/concatenated.mp4",
"output": [
"https://replicate.delivery/xezq/USzzWfr5krxZWKCMvZ9et1OAbp5XZExilbinZZeZughYuZYqA/concatenated.mp4"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-08-18T12:25:08.603Z",
"started_at": "2025-08-18T12:25:09.18718Z",
"completed_at": "2025-08-18T12:25:48.70981Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/c33s9nztzdrmc0crqmhswbd0nw/cancel",
"children": "https://api.replicate.com/v1/predictions/c33s9nztzdrmc0crqmhswbd0nw/children",
"get": "https://api.replicate.com/v1/predictions/c33s9nztzdrmc0crqmhswbd0nw",
"root": "https://api.replicate.com/v1/predictions/c33s9nztzdrmc0crqmhswbd0nw",
"stream": "https://stream.replicate.com/v1/files/bcwr-4rzjs6lgrxhshke5o2n2iq7s3rmwjtwuaquevy3gyyvd7e42data",
"web": "https://replicate.com/p/c33s9nztzdrmc0crqmhswbd0nw"
},
"metrics": {
"predict_time": 39.522630118,
"total_time": 40.10681
}
}