typefile
{
"disable_frame_rate_effects": true,
"freeze_intro_frames": 0,
"glitch_intensity": 0.32,
"video": "https://replicate.delivery/pbxt/NWmxg5oOZCPp258juaD72JtXzgoqRVwtjz8Yqul6SN2TdNNM/Sample.mp4"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_asy**********************************
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 andreasjansson/h.264-glitch using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
disable_frame_rate_effects: true,
freeze_intro_frames: 0,
glitch_intensity: 0.32,
video: "https://replicate.delivery/pbxt/NWmxg5oOZCPp258juaD72JtXzgoqRVwtjz8Yqul6SN2TdNNM/Sample.mp4"
};
const output = await replicate.run("andreasjansson/h.264-glitch", { 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_asy**********************************
This is your API token. Keep it to yourself.
import replicate
Run andreasjansson/h.264-glitch using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"andreasjansson/h.264-glitch",
input={
"disable_frame_rate_effects": True,
"freeze_intro_frames": 0,
"glitch_intensity": 0.32,
"video": "https://replicate.delivery/pbxt/NWmxg5oOZCPp258juaD72JtXzgoqRVwtjz8Yqul6SN2TdNNM/Sample.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_asy**********************************
This is your API token. Keep it to yourself.
Run andreasjansson/h.264-glitch 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": {
"disable_frame_rate_effects": true,
"freeze_intro_frames": 0,
"glitch_intensity": 0.32,
"video": "https://replicate.delivery/pbxt/NWmxg5oOZCPp258juaD72JtXzgoqRVwtjz8Yqul6SN2TdNNM/Sample.mp4"
}
}' \
https://api.replicate.com/v1/models/andreasjansson/h.264-glitch/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "sjaqvdx7b9rma0crmd58wbjg3w",
"model": "andreasjansson/h.264-glitch",
"version": "hidden",
"input": {
"disable_frame_rate_effects": true,
"freeze_intro_frames": 0,
"glitch_intensity": 0.32,
"video": "https://replicate.delivery/pbxt/NWmxg5oOZCPp258juaD72JtXzgoqRVwtjz8Yqul6SN2TdNNM/Sample.mp4"
},
"logs": "Using seed 3685047418\n🎬 Initializing datamosh pipeline...\n📂 Input video: cog-input-745628818.mp4 (16373KB)\n✂️ Truncated to 2 minutes: 16385KB\n\n🎬 === ATTEMPT 1/10 ===\n📊 Glitch intensity: 0.32\n🔀 Freeze intro frames: 0\n🎨 Color chaos: always enabled\n🚫 Frame rate effects: DISABLED (smooth playback)\n🏗️ Building datamoshed video...\n 📹 Probing video properties...\n 🎬 Detected FPS: 30.0\n 🔧 Normalizing GOP structure (Baseline/CAVLC)...\n ✅ Baseline/CAVLC normalization successful\n ✅ Normalized video: 28731KB\n 🔬 Extracting H.264 elementary stream...\n ✅ AnnexB H.264 extracted with AUD insertion\n 🧬 Performing enhanced H.264 color datamoshing...\n 🚫 Frame rate effects disabled - smooth temporal flow maintained\n 🎛️ Enhanced datamosh: drop_idr=0.000, mv_corrupt=0.427, ref_swap=0.345\n 💥 Color intensity: bytes=29, slice_prob=0.286, sat_bomb_every=21, wobble=ON\n 🎛️ UV-targeted params: byte_budget=29, corrupt_prob=0.30, wobble=on, sat_bomb_every=21\n ✅ Color datamoshed stream: 29701KB\n 🎥 Creating final datamoshed MP4...\n ✅ Direct remux: 29713KB\n 🎬 Pure datamoshed video created: 29713KB\n✅ Build complete: datamoshed_video_attempt_0.mp4\n🧪 Testing video playability...\n✅ Video passed playability test!\n🌐 Creating browser-compatible version with audio...\n⚠️ Duration mismatch (90.0s vs 72.8s) - video only",
"output": "https://replicate.delivery/xezq/SOsaDayP7R48CZ11NOl5OxeHCLuu0YAdFX6dQdQLZi08fiKVA/final_glitched_video.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-08-13T11:57:15.482Z",
"started_at": "2025-08-13T11:57:15.956137Z",
"completed_at": "2025-08-13T11:58:50.05085Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/sjaqvdx7b9rma0crmd58wbjg3w/cancel",
"children": "https://api.replicate.com/v1/predictions/sjaqvdx7b9rma0crmd58wbjg3w/children",
"get": "https://api.replicate.com/v1/predictions/sjaqvdx7b9rma0crmd58wbjg3w",
"root": "https://api.replicate.com/v1/predictions/sjaqvdx7b9rma0crmd58wbjg3w",
"stream": "https://stream.replicate.com/v1/files/bcwr-wuztrtszkd26gtmtbkcuk6tvmhsblukllc6tty5zdqaycahgm66q",
"web": "https://replicate.com/p/sjaqvdx7b9rma0crmd58wbjg3w"
},
"metrics": {
"predict_time": 94.094713386,
"total_time": 94.56885
}
}