Glock is a comprehensive solution consisting of a client library and a server application designed to transmit AV stream from a browser to any output destination using FFmpeg.
npm install glockio
Glock is a comprehensive solution consisting of a client library and a server application designed to transmit AV stream from a browser to any output destination using FFmpeg (for example, YouTube via RTMP).
casto.app
| documentation
bash
npm install glockio
`
Then you can import it in your project:
`typescript
import Client from "glockio";
// Capture AV stream from a video element
const stream = video.captureStream(30);
// Replace with your actual WebSocket server URL and auth key
client = new Client("ws://127.0.0.1:8080", stream, {
debug: false,
authKey: "your-secret-auth-key",
/// ... see other options in the docs
});
// Connect to the server
client.connect().then(() => {
// Start streaming to the destination
client.start({
destinationType: "file",
destination: "video.mp4",
processor: "ffmpeg", // or "gstreamer"
// ... see other options in the docs
});
});
`
$3
To use the server application, clone the repository and run it using Docker Compose:
`bash
git clone https://github.com/castoapp/glock.git
cd glock/server
AUTH_KEY= docker compose up
``