Create Sub Second Streams

This page explains how to create a sub second stream and broadcast them to your audience using Castr API.

Create a Sub Second Stream

Sub Second streams can be created easily by sending a request to the Create a new sub second stream endpoint.

Sample Request:

curl --request POST \
     --url https://api.castr.com/v2/sub_second_streams \
     --header 'accept: application/json' \
     --header 'authorization: <your_authentication>' \
     --header 'content-type: application/json' \
     --data '
{
  "name": "NewSubSecondStream",
  "enabled": true
}
'

The endpoint returns a Sub Second Stream object with the ingest information: server and key for putting into your encoder. It also returns all playback URLs and additional information about the Sub Second Stream

Sample Response:

{
  "_id": "69d60e39487fd33f934ce568",
  "name": "NewSubSecondStream",
  "enabled": true,
  "ingest": {
    "server": "rtmp://live.castr.io/static",
    "key": "<key>"
  },
  "playback": {
    "embed_url": "<URL>"
  },
  "platforms": [],
  "settings": {},
  "user": "63be6c169f8c1d3cdbb4491d",
  "creation_time": "2026-04-08T08:13:45.749Z"
}

Start broadcasting

Castr uses the Real-Time Messaging Protocol (RTMP) as a communication protocol for live streaming the data over the Internet. You can use both software and hardware encoders to broadcast the Livestream.

To broadcast a live stream, you must pass the ingest.server URL and the ingest.key value returned by the Create Sub Second Stream URL to your encoding device and stream live video data to it.