OpenVibe.Live/Docs
Source on GitHub

VODs & Clips#

Finished media analysis#

LIVE_MEDIA_ANALYSIS=local is the default: Live's existing frame and transcript jobs produce VOD and clip overviews and timed transcripts. Set LIVE_MEDIA_ANALYSIS=ai to send each finished VOD or clip's signed Media URL to OpenVibe.AI's media.analyze workflow (AI runs one analysis at a time at nice 15). Live fills a missing overview (an overview it already has is kept), derives the short overview, and stores timed speech segments in vod_ai_state or clip_ai_state. Live waits up to a minute for the run (LIVE_MEDIA_ANALYSIS_WAIT_MS, 60000); a longer analysis is re-joined 15 minutes later by its idempotency key (live.media.analyze:<kind>:<id>:<attempt>), so the same recording is never analysed twice at once and no loop waits for it. AI's signals, scenes, and highlights have no Live state columns and are not stored. Failed or unavailable analyses retry with backoff; Live does not run its VOD/clip decoder in this mode. Live stream captions and sound events continue using their real-time paths. The live_media_analysis_retry_total metric counts deferred analyses by media kind.

Until a VOD's full transcript is in, GET /api/vods/:id serves the captions heard while it was live (the timeline rows stamped with that VOD, moved into its own time) with transcript_source: "live"; the full pass replaces them. The full pass runs after the stream and waits while the machine is busy, so a part that ended minutes ago used to show no transcript at all (VOD 6026, 2026-10-26).

Written before the media split. Storage, cutting, thumbnails and files now live in OpenVibe.Media; Live proxies to it (server/media-proxy/) and starts/stops recordings (server/streaming/recorder.js). Pastes live in OpenVibe.Community. Live's old local vods/clips/pastes tables are frozen: nothing writes or reads them (below); the PostgreSQL schema has no copies of them. Implementation details below may be out of date.

Recording System#

OpenVibe.Live automatically records your streams as VODs (Video on Demand).

Protocol-Specific Recording#

ProtocolRecording MethodFormat
WebRTC (Browser, WHIP)Server-side: the SFU forwards the broadcaster's video and audio as RTP to OpenVibe.Media, which copies themWebM (VP8 + Opus), MP4 (H.264 + AAC) from phones
RTMPServer-side: OpenVibe.Media pulls the local RTMP endpoint and copies itMP4 (H.264 + AAC)
JSMPEGNot recorded (Media has no MPEG-TS ingest)—

A browser produces its audio a moment after its video. The recorder waits up to 5 s for it (VOD_AUDIO_WAIT_MS): VOD 5986 (2026-10-25) was recorded silent because the recorder asked for the audio in the same instant the video arrived, just before the microphone did. A stream with no microphone records video only after the wait. A microphone that comes later, or a new one after the recorded one stopped, rolls the recording to a new part that has the sound.

A browser encoder sends a keyframe only when something asks for one, and the recording grows a keyframe at a time: until the next keyframe, the newest footage is not in the file. Stream 2795 (2026-10-26) went up to 100 s between keyframes, so a live clip of the last 30 s was cut from footage 80 s old and the live rewind moved in minute-long steps. The recording now asks the broadcaster for a keyframe every 4 s (VOD_KEYFRAME_SEC, 0 turns it off), like an OBS keyframe interval; viewers who lose a packet recover sooner too.

Recording Lifecycle#

  1. Start: Recording begins when the stream goes live
  2. Live DVR: A seekable sidecar file is generated periodically (every 60s for server-side, every 2 chunks for browser uploads) so viewers can rewind
  3. Finalize: When the stream ends, the recording is remuxed for proper seeking, duration is probed, and a thumbnail is generated
  4. Auto-cleanup: Recordings shorter than 10 seconds are automatically deleted (test streams, accidental go-lives)

A stream that changes shape#

A broadcaster who turns their phone, or whose connection makes WebRTC lower the resolution, sends frames of another size partway through. The recording keeps them as they came. OpenVibe.Media's playback copy (its HLS timeline) is cut in one part per shape, each with its own size, and the player switches between them, so a portrait part plays portrait. Before 2026-10-26 it was squeezed into the first part's 16:9 (VOD 6017). A lowered resolution is not a new part: it is scaled up to that part's size. A clip whose window crosses a turn shows its main shape, with bars for the rest.

The live player does the same for viewers: the box takes the picture's own ratio (public/js/player-shape.js), eases to a new one when the broadcaster turns, keeps its size when only the resolution drops, and opens on the channel's last shape. A blurred copy of the picture fills the sides of a tall picture.

Browser Tab Close Safety#

If you close the browser tab during a WebRTC stream, sendBeacon attempts to upload any remaining chunks. The server will auto-finalize when it detects the stream has ended.

DVR / Live Seeking#

Viewers can seek backwards in a live stream using the DVR controls:

DVR availability appears after ~30 seconds of recording.

The bar spans the whole stream, not only the part being recorded. A broadcaster who reconnects (a phone dropping its connection, a browser tab reloading) is recorded in parts, each its own VOD ("BIRD DRAMA (Part 2)"); the player reads the stream's history and plays an earlier part from its own VOD when you seek into it, then carries on into the next. Rewinding across a phone turn shows each stretch at its own shape: Media's DVR playlist starts a new period, with its own init segment, at each change of shape.

A stream's history#

While a stream is live, Live keeps what happened to it, in stream time (seconds since it started), in stream_history (server/streaming/stream-history.js):

KindWhatKept from
parta recording part: its VOD, where it starts and stops, why it rolledthe recorder
shapethe picture the broadcaster sends changed size (WxH)the studio's outbound video stats
reconnectthe broadcaster came back, and how long it was gonethe broadcast socket

GET /api/streams/:id/history answers { started_at, is_live, now_sec, parts, shapes, reconnects }; a part whose VOD the viewer cannot see is listed without it. Stream time minus a part's start is that part's own time, and that is how the history is used:

Clips#

Viewers can create clips from live streams:

  1. Click the Clip button during a stream
  2. Set the clip duration (default: 30 seconds)
  3. The clip is saved from the server-side recording

Clips are unlisted by default — the stream owner can publish or delete them from the dashboard.

Naming a clip#

Naming is optional everywhere. Right after a clip is made without a name (the phone studio's Clip button, or the dashboard's Create Clip with the name left empty), a card offers Save name or Skip. It closes by itself after 20 seconds and never covers the stream's controls. Viewers name their clip in the trim editor when its cut is ready.

A clip left unnamed (still "Untitled Clip", "Clip from stream" or "Clip: <stream title>") is named by the AI once its overview exists: 3-6 words about what happens, never about what anyone looks like, and no slurs or strong profanity (server/ai/clip-title.js). A name a person gives always wins, even one given while the AI was writing. The clip's "clipped: …" line in chat waits up to 3 minutes for the AI's name.

A finished public recording of a Live stream is said in chat when Media's vod.ready arrives (server/media-proxy/vod-notify.js): "📼 name saved a broadcast: “title” (1h 02m) at https://openvibe.live/vod/<id>", drawn as an event card with Watch. It goes to the channel's chat and, unless the stream was 18+, to global chat (a channel at most once in 30 minutes there, six recordings an hour in all). Recordings that are private, under two minutes or not a Live stream's are not said; Chat's keys make a repeated vod.ready post nothing.

When a recording breaks#

A stream is recorded by OpenVibe.Media (RTMP pulled by Media's ffmpeg; browser and WHIP streams as PlainRTP from the SFU). When that recording stops while the stream goes on (a Media restart ends every ingest), Live's recorder notices within 15 s (checkActiveRecordings, asking Media's GET /vods/:id/ingest), finishes the broken part at once and goes on in a new part; Media joins a stream's parts into one video, which its first part plays. Before 2026-11-18 the recorder waited for Media's orphan sweep (about four minutes) and those minutes were lost. Recently-online cards and the recently-ended list count every part (include_parts), so "Replay · 32:15 of 36:51" means 32:15 of the stream is in the replay. A stream that ends for a lost heartbeat ends at its last heartbeat, not five minutes later.

An RTMP encoder that drops and comes back within 90 s (RTMP_RESUME_GRACE_MS) carries on the same stream (server/streaming/resume-grace.js): one broadcast is one stream and one replay, its parts joined, instead of two streams. After the grace the stream ends at the encoder's last heartbeat. A Live restart keeps the stream live in the database; the reconnecting encoder carries it on (Media already holds its recording), or the stale sweep ends it.

VOD Management#

From the dashboard:

Recordings and clips are watched on OpenVibe.Video#

Every recording and clip has its page on OpenVibe.Video (https://openvibe.video/watch?v=<watch_id>; the older /v/<id> and /c/<id> answer 301 there; server/web/video-url.js, VIDEO_PUBLIC_URL overrides the origin): the player, AI chapters and captions, the chat replay, comments, clipping, and the owner's visibility and delete, for private items too (to their owner). The captions name what was heard as well as what was said: GET /api/vods/:id/sounds gives cues like "[laughter]", "[applause]" and "[music]" in the VOD's own time (item 151, C15; server/ai/sound-captions.js). Each tag comes from a classifier label above its own bar, set from production (applause and laughter from 0.7, a dog or a siren from 0.8); nothing is written by a model, so nothing is invented. A burst is one cue of at most 6 s; music gives one cue where it starts; explosions and gunfire need 0.85 and must be rare in the stream (in a shooter they are the game); the classifier's long tail ("Vehicle", "Animal", "Glass") is never captioned. Same visibility rule as memories. Live's old /vod/<id> and /clip/<id> URLs answer a 301 there (server/web/video-handover.js, mounted before the SEO renderer like the paste handover; a ?t= start time goes along as seconds). Every watch link Live renders points there: the SPA through videoHref() (the shell's ov-video-base meta names the origin), the server through videoUrl(). Live's sitemap leaves recordings and clips out (Video's lists them), and the documents Live sends to OpenVibe.Search link there. /vods and /clips stay on Live as the Content feed with a filter, linking out. Live keeps the recording pipeline, the API (/api/vods, /api/clips) that OpenVibe.Video reads, and the owner's manager on the dashboard.

Playback URLs#

Every VOD and clip row Live answers (/api/vods, /api/vods/:id, /api/clips, /api/clips/:id and the per-user lists) carries three URLs, set by setPlaybackUrls() in server/media-client.js:

The watch pages play hls_url when there is one and fall back to the file. The server-rendered pages name no playback URL at all: their schema.org contentUrl is the page and their og:video tags carry only the duration.

To save the file, GET /api/vods/:id/download-url?name=… and /api/clips/:id/download-url?name=… answer { url, expires_at }: the byte route with ?download=1&name=…, which Media answers as an attachment named after name (its real extension added), so a browser saves it instead of playing it. A private item (for whoever may see it) gets a signed URL valid for 15 minutes. OpenVibe.Video's Download menu uses these.

Views#

A view is one content_views row per item and address: Live's detail read (GET /api/vods/:id, GET /api/clips/:id) adds it. openvibe.video reads those over loopback, so its watch page counts its viewers with a beacon instead: POST /api/views/vod/:id or /api/views/clip/:id (server/media-proxy/view-beacon.js), sent from the viewer's browser when playback starts. It answers only https://openvibe.video's origin, reads no cookie, counts only a public or unlisted finished item (Live's visibility rule, remembered for a minute), is limited to 60 a minute per address, and answers 204 whether or not it counted.

Who sees a private VOD or clip#

A private item (visibility private, or a legacy row with no visibility and is_public = 0) is visible only to its owners — the uploader or clipper, the clipped channel's streamer, the streamer whose stream it came from — and to staff (admin, global mod). Everyone else gets exactly the answer an unknown id gets: the same 404 and body on /api/vods/:id and its live-info/memories/sounds/context, /api/clips/:id, comments (including a comment's replies, edit and delete), thumbnail regeneration and the write routes (a 403 would confirm the id exists). It is also left out of /api/chat-ai/vod-transcripts, the server-rendered /vod/:id and /clip/:id pages, and /api/streams/recent. The rule lives in server/media-proxy/access.js; Media applies the same rule to openvibe.media/v/:id and /c/:id. Unlisted items stay reachable by direct link.

Comments are OpenVibe.Community threads#

Comments on a VOD or clip live in OpenVibe.Community, not in Live (roadmap Wave 5: Live and a second product share one Community thread). The thread of a VOD is the one Community keeps for the EntityRef { service: 'live', type: 'vod', id: '<vod id>' } (type: 'clip' for clips). /api/comments keeps its paths and response shapes; server/media-proxy/comments.js is an adapter over server/comments-client.js:

Live's old comments table is read-only (test/frozen-tables.test.js fails if server code writes it). Its rows were moved with OpenVibe.Community's scripts/import-live-comments.js: dry run by default, --apply only with --backup of Community's database, a ledger so re-runs import nothing twice, authors mapped to Network subjects (unmapped ones held and listed), and a reconciliation read = imported + held + excluded. The exact production commands are in OpenVibe.Community's README ("Live's VOD and clip comments").

Chat Replay#

VODs include synchronized chat replay. Messages are stored in the database with timestamps relative to the stream start. Deleted messages are automatically excluded from replay (soft-delete with is_deleted flag).

AI moments: pastes and clips never overlap#

Two jobs turn stream moments into content: server/ai/ai-moments-job.js (image pastes for the home hero + pastes tab, every 6 h) and server/ai/auto-clip-job.js (live chat-spike clips + a VOD backfill). They used to pick the same second of the same VOD with the same title. Now:

AI-inferred category#

Go-live used to default every stream to irl, so every AI prompt (AI viewers, streamer overviews, VOD overviews, the Arena, sound detection) assumed everyone is an IRL streamer. Now the category selector defaults to Auto (stored as NULL), and the stream-memory rollup — the same summarise call that already runs — returns { overview, category, tags } with category from the fixed taxonomy (outdoors, travel, building, music, gaming, robot, desktop, irl, other). It is stored on streams.ai_category / streams.ai_tags and the channel inherits the latest read (channels.ai_category).

Everything reads the effective value: listing queries return COALESCE(ai_category, category) AS category (the self-selected value is still there as chosen_category), stream_category on VODs/clips, the AI viewers' session block ("judged from the stream itself"), streamer overviews, sound detection and the Arena all prefer ai_category. A streamer can still pick a category manually; the AI read wins once it exists.

Live reads nothing from the frozen tables#

Live's local vods, clips, pastes, paste_likes and paste_comments tables stopped at the Media split: nothing recorded, clipped or pasted since then was ever in them, and OpenVibe.Media (VODs and clips, same ids) and OpenVibe.Community (pastes, by slug) hold the old rows too. Since register item C-73 step 2, no Live code reads them. test/frozen-tables.test.js fails on any write or read of these tables in server/ or scripts/ (SQL text, split over lines too, and table: '…' registries). Its allow-list of kept reads is empty. A read that has to stay goes into that list with a reason, and into this page.

What used to read them, and what answers now (most of it in server/media-proxy/lookups.js):

Page or jobNow asksHidden items
Recently ended streams (/api/streams/recent): VOD id, thumbnail, durationMedia, per stream (cached 5 min)never: public VODs only
Recently online cards: slot thumbnailMedia GET /vods/latest-thumbs (the route already did)never
Channel page badges: pastes, clips takenCommunity (pastes), Media (clips, hide_self)owner and staff only
Channel offline screen: top VOD and clip per week, month, all timeMedia, newest 100 plus most-viewednever
Workspace session history: each session's VODMedia by slot (managed_stream_id)owner only (private and recording included)
Setup hub: "Publish a paste"Community, as the personthe person's own
Settings: avatar historyCommunity, as the person (screenshots tagged metadata.kind = 'avatar')the person's own
AI timeline (channel AI tab): each session's VOD linkMedia by user, public only; not cached while Media is downnever
Transcript view: the stream's VODMedia (the old local fallback is gone)never
Home hero, kiosk, SEO snapshot: VOD, clip, hour and paste countsMedia /stats; pastes from Community /api/pastes/admin/statscounts only
Home "over time" charts for VODs, clips, hoursMedia /stats/series/* (the route already did)counts only
Admin dashboard: VOD totalsMedia list totals (null when Media is down)staff
Admin AI explorer and the streamer overview job: VODs, clips, pastesMedia and Communitystaff: any visibility (the overview job reads public VODs)
AI moments and auto-clip jobs: VOD pool, VOD source, where viewers clippedMedia (no local fallback: Media down means no run)internal signal only
Stream analytics: clips per streamMedia, written into stream_analytics.clips_created right after the stream endsinternal
Arena portraits: VOD thumbnailsMedia, public VODsnever

Removed from server/db/database.js: 45 exported helpers that had no caller (VOD health, public VOD and clip lists, the old paste API, paste comments and likes, filtered channel lists), the 11 whose callers now ask Media or Community, and the boot-time migrations that still rewrote rows of the frozen vods/clips tables (short overviews, transcript status) along with the indexes that only served the removed listings. The streamer overview job now only considers streamers with stream memories; the frozen vods table was its other signal, and its rows moved to Media at the split.

API additions that would help (not blocking)#

This page is rendered from docs/vods-and-clips.md in the OpenVibe.Live repository. Found a mistake? Edit it there.