|
| 1 | +# Conference to Stream |
| 2 | + |
| 3 | +A demo showcasing Fishjam's track forwarding capability combined with [Foundry](https://compositor.live) (Smelter) for real-time video composition. Participants join a video conference, their tracks are automatically forwarded to Foundry, composed into a single stream using a Tiles layout, and made available as a WHEP stream that can be previewed alongside the conference. |
| 4 | + |
| 5 | +## How It Works |
| 6 | + |
| 7 | +1. The backend creates a Foundry composition and a Fishjam conference room with track forwarding enabled. |
| 8 | +2. When a participant joins and publishes their camera/microphone, Fishjam forwards the tracks to Foundry. |
| 9 | +3. The backend listens for `TrackForwarding` notifications via WebSocket and updates the Foundry composition layout (Tiles grid + audio mix). |
| 10 | +4. The frontend displays the conference (via Fishjam React SDK) side-by-side with a live WHEP preview of the composed stream. |
| 11 | + |
| 12 | +## Running Locally |
| 13 | + |
| 14 | +Before running, copy `.env.example` to `.env` and set the following values: |
| 15 | + |
| 16 | +```bash |
| 17 | +FISHJAM_ID=... |
| 18 | +FISHJAM_MANAGEMENT_TOKEN=... |
| 19 | +VITE_FISHJAM_ID=... |
| 20 | +``` |
| 21 | + |
| 22 | +You can get `FISHJAM_ID` and `FISHJAM_MANAGEMENT_TOKEN` for free by logging in at <https://fishjam.io/app>. `VITE_FISHJAM_ID` should be set to the same value as `FISHJAM_ID`. |
| 23 | + |
| 24 | +### Docker Compose (Recommended) |
| 25 | + |
| 26 | +The easiest way to run the app is with [Docker Compose](https://docs.docker.com/compose/install/). |
| 27 | + |
| 28 | +```bash |
| 29 | +docker compose --env-file .env up --build |
| 30 | +``` |
| 31 | + |
| 32 | +The web UI will be available at <http://localhost:5173> and the backend at <http://localhost:8080>. |
| 33 | + |
| 34 | +### Running Manually |
| 35 | + |
| 36 | +#### Requirements |
| 37 | +- [Go](https://go.dev/dl/) `>= 1.23` |
| 38 | +- [Node.js](https://nodejs.org/en/download) `>= 20` |
| 39 | + |
| 40 | +#### Backend |
| 41 | + |
| 42 | +```bash |
| 43 | +cd backend |
| 44 | +go run main.go |
| 45 | +``` |
| 46 | + |
| 47 | +The server starts on <http://localhost:8080> by default. |
| 48 | + |
| 49 | +#### Frontend |
| 50 | + |
| 51 | +```bash |
| 52 | +cd web |
| 53 | +npm install |
| 54 | +npm run dev |
| 55 | +``` |
| 56 | + |
| 57 | +Open the UI at <http://localhost:5173>. |
| 58 | + |
| 59 | +## Repo Structure |
| 60 | + |
| 61 | +- `backend/` — Go server that orchestrates Fishjam rooms and Foundry compositions. |
| 62 | + - `fishjam/` — REST client for rooms, peers, and track forwarding + WebSocket notification listener (protobuf). |
| 63 | + - `foundry/` — HTTP client for Foundry composition API (create, start, register/update output). |
| 64 | + - `handler/` — HTTP handlers and in-memory room state management. |
| 65 | + - `proto/` — Generated protobuf Go code for Fishjam server notifications. |
| 66 | +- `web/` — React + Vite frontend. |
| 67 | + - `components/JoinForm.tsx` — Room name and user name form. |
| 68 | + - `components/Conference.tsx` — Peer grid with camera/mic controls + WHEP preview sidebar. |
| 69 | + - `components/WhepPlayer.tsx` — WHEP stream player using WebRTC. |
| 70 | + - `whep.ts` — WHEP client (SDP negotiation over HTTP). |
| 71 | + |
| 72 | +### Tech Stack |
| 73 | + |
| 74 | +- [Fishjam](https://fishjam.io) for real-time videoconferencing and track forwarding. |
| 75 | +- [Foundry / Smelter](https://compositor.live) for real-time video composition. |
| 76 | +- Go backend with direct HTTP/WebSocket calls (no SDK). |
| 77 | +- React + Vite frontend with `@fishjam-cloud/react-client`. |
| 78 | +- Tailwind CSS for styling. |
0 commit comments