typefile
{
"video": "https://replicate.delivery/pbxt/NUBKhvrojaKmgJSScQkEd8cIuCiDcTtez1Rul3Ofw1KQQf4E/rocket.mp4"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Ie0**********************************
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 zeke/pingpong-video using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
video: "https://replicate.delivery/pbxt/NUBKhvrojaKmgJSScQkEd8cIuCiDcTtez1Rul3Ofw1KQQf4E/rocket.mp4"
};
const output = await replicate.run("zeke/pingpong-video", { input });
// 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
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Ie0**********************************
This is your API token. Keep it to yourself.
import replicate
Run zeke/pingpong-video using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"zeke/pingpong-video",
input={
"video": "https://replicate.delivery/pbxt/NUBKhvrojaKmgJSScQkEd8cIuCiDcTtez1Rul3Ofw1KQQf4E/rocket.mp4"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.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_Ie0**********************************
This is your API token. Keep it to yourself.
Run zeke/pingpong-video 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": {
"video": "https://replicate.delivery/pbxt/NUBKhvrojaKmgJSScQkEd8cIuCiDcTtez1Rul3Ofw1KQQf4E/rocket.mp4"
}
}' \
https://api.replicate.com/v1/models/zeke/pingpong-video/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "97eamp2j8nrmc0crfndsmxgdm8",
"model": "zeke/pingpong-video",
"version": "hidden",
"input": {
"video": "https://replicate.delivery/pbxt/NUBKhvrojaKmgJSScQkEd8cIuCiDcTtez1Rul3Ofw1KQQf4E/rocket.mp4"
},
"logs": "ffmpeg version 5.1.6-0+deb12u1 Copyright (c) 2000-2024 the FFmpeg developers\n built with gcc 12 (Debian 12.2.0-14)\n configuration: --prefix=/usr --extra-version=0+deb12u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared\n libavutil 57. 28.100 / 57. 28.100\n libavcodec 59. 37.100 / 59. 37.100\n libavformat 59. 27.100 / 59. 27.100\n libavdevice 59. 7.100 / 59. 7.100\n libavfilter 8. 44.100 / 8. 44.100\n libswscale 6. 7.100 / 6. 7.100\n libswresample 4. 7.100 / 4. 7.100\n libpostproc 56. 6.100 / 56. 6.100\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/cog-input-1339185900.mp4':\n Metadata:\n major_brand : isom\n minor_version : 512\n compatible_brands: isomiso2avc1mp41\n encoder : Google\n Duration: 00:00:08.00, start: 0.000000, bitrate: 1581 kb/s\n Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1280x720, 1319 kb/s, 24 fps, 24 tbr, 12288 tbn (default)\n Metadata:\n handler_name : VideoHandler\n vendor_id : [0][0][0][0]\n Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 255 kb/s (default)\n Metadata:\n handler_name : SoundHandler\n vendor_id : [0][0][0][0]\nStream mapping:\n Stream #0:0 (h264) -> reverse:default\n Stream #0:0 (h264) -> concat\n concat:out:v0 -> Stream #0:0 (libx264)\nPress [q] to stop, [?] for help\n[libx264 @ 0x5b0da49a7b40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512\n[libx264 @ 0x5b0da49a7b40] profile High, level 3.1, 4:2:0, 8-bit\n[libx264 @ 0x5b0da49a7b40] 264 - core 164 r3095 baee400 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=6 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=24 scenecut=40 intra_refresh=0 rc_lookahead=30 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00\nOutput #0, mp4, to '/tmp/pingpong_output.mp4':\n Metadata:\n major_brand : isom\n minor_version : 512\n compatible_brands: isomiso2avc1mp41\n encoder : Lavf59.27.100\n Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(progressive), 1280x720, q=2-31, 24 fps, 12288 tbn\n Metadata:\n encoder : Lavc59.37.100 libx264\n Side data:\n cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A\nframe= 1 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x \rframe= 52 fps=0.0 q=28.0 size= 0kB time=00:00:00.75 bitrate= 0.5kbits/s speed=1.42x \rframe= 75 fps= 73 q=28.0 size= 0kB time=00:00:01.70 bitrate= 0.2kbits/s speed=1.66x \rframe= 102 fps= 66 q=28.0 size= 256kB time=00:00:02.83 bitrate= 740.3kbits/s speed=1.84x \rframe= 124 fps= 61 q=28.0 size= 256kB time=00:00:03.75 bitrate= 559.3kbits/s speed=1.84x \rframe= 144 fps= 56 q=28.0 size= 256kB time=00:00:04.58 bitrate= 457.6kbits/s speed=1.79x \rframe= 164 fps= 53 q=28.0 size= 512kB time=00:00:05.41 bitrate= 774.4kbits/s speed=1.76x \rframe= 187 fps= 52 q=28.0 size= 512kB time=00:00:06.37 bitrate= 658.0kbits/s speed=1.78x \rframe= 220 fps= 54 q=28.0 size= 512kB time=00:00:07.75 bitrate= 541.2kbits/s speed=1.89x \rframe= 255 fps= 55 q=28.0 size= 768kB time=00:00:09.20 bitrate= 683.3kbits/s speed= 2x \rframe= 281 fps= 55 q=28.0 size= 768kB time=00:00:10.29 bitrate= 611.3kbits/s speed=2.02x \rframe= 304 fps= 54 q=28.0 size= 1024kB time=00:00:11.25 bitrate= 745.7kbits/s speed= 2x \rframe= 328 fps= 53 q=28.0 size= 1024kB time=00:00:12.25 bitrate= 684.8kbits/s speed=1.99x \rframe= 357 fps= 54 q=28.0 size= 1280kB time=00:00:13.45 bitrate= 779.2kbits/s speed=2.02x \rframe= 384 fps= 53 q=28.0 size= 1280kB time=00:00:14.58 bitrate= 719.0kbits/s speed=2.03x \rframe= 384 fps= 51 q=28.0 Lsize= 1493kB time=00:00:15.87 bitrate= 770.6kbits/s speed=2.09x \nvideo:1488kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.357539%\n[libx264 @ 0x5b0da49a7b40] frame I:2 Avg QP:19.53 size: 45490\n[libx264 @ 0x5b0da49a7b40] frame P:123 Avg QP:20.74 size: 7782\n[libx264 @ 0x5b0da49a7b40] frame B:259 Avg QP:23.13 size: 1834\n[libx264 @ 0x5b0da49a7b40] consecutive B-frames: 1.6% 24.5% 3.1% 70.8%\n[libx264 @ 0x5b0da49a7b40] mb I I16..4: 13.6% 74.6% 11.8%\n[libx264 @ 0x5b0da49a7b40] mb P I16..4: 1.6% 4.2% 0.3% P16..4: 31.3% 7.7% 4.3% 0.0% 0.0% skip:50.6%\n[libx264 @ 0x5b0da49a7b40] mb B I16..4: 1.0% 1.1% 0.0% B16..8: 9.8% 1.9% 0.1% direct: 3.5% skip:82.6% L0:47.6% L1:48.2% BI: 4.2%\n[libx264 @ 0x5b0da49a7b40] 8x8 transform intra:63.5% inter:84.3%\n[libx264 @ 0x5b0da49a7b40] coded y,uvDC,uvAC intra: 43.1% 80.0% 31.4% inter: 5.6% 10.8% 0.2%\n[libx264 @ 0x5b0da49a7b40] i16 v,h,dc,p: 47% 27% 17% 10%\n[libx264 @ 0x5b0da49a7b40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 19% 21% 5% 3% 4% 3% 5% 5%\n[libx264 @ 0x5b0da49a7b40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 28% 10% 4% 7% 7% 6% 4% 3%\n[libx264 @ 0x5b0da49a7b40] i8c dc,h,v,p: 33% 24% 34% 9%\n[libx264 @ 0x5b0da49a7b40] Weighted P-Frames: Y:0.0% UV:0.0%\n[libx264 @ 0x5b0da49a7b40] ref P L0: 66.4% 33.6%\n[libx264 @ 0x5b0da49a7b40] ref B L0: 78.0% 22.0%\n[libx264 @ 0x5b0da49a7b40] ref B L1: 94.8% 5.2%\n[libx264 @ 0x5b0da49a7b40] kb/s:761.53",
"output": "https://replicate.delivery/xezq/cEvLj0us6w4UKtS9y3f3PSvoXVacCaTPkYklcpCwl6fJmHIVA/pingpong_output.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-08-06T03:09:53.605Z",
"started_at": "2025-08-06T03:09:54.03375Z",
"completed_at": "2025-08-06T03:10:01.908695Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/97eamp2j8nrmc0crfndsmxgdm8/cancel",
"children": "https://api.replicate.com/v1/predictions/97eamp2j8nrmc0crfndsmxgdm8/children",
"get": "https://api.replicate.com/v1/predictions/97eamp2j8nrmc0crfndsmxgdm8",
"root": "https://api.replicate.com/v1/predictions/97eamp2j8nrmc0crfndsmxgdm8",
"stream": "https://stream.replicate.com/v1/files/bcwr-e3qchxn7gqfbsfmninpflbbpjhssodhlsanj7zfvcnc47ciph2nq",
"web": "https://replicate.com/p/97eamp2j8nrmc0crfndsmxgdm8"
},
"metrics": {
"predict_time": 7.874945414,
"total_time": 8.303695
}
}