Stream with RTMPS

Learn to create, configure, and broadcast live streams over RTMPS with the FastPix API.

Starting a live stream is easy with FastPix. After you've created it, you'll find numerous options to connect live video and kick off your broadcast. This guide walks you through setting up your RTMPS live stream using FastPix API, followed by using a broadcasting software like OBS or vMix.


Activate your account


To get started with FastPix, activate your account and follow the dashboard setup steps in the Activate Account page. Learn more about creating your account, setting up a workspace, and generating your API credentials (Access Token ID and Secret Key).


Create a live stream

To create your first live streaming with FastPix, use the below API reference:

POST request to the create a new stream endpoint.

The username and password that you would use in the POST request can be replaced with your own access token details (Access Token ID and Secret Key) generated from the FastPix Organization dashboard.


curl -X POST https://api.fastpix.io/v1/live/streams \
  --user {ACCESS_TOKEN_ID}:{SECRET_KEY} \
  -H 'content-type: application/json' \
  -d '{
    "playbackSettings": {
      "accessPolicy": "public"
    },
    "inputMediaSettings": {
      "maxResolution": "1080p",
      "reconnectWindow": 60,
      "mediaPolicy": "public",
      "metadata": {
        "livestream_name": "fastpix_livestream"
      }
    }
  }'

Let’s talk about the request parameters


accessPolicy: Determines if access to the streamed content is kept private or available to all. Possible values: public or private

maxResolution: Max resolution can be used to control the maximum resolution your media is encoded, stored, and streamed at. Accepts only 1080p, 720p, 480p resolutions and by default it’s set to 1080p.

reconnectWindow: It mainly works when any network issue occurs. The Reconnect Window determines how long the system waits (in seconds) before declaring a live stream as over; due to a disconnect. If not specified, it defaults to 60 seconds.

mediaPolicy: This flag determines the access policy (public/private) for media content created after the live stream has concluded. It specifies how the recorded stream will be handled in terms of availability, permissions, and visibility. Based on the flag's configuration, the media can either be made publicly accessible, restricted to certain users, or archived for internal use. This ensures proper control over the distribution and access of content after the live event has ended.

metadata: Arbitrary user-supplied metadata that will be included in the stream details and related webhooks. This can be used to store your own ID for a video along with the livestream. You can have maximum of 255 characters and upto 10 entries are allowed.


Getting a 201 successful response

You'll receive a Playback ID and a Stream Key in the response.



 {
   "success":true,
   "data":{
      "streamId":"64a5574d6c7434c7b3b3c39df546e293",
      "streamKey":"144366148d7594c26495afe7505f5ed9k64a5574d6c7434c7b3b3c39df546e293",
      "srtSecret":"43e2e2441d0a5c1b7840515a83e6c599k64a5574d6c7434c7b3b3c39df546e293",
      "trial":false,
      "status":"idle",
      "maxResolution":"1080p",
      "maxDuration":28800,
      "createdAt":"2025-11-06T09:27:37.651957Z",
      "reconnectWindow":60,
      "enableRecording":true,
      "enableDvrMode":false,
      "mediaPolicy":"public",
      "metadata":{
         "livestream_name":"fastpix_livestream"
      },
      "lowLatency":false,
      "closedCaptions":false,
      "playbackIds":[
         {
            "id":"352be991-80e6-4fcc-bd4b-47f71a184fab",
            "accessPolicy":"public"
         }
      ],
      "srtPlaybackResponse":{
         "srtPlaybackStreamId":"play64a5574d6c7434c7b3b3c39df546e293",
         "srtPlaybackSecret":"56bbd725e720a754ce88a4d8c2e5a518k64a5574d6c7434c7b3b3c39df546e293"
      }
   }
} 

Let’s talk about response parameters


streamId: After a live stream is created, a unique identifier is assigned to the stream.

streamKey: A stream key is a string of characters generated by FastPix when you create a live stream event. This string acts like a unique identifier or password, which is necessary to link your broadcasting software (like OBS, vMix) with FastPix.


NOTE

The main purpose of a stream key is to ensure that your live video stream is correctly directed from your broadcasting software to the intended platform. This key allows third-party live stream services, such as OBS, vMix to authenticate and send the live video feed to the platform.


Why is a stream key important?

  • Authentication: The stream key authenticates your broadcasting software with the streaming platform. This ensures that the platform knows which account and which specific event the video feed belongs to.
  • Security: The stream key acts like a password. Only someone with the correct stream key can send a live video feed to your streaming event. This helps prevent unauthorized users from broadcasting on your channel.
  • Uniqueness: Each stream key is unique to a specific live stream event. This means that even if someone has your previous stream key, they cannot use it for future streams. You will get a new stream key for each new live event you create.


srtSecret: The SRT Secret Key is used in relation to the SRT protocol for secure live stream broadcasting. This key ensures encrypted transmission of media over the SRT connection, safeguarding the stream from unauthorized access or tampering. For more detailed information on SRT, refer to stream with SRT .

trial: The flag indicates whether the organization you logged into is subscribed to either the enterprise plan or the test plan. The system automatically fetches the organization’s plan status and assigns a value based on this subscription.


NOTE

PATCH and Simulcast functionalities do not work for test streams (when the parameter is set to true).


