Logo: Fishjam Composition

Fishjam Composition

Organisatioun
software-mansion-labs
fishjam-composition

Fishjam compositions: server-side, real-time mixing of several live streams (room peers, WHIP, RTMP, MP4) into new output streams with layouts, overlays, captions, and audio mixes, built on Smelter. Covers lifecycle and billing, static scenes, React templates, composing a room, and the raw Composition API. Use when building a grid or picture-in-picture of a call, restreaming a room to a livestream or to YouTube / Twitch over RTMP, or adding overlays or captions driven from a backend. Trigger on: 'Fishjam composition', 'compose a room', 'CompositionClient', 'createComposition', 'create_composition', 'registerWhipOutput', 'register_whip_output', 'registerTemplateOutput', 'register_template_output', 'updateOutput', 'update_output', 'forwardRoomTracks', 'forward_room_tracks', 'track_forwardings', '@fishjam-cloud/composition', '@fishjam-cloud/composition-cli', 'rtc.fishjam.io', 'Smelter'.

Add to TypingMind

Iwwersiicht

Editeursoftware-mansion-labs
Repositoryskills
Skill-Nummfishjam-composition
Stären
296
Forks
21
Matgeliwwert Dateien
5
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 5 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    software-mansion-labs huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Fishjam Composition an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/software-mansion-labs/skills/tree/main/skills/fishjam/references/composition
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/software-mansion-labs/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/fishjam/references/composition .claude/skills/fishjam-composition
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Fishjam Composition an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Fishjam Composition automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Fishjam Composition net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Fishjam Compositions

A composition takes several live streams, lays them out in a scene, and pushes the result out as new streams in real time. Rendering happens on Fishjam's servers, built on Software Mansion's Smelter.

Because the layout is rendered once on the server, every viewer receives one ready-made stream: it looks the same on every device, and a low-end phone only has to play a single video instead of decoding every participant.

Read ../platform/SKILL.md first. It defines rooms, peers, tracks, management tokens, livestream rooms, and notifications that this skill builds on.

What you can build

  • A video call turned into a broadcast. The room's participants in a grid, speaker, or picture-in-picture layout, with names, speaking highlights, and camera-off placeholders, streamed to a livestream audience in your app.
  • Restreaming. A call, an OBS feed, or any other input sent to YouTube, Twitch, or another RTMP platform.
  • Overlays and broadcast graphics driven by your backend. A LIVE badge, captions, lower thirds, sponsor banners, or a score bug, toggled as things happen in your product.
  • A standby or placeholder channel. Graphics only, or a looping video, switched to the live layout when the show starts. An output shows one scene at a time; events or updates switch it.

Mental model

inputs                       composition                 outputs
room tracks (forwarded) ──┐                            ┌─▶ WHIP → Fishjam livestream → viewers
WHIP publisher ───────────┼─▶ scene per output ────────┤
RTMP encoder ─────────────┤   video tree + audio mix   └─▶ RTMP → YouTube / Twitch / other
MP4 file URL ─────────────┘
ConceptWhat it is
CompositionA rendering workspace on the Composition API (https://rtc.fishjam.io), authenticated with the management token (../platform/auth-model.md). Holds inputs, outputs, and assets; billing is per input and output, not per composition.
InputA stream coming in, addressed by an input_id you choose. Registered by you (WHIP, WHEP, RTMP, MP4) or created for you when a Fishjam room is forwarded.
OutputA stream going out, addressed by an output_id you choose. Pushes over WHIP or RTMP. Each output renders its own scene.
TemplateA bundled React component, uploaded while registering a template output, that controls the output's scene and re-renders when its state changes. Can react to room events or events sent by your backend.
Static sceneThe alternative to a template: a JSON component tree (view, tiles, rescaler, input_stream, text, image) plus an audio mix, sent by your backend.
AssetsImages (registered by URL) and fonts (uploaded), usable from templates and scenes.

A composition produces video; it does not serve it. There is no URL a player can open. Every output must push to a destination that viewers can reach.

Designing a composition

Answer three questions: where the streams come from, where the result goes, and what draws the layout.

Where do the streams come from?

SourceHow it gets inRead
Peers in a Fishjam room (../platform/room-types.md)Forward the whole room; inputs appear per trackroom-composition.md
Anything else: OBS or another WHIP publisher, an RTMP encoder, a remote WHEP stream, an MP4 fileRegister an input of the matching typeinputs-and-outputs.md

Where does the result go?

DestinationOutputRead
Your own web or mobile appWHIP output into a Fishjam livestream room. Your app's users join that room as livestream viewers with the client SDK (../react-client/livestream.md, same hooks in React Native).inputs-and-outputs.md
YouTube, Twitch, or another streaming platformRTMP output to the platform's ingest URL and stream keyinputs-and-outputs.md

What draws the layout?

Use a template unless the layout is fixed. Most real compositions react to something: peers joining a call, someone speaking, a caption or "live" badge toggled from the backend. With static scenes your backend has to track all of that state and rebuild and resend the scene on every change; a template does it inside the composition.

Template (recommended)Static scene
Layout logicReact component running next to the compositionJSON tree built by your backend
Room peers join or leaveRe-renders by itself (usePeers)Backend rebuilds and resends the whole scene
Backend-driven changesendEvent with a small payloadupdateOutput with the whole scene
Extra setupBuild step with @fishjam-cloud/composition-cliNone
Pick it forRoom composition, overlays, captions, anything dynamicA few known inputs in a fixed layout, quick prototypes

Templates are written in TypeScript and React whatever the backend language; a Python backend uploads the built bundle the same way. Read templates.md for templates and scenes.md for the component tree both approaches share.

Flow and SDK calls

Both server SDKs ship a CompositionClient, authenticated with the same management token as FishjamClient (no Fishjam ID needed).

StepJS (@fishjam-cloud/js-server-sdk)Python (fishjam)
1. CreatecreateComposition()create_composition()
2. Register assetsregisterImage, registerFontregister_image, register_font
3. Register inputs, or forward a roomregisterMp4Input, registerWhipInput, …, or fishjamClient.forwardRoomTracksregister_mp4_input, register_whip_input, …, or fishjam_client.forward_room_tracks
4. Register outputsregisterTemplateOutput, registerWhipOutput, registerRtmpOutputregister_template_output, register_whip_output, register_rtmp_output
5. Change while livesendEvent, updateOutputsend_event, update_output
6. Tear downdeleteCompositiondelete_composition

Register in dependency order: assets and inputs before the scenes that reference them, and the destination (for example a livestream room) before the output that pushes to it.

Minimal flow

A looping MP4 composed into a Fishjam livestream room. It uses a static scene to stay self-contained with no build step; for a template version see templates.md. Python equivalent: ../python-server-sdk/composition.md.

ts
import { CompositionClient, FishjamClient } from '@fishjam-cloud/js-server-sdk';
import type { InputId, OutputId } from '@fishjam-cloud/js-server-sdk';

const managementToken = process.env.FISHJAM_MANAGEMENT_TOKEN!;
const fishjamClient = new FishjamClient({ fishjamId: process.env.FISHJAM_ID!, managementToken });
const compositionClient = new CompositionClient({ managementToken });

const livestream = await fishjamClient.createRoom({ roomType: 'livestream' });
const { token } = await fishjamClient.createLivestreamStreamerToken(livestream.id);

const { compositionId } = await compositionClient.createComposition();
await compositionClient.registerMp4Input(compositionId, 'movie' as InputId, {
  url: 'https://smelter.dev/videos/template-scene-race.mp4',
  loop: true,
});
await compositionClient.registerWhipOutput(compositionId, 'main' as OutputId, {
  endpointUrl: fishjamClient.livestreamWhipUrl(),
  bearerToken: token,
  video: {
    resolution: { width: 1280, height: 720 },
    initial: { root: { type: 'rescaler', child: { type: 'input_stream', inputId: 'movie' } } },
  },
  audio: { initial: { inputs: [{ inputId: 'movie' }] } },
});

await compositionClient.deleteComposition(compositionId);
await fishjamClient.deleteRoom(livestream.id);

Between registering the output and deleting, viewers watch livestream.id like any Fishjam livestream. Full signatures: ../js-server-sdk/composition.md and ../python-server-sdk/composition.md.

Lifecycle and billing

  • Billed per minute for each registered input and output, whether media flows or anyone watches. Inputs created by forwarding a Fishjam room are not billed. Rates: https://fishjam.swmansion.com/pricing.
  • Unregister inputs and outputs you no longer need; they bill for as long as they stay registered.
  • Starts automatically by default. Create with autostart: false when inputs arrive later (room forwarding), then call start.
  • Idle cleanup: by default a composition is removed after about 5 minutes in which none of its inputs carry media. A composition with no inputs at all counts as idle.
  • cleanup_without_inputs: false makes cleanup wait for inputs and outputs to go silent. Needed for late-joining room peers or input-less templates (captions only). An output that keeps publishing is then never cleaned up for you.
  • Delete explicitly when finished, even after a test. Deleting removes all its inputs and outputs.

Key rules

  • Destinations must exist before you register. An output connects to its endpoint during registration, and an MP4 URL is fetched during registration. Unreachable targets fail the register call, not later.
  • One output per livestream room. A Fishjam livestream accepts one streamer (../platform/room-types.md); push each output to its own livestream room.
  • updateOutput mirrors registration. An output registered with video and audio needs both in every update; one registered with only video accepts only video.
  • Template outputs sound like what they render. Give the output an audio config, or it has no audio track. The mix is every <InputStream> currently rendered; an input that is not rendered, such as a peer with no tile, is silent. Detail: templates.md.
  • Resolution must be even on both sides.
  • Composed rooms use H.264. Create them with videoCodec: "h264" explicitly, even though it is the default, so a changed default cannot break the composition.
  • Casing differs by API. Composition API bodies are snake_case and reject unknown fields. Server API bodies are camelCase (compositionURL, outputId). The SDKs handle both.

References

FileWhen to read
templates.mdcomposition-cli scaffold and build, @fishjam-cloud/composition hooks, eventBus, deploy and redeploy.
scenes.mdComponent tree, audio mix, updating static scenes live, transitions, scheduled changes.
inputs-and-outputs.mdEvery input and output type, publishing into WHIP / RTMP inputs, reaching viewers.
room-composition.mdComposing a Fishjam room end to end with forwardRoomTracks.
rest-endpoints.mdRaw Composition API over HTTP, without an SDK.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Fishjam Composition?

Fishjam compositions: server-side, real-time mixing of several live streams (room peers, WHIP, RTMP, MP4) into new output streams with layouts, overlays, captions, and audio mixes, built on Smelter. Covers lifecycle and billing, static scenes, React templates, composing a room, and the raw Composition API. Use when building a grid or picture-in-picture of a call, restreaming a room to a livestream or to YouTube / Twitch over RTMP, or adding overlays or captions driven from a backend. Trigger on: 'Fishjam composition', 'compose a room', 'CompositionClient', 'createComposition', 'create_compo...

Firwat Fishjam Composition op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Fishjam Composition besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Fishjam Composition an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/software-mansion-labs/skills/tree/main/skills/fishjam/references/composition an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Fishjam Composition benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Fishjam Composition benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Fishjam Composition domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Fishjam Composition gratis?

Jo. software-mansion-labs huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