Getting Started
This guide will help you set up your first RTMP stream using the Ingress API.
Prerequisites
- API key for authentication
- FFmpeg installed (for testing)
- A video file or camera for streaming
Step 1: Generate an Ingress
First, create an ingress endpoint by calling the API:
curl -X POST https://live-api.block8910.com/api/ingress/generate \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"roomName": "my-stream-room",
"participantName": "My Stream"
}'You'll receive a response like this:
{
"success": true,
"data": {
"ingressId": "IN_xxxxxxxxxxxxxx",
"url": "rtmp://rtmp.block8910.com:1935/x",
"streamKey": "aAXevUYwfj9K",
"rtmpUrl": "rtmp://rtmp.block8910.com:1935/x/aAXevUYwfj9K",
"roomName": "my-stream-room",
"participantIdentity": "streamer-1234567890",
"participantName": "My Stream",
"wsUrl": "wss://live.block8910.com"
}
}Step 2: Start Streaming
Use the rtmpUrl from the response to start streaming with FFmpeg:
ffmpeg -re -i your-video.mp4 \
-c:v libx264 -preset veryfast -b:v 2000k \
-c:a aac -b:a 128k \
-f flv "rtmp://rtmp.block8910.com:1935/x/aAXevUYwfj9K"Step 3: View the Stream
Viewers can connect using the WebSocket URL and room name:
- WebSocket URL:
wss://live.block8910.com - Room Name:
my-stream-room
Step 4: Clean Up
When you're done streaming, delete the ingress:
curl -X DELETE https://live-api.block8910.com/api/ingress/IN_xxxxxxxxxxxxxx \
-H "x-api-key: YOUR_API_KEY"Next Steps
- Learn about API endpoints
- Follow the FFmpeg streaming tutorial
- Set up OBS streaming