POC for rolling our own video streaming! π₯ππ₯
- Vite
- database (Prisma via D1)
- Auth (better auth)
- Storage (via R2)
- Transcoding agents (node + ffmpeg + docker)
Get going with your own video hosting quick n' easy!
- A cloudflare account with a domain
- A computer/server/vps for transcoding agent with Docker installed and a public https reverse proxy
Within your project's wrangler.jsonc
:
-
Replace the
__change_me__
placeholders with a name for your application -
Create a new D1 database:
pnpx wrangler d1 create my-project-db
Copy the database ID provided and paste it into your project's wrangler.jsonc
file:
Copy the example env to env.local:
cp .env.example .env
Ensure you have fnm or nvm installed
Install the node version:
nvm install
# OR
fnm install
Enable pnpm:
corepack enable
π STOP π Ensure that you're using pnpm
and NOT any other package manager π€
Then, install deps:
pnpm i
pnpm run dev
Install ffmpeg on your system
brew install ffmpeg
Copy .env.dev.example to .env in the /src/agent
route
cp .env.dev.example .env
Get cookin!
pnpm run agent:dev