maxDuration: This setting defines the maximum time limit for which a customer can conduct a live stream. After the live stream reaches this time limit, it stops automatically. This feature is particularly useful for managing resources and ensuring that streams adhere to the plan's restrictions.

  • Depending on the organization's plan, the system retrieves a maxDuration value.
  • For organizations with a test plan, the maximum duration is 300 seconds (5mins).
  • For users on a Pay as you go plan, the maximum allowed duration is 28800 seconds (8 hours).

status: It gives you the current live stream status.

  • idle indicates that no live stream is currently in progress (the stream hasn't started yet).
  • preparing signifies that the stream is in the preprocessing phase, preparing to transition to the active state.
  • active means that the live stream is ongoing (the video is currently being streamed).
  • disabled means that streaming has been stopped, and no further streams can be published.

NOTE

After the stream ends then automatically the status gets updated from active to idle and again if the stream starts then it changes to active. This happens till the stream duration is within the limits.

  • The status updates to disabled when the duration limit is reached.
  • The stream will no longer be accessible after it is disabled.

createdAt: It displays the UTC date-time when the live stream is created.


enableRecording: This value indicates whether the live stream is being recorded, allowing it to be saved and accessed later. By default, the system returns true in the response, meaning that all live streams will be recorded automatically.

Recording live streams is beneficial for creating archived content, allowing users to replay the stream later, or providing access to those who missed the live event.

playbackId:It is an array of playback ids for a live stream. playbackId in FastPix's Live Stream API work just like those for a video media. They allow you to do things like play live stream , grab thumbnails from a video, or make timeline hover previews with your player.

SrtPlaybackStreamId: A unique identifier used to reference and manage a specific SRT (Secure Reliable Transport) playback stream.

SrtPlaybackSecret: A secret key used to authenticate and secure access to the SRT playback stream.

enableDvrMode: If true, enables DVR (time-shifting) mode for the live stream, allowing viewers to pause, rewind, or fast-forward during the live broadcast. Requires the stream to support DVR; the playback URL must include dvrMode=true to enable time-shift controls.

lowLatency: Enables low-latency streaming mode. When enabled, end-to-end delay is minimized.

closedCaptions: Indicates whether closed captions are enabled for the livestream.


Start broadcasting

FastPix supports live streaming using the RTMPS and SRT protocol, widely compatible with various broadcasting software, hardware, and mobile applications.

To start live streaming, you or your users need software capable of pushing an RTMPS or SRT stream. This software will be configured using the Stream Key obtained earlier, along with FastPix's RTMPS or SRT Server URL.

How to stream using SRT?


NOTE

SRT is particularly effective when streaming over long distances or across different geographical regions, as it handles network jitter and packet loss much better than traditional protocols.


RTMPS server URL: rtmps://live.fastpix.io:443/live

SRT server URL: srt://live.fastpix.io:778

The above URLs are the standard entry points to stream live with FastPix. This is compatible with almost every streaming applications and services.

Here's how to stream using OBS :



The software you use for broadcasting guides you on how to start and stop an RTMPS session. After you begin the session, the software will send live video to FastPix. At that point, the live stream status changes to active, showing that it's receiving the RTMPS stream and ready to play using the Playback ID.


Live streaming webhooks

The moment someone begins streaming video and the live stream status changes, your application can respond using Webhooks. FastPix sends several related events. Depending on what kind of user experience you're aiming for, your application might take benefit from some of these events or might not if these events are not that relevant.

Related guides:


Playback live stream

To watch a live stream, use the unique PLAYBACK_ID you received when setting up the live stream, along with stream.fastpix.io, to get the URL for playback using HTTP Live Streaming (HLS).


https://stream.fastpix.io/{PLAYBACK_ID}.m3u8

If you wish to playback the live stream in FastPix player by integrating into your development project, you can use the below JavaScript SDK to install through CDN.

To install through npm (Node Package Manager) click here.


<script src="https://cdn.jsdelivr.net/npm/@fastpix/player@latest/dist/player.js"></script>
 
<fp-player
  stream-type="live-stream"
  playback-id="{playbackId}"
  primary-color="#F5F5F5"
  accent-color="#5D09C7"
  secondary-color="#000000"
/>

For step-by-step guidance on integrating with our video player, refer to the playback guide .

After everything is set up, you can also integrate FastPix Data into your player to keep track of how the playback is performing.


Stop stream broadcasting

Streamers can stop the broadcast software to disconnect from the FastPix servers. If any reconnect_window time was given as input and the time runs out, then the live stream will change its status to idle.

NOTE
Live streams automatically gets disconnected after 8 hours. For any specific scenarios or requirements where you need more than 8 hours live streams - Contact us.


API endpoints to handle Live stream functions


FastPix has the following endpoints that helps you to broadcast live:

API endpointRequest typeDescription
Create a new streamPOSTCreates a new live stream
Get all live streamsGETFetches all the available live streams
Get stream by IDGETFetches a particular live stream by its ID
Delete a streamDELETEDeletes a stream using live stream ID
Update a streamPATCHUpdates few parameters of a live stream
Get stream playback IDGETFetches playback Id of a live stream
Create a simulcastPOSTCreates a simulcast for a specific livestream
Delete a simulcastDELETEDelete’s a particular simulcast of a livestream
Get a specific simulcast of a stream GETFetches a particular simulcast of a livestream
Update a specific simulcast of a streamPUTEnable or disable a specific simulcast
Create a playback ID POSTGenerates a new playback ID for the live stream
Delete a playback ID DELETEDeletes a previously created playback ID for a live stream