Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
fix(x-content): speed browser recordings up instead of shipping padded frames
ni3adca22a605600
diff --git a/data/x-content/queue.json b/data/x-content/queue.jsonindex aded87d40..29feff026 100644--- a/data/x-content/queue.json+++ b/data/x-content/queue.json@@ -2001,7 +2001,7 @@},{"id": "portal",- "status": "approved",+ "status": "posted","kind": "post","tier": 2,"lane": "world",@@ -2059,10 +2059,10 @@{"path": "public/x-media/portal/clip.mp4","probe": {- "durationSec": 40.4,+ "durationSec": 13.47,"width": 1280,"height": 720,- "fps": 25,+ "fps": 30,"videoCodec": "h264","pixFmt": "yuv420p"}diff --git a/docs/x-content-pipeline.md b/docs/x-content-pipeline.mdindex 98a3bc9d1..4222b75c9 100644--- a/docs/x-content-pipeline.md+++ b/docs/x-content-pipeline.md@@ -215,8 +215,10 @@ Queue edits reach production with the next deploy, because the cron reads the qu| Image (JPG, PNG, WEBP) | 5 MB, up to four per post, alt text up to 1,000 characters || GIF | 15 MB, alone on its post || Video (MP4, MOV) | 512 MB, 0.5 to 140 s, 32 px to 1920x1200, aspect 1:3 to 3:1, up to 60 fps, H.264 yuv420p with AAC audio, alone on its post |++**Recording a WebGL page:** a headless capture renders at whatever rate the page manages, which is around 3 frames a second for a 3D scene on software GL. The encoder then pads that to 25 fps by repeating frames, and the result reads as choppy: the first Portal clip shipped 1010 frames carrying 128 distinct images. `--speed <n>` on `prepare-video` drops the padding instead of the content, so the same images play over a shorter clip and the motion reads as continuous. The Portal capture went from 3.2 unique frames per second to 9.4 at `--speed 3`, and the file halved. Record with slow, deliberate camera movement and speed it up afterwards, rather than moving fast in real time. Burned-in captions are rendered before the retime and sped up with the picture, so they stay in sync, and audio is retimed with `atempo` to match. Motion interpolation was measured and rejected: at 3 fps the camera moves too far between frames for block matching to help.| Article | Title under 100 characters, a cover image, at least three blocks, code and tables totalling 10,000 characters or fewer |## Tests-[tests/x-content.test.js](../tests/x-content.test.js) covers the tiered slots, fill-down, priority scoring, holds and the fall-through that publishes the next post when one fails, stock counting, quote-tweet ids and their publish wiring, the voice and editorial lint, the claims ledger, media quality, review records binding approval to exact content, the editor verdict rules, the media rules, the Markdown to Article offsets, the scheduler's spacing, cap, embargo, and resume rules, and the publisher's thread chaining, crash resume, and Article draft, publish, and quote sequence.+[tests/x-content.test.js](../tests/x-content.test.js) covers the tiered slots, fill-down, priority scoring, holds and the fall-through that publishes the next post when one fails, stock counting, quote-tweet ids and their publish wiring, the video speed-up filter chain and its caption ordering, the voice and editorial lint, the claims ledger, media quality, review records binding approval to exact content, the editor verdict rules, the media rules, the Markdown to Article offsets, the scheduler's spacing, cap, embargo, and resume rules, and the publisher's thread chaining, crash resume, and Article draft, publish, and quote sequence.diff --git a/public/x-media/portal/clip.mp4 b/public/x-media/portal/clip.mp4index 1ea67e990..68da9e583 100644Binary files a/public/x-media/portal/clip.mp4 and b/public/x-media/portal/clip.mp4 differdiff --git a/tests/x-content.test.js b/tests/x-content.test.jsindex 930b38ec4..8b0e338ea 100644--- a/tests/x-content.test.js+++ b/tests/x-content.test.js@@ -4,7 +4,7 @@ import { tmpdir } from 'node:os';import { join } from 'node:path';import { copyProblems, weightedLength } from '../api/_lib/x-content/quality.js';-import { attachmentProblems, mediaProblems, parseFfmpegProbe } from '../api/_lib/x-content/media.js';+import { SPEED_OUTPUT_FPS, attachmentProblems, mediaProblems, parseFfmpegProbe, videoFilterChain } from '../api/_lib/x-content/media.js';import { markdownToContentState, attachArticleMedia } from '../api/_lib/x-content/articles.js';import { DEFAULT_SLOTS, currentSlot, inQuietHours, jitterMinutes, pickDue, slotOpenings, tierOrder } from '../api/_lib/x-content/schedule.js';import { linkProbeUrl } from '../api/_lib/x-content/verify.js';@@ -397,6 +397,26 @@ describe('queue', () => {for (const item of queue.items.filter((row) => row.status === 'approved')) expect(problems[item.id]).toEqual([]);});+ it('speeds a recording up without desyncing its captions, and pins a constant rate', () => {+ // A headless WebGL capture renders about 3 frames a second and the encoder+ // pads it to 25, so 87%% of the shipped frames were repeats. Speeding up+ // drops the padding rather than the content.+ const plain = videoFilterChain();+ expect(plain.some((f) => f.startsWith('setpts'))).toBe(false);+ expect(plain.some((f) => f.startsWith('fps='))).toBe(false);++ const fast = videoFilterChain({ speed: 3 });+ expect(fast.slice(-2)).toEqual(['setpts=PTS/3', `fps=${SPEED_OUTPUT_FPS}`]);++ // Captions burn in against the original timeline and are sped up with the+ // picture; putting setpts first would render them at a third of their cue.+ const captioned = videoFilterChain({ speed: 2, subtitlesPath: '/tmp/cues.srt' });+ const subtitleAt = captioned.findIndex((f) => f.startsWith('subtitles='));+ const setptsAt = captioned.findIndex((f) => f.startsWith('setpts'));+ expect(subtitleAt).toBeGreaterThan(-1);+ expect(setptsAt).toBeGreaterThan(subtitleAt);+ });+it('refuses a second cashtag, which X rejects at publish', () => {// X answers 403 "Posts are limited to a maximum of one cashtag" and the// publisher cannot retry around it, so review has to catch it first.