### Install and Start TrueTime Meetings Source: https://www.red5.net/docs/red5-cloud/development/truetime-meetings Commands to clone the repository, install dependencies, and start the development server. ```bash # Clone the repository git clone https://github.com/red5pro/red5-truetime-meetings cd truetime-meetings # Install dependencies npm install --legacy-peer-deps # Start the development server npm start ``` -------------------------------- ### Navigate to installation directory Source: https://www.red5.net/docs/red5-pro/users-guide/installation/archive/auto-aws-wav/ubuntuinstall Change to the directory where you want to run the Red5 Pro instance. The example uses /usr/local. ```bash cd /usr/local ``` -------------------------------- ### Initialize and Publish with Red5WebrtcClient Source: https://www.red5.net/docs/red5-cloud/development/sdks/ios-sdk A minimal example demonstrating how to build the client, set the renderer, start a preview, and initiate publishing or subscription. ```swift import WebRTC import Red5WebRTCKit // Create video renderer let videoRenderer = RTCMTLVideoView() videoRenderer.contentMode = .scaleAspectFill videoRenderer.videoContentMode = .scaleAspectFill // Build client let webrtcClient = Red5WebrtcClientBuilder() .setStreamManagerHost("userid-xxx-xxx.cloud.red5.net") .setPort(443) .setAppName("live") .setStreamName("myStream") .setVideoEnabled(true) .setAudioEnabled(true) .setVideoWidth(640) .setVideoHeight(480) .setVideoFps(30) .setVideoBitrate(750) .setEventListener(self) .build() // Set renderer on client webrtcClient.setVideoRenderer(videoRenderer) // Start preview webrtcClient.startPreview() // Publish a stream webrtcClient.publish() // Subscribe to a stream webrtcClient.subscribe() ``` -------------------------------- ### Build examples with make Source: https://www.red5.net/docs/red5-pro/development/sdks/red5-core-sdk/examples/red5-core-sdk-examples-overview Navigate to the examples directory and run make to build the examples. ```bash cd ~/Red5Core//examples make ``` -------------------------------- ### Build examples on Linux/MacOS Source: https://www.red5.net/docs/red5-pro/development/sdks/red5-core-sdk/examples Compile the examples using make. ```bash cd ~/Red5Core//examples make ``` -------------------------------- ### Quick Start: Configure client, listen for events, and join a room Source: https://www.red5.net/docs/red5-cloud/development/sdks/conference-sdk This example shows how to import the ConferenceClient and ConferenceEvents, configure the client with host, nodeGroup, ICE servers, and PubNub keys, listen for USER_PUBLISHED and NEW_PARTICIPANT events, and join a room with media stream and role. It uses async/await and requires a valid auth token and media stream from getUserMedia. ```javascript import { ConferenceClient, ConferenceEvents } from 'red5pro-conference-sdk'; // 1. Configure the client const config = { host: 'your-red5-pro-host', nodeGroup: 'your-node-group', iceServers: [{ urls: 'stun:stun.l.google.com:19302' }], pubnubPublishKey: 'your-pubnub-publish-key', pubnubSubscribeKey: 'your-pubnub-subscribe-key' }; const client = new ConferenceClient(config); // 2. Listen for events client.on(ConferenceEvents.USER_PUBLISHED, (event) => { console.log('Successfully published to room:', event.streamName); }); client.on(ConferenceEvents.NEW_PARTICIPANT, (participant) => { console.log('New participant joined:', participant.userId); // Auto-subscribe to the new participant client.subscribe(participant); }); // 3. Join a room const joinParams = { roomId: 'my-awesome-room', userId: 'user-' + Math.floor(Math.random() * 1000), token: 'your-auth-token', role: 'publisher', mediaStream: await navigator.mediaDevices.getUserMedia({ video: true, audio: true }), videoEnabled: true, audioEnabled: true }; await client.join( joinParams.roomId, joinParams.userId, joinParams.token, joinParams.role, joinParams.mediaStream, joinParams.videoEnabled, joinParams.audioEnabled ); ``` -------------------------------- ### Execute the basic example Source: https://www.red5.net/docs/red5-pro/development/sdks/red5-core-sdk/red5-core-sdk-mac Runs the basic example binary. For each example, see the README for expected behavior. ```bash ./r5sdk_example_basic ``` -------------------------------- ### Start Red5 Pro Server on OSX and Linux Source: https://www.red5.net/docs/red5-pro/development/red5-pro-plugin/red5-pro-plugin-example Use the terminal to navigate to the installation directory and execute the startup script. ```bash ./red5.sh ``` -------------------------------- ### Install GCC via Homebrew Source: https://www.red5.net/docs/red5-pro/development/sdks/red5-core-sdk/red5-core-sdk-mac Installs the GCC compiler using Homebrew, a prerequisite for building the SDK examples. ```bash brew install gcc ``` -------------------------------- ### Install Go SDK package Source: https://www.red5.net/docs/red5-cloud/development/sdks/backend-sdk/go-golang Install the Red5 Go Backend SDK using go get. The package is not published yet, so you must obtain it from the support team. ```bash go get github.com/red5pro/red5-bcs-go ``` -------------------------------- ### InsecurePlatformWarning example Source: https://www.red5.net/docs/red5-pro/users-guide/installation/archive/ssl/installing Example warning that may appear during installation and can be disregarded. ```text InsecurePlatformWarning ./root/.local/share/letsencrypt/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. ``` -------------------------------- ### Install Red5 skills with npx Source: https://www.red5.net/docs/red5-pro-basics/resources/ai-coding-assistant-skills Run the bundled setup wizard directly with npx. It detects your AI tool (Claude Code or Codex), asks for install level, downloads the skills directory from GitHub, and installs both skills. ```bash npx red5pro-skills ``` -------------------------------- ### Run the installer Source: https://www.red5.net/docs/red5-pro/users-guide/installation/red5pro-installer Execute the main installer script to launch the interactive menu. ```bash sudo ./red5proInstaller.sh ``` -------------------------------- ### PortMux start-up log entries Source: https://www.red5.net/docs/red5-pro/users-guide/red5-pro-single-port-muxing Example log output when PortMux starts, showing TCP and UDP ports, buffer sizes, and acceptor bindings. ```log INFO com.red5pro.service.portmux.PortMux - PortMux start - TCP port: 443 UDP port: 5082 INFO com.red5pro.service.portmux.codec.MuxRequestDecoder - Initialized with ports - HTTP: 5080 HTTPS: 5443 RTMP: 1935 RTSP: 8554 INFO com.red5pro.service.portmux.PortMux - TCP send buffer size: 65536 recv buffer size: 65536 so linger: 1000 INFO com.red5pro.service.portmux.PortMux - TCP acceptor bound on: /0:0:0:0:0:0:0:0:443 INFO com.red5pro.service.portmux.PortMux - UDP send buffer size: 65536 recv buffer size: 65536 INFO com.red5pro.service.portmux.PortMux - UDP acceptor bound on: /0.0.0.0:5082 ``` -------------------------------- ### Get Provision Status Source: https://www.red5.net/docs/red5-pro/development/api/stream-manager-2.0/restreamer/stream-manager-2.0-restreamer-example-rtmp-pull Queries the status of the provision's streams. Note: the example uses `zixi1` as the provision GUID, which may be a typo; the actual provision GUID is `rtmppull1`. ```bash curl -H "Authorization: Bearer ${JWT}" https://as-test1.example.org/as/v1/streams/provision/nodegroup1/zixi1?status=true | json_pp ``` -------------------------------- ### Client setup with master credentials Source: https://www.red5.net/docs/red5-cloud/development/sdks/backend-sdk/go-golang Import the package and create a new client using your master credentials. Replace YOUR_MASTER_KEY and YOUR_MASTER_SECRET with your actual credentials. ```go package main import ( "fmt" "log" "github.com/red5pro/red5-bcs-go" ) func main() { masterKey := "YOUR_MASTER_KEY" masterSecret := "YOUR_MASTER_SECRET" client, err := red5bcs.NewRed5Client(masterKey, masterSecret) if err != nil { log.Fatal(err) } } ``` -------------------------------- ### Install NTP and unzip Source: https://www.red5.net/docs/red5-pro/users-guide/installation/archive/auto-digital-ocean/create-sql-database Install NTP and unzip packages on the droplet. ```bash apt-get install unzip ntp ``` -------------------------------- ### Get Applications API Response Example Source: https://www.red5.net/docs/red5-pro/development/api/server/red5-pro-server-applications-api Example JSON response for a successful GET request to the applications endpoint. ```json { "status": "success", "code": 200, "data": [ "api", "live" ], "timestamp": 1467060546158 } ``` -------------------------------- ### Full application example Source: https://www.red5.net/docs/red5-cloud/development/sdks/backend-sdk/go-golang Complete example that creates a client, generates an admin conference token (2 hours) and a chat token (read/write, 1 hour), and prints them. ```go package main import ( "fmt" "log" "github.com/red5pro/red5-bcs-go" ) func main() { masterKey := "MASTER_KEY" masterSecret := "MASTER_SECRET" client, err := red5bcs.NewRed5Client(masterKey, masterSecret) if err != nil { log.Fatal(err) } // Admin conference token (2 hours) adminToken, err := client.GetConferenceToken( "userA", "room1", "admin", 120, ) if err != nil { log.Fatal(err) } fmt.Println(adminToken) // Chat token (read/write, 1 hour) chatToken, err := client.GetChatToken( "userA", "channel1", true, true, 60, ) if err != nil { log.Fatal(err) } fmt.Println(chatToken) } ``` -------------------------------- ### Get Alarm Threshold - Example request URI Source: https://www.red5.net/docs/red5-pro/development/api/archive/rest-api-v-310/smapi-alarms Example GET request URI with a sample access token. ```http http://{host}:{port}/streammanager/api/3.1/admin/alarm/scaleout/default?type=edge&accessToken=xyz123 ``` -------------------------------- ### Get Alarm Threshold - Example success response Source: https://www.red5.net/docs/red5-pro/development/api/archive/rest-api-v-310/smapi-alarms Example JSON response for a successful GET request, showing a threshold of 60. ```json { "id": 1, "type": "SCALEOUTALARM", "metric": "CONNECTIONS", "unit": "PERCENTAGE", "threshold": 60, "comparator": "GREATERTHAN", "targetType": "GROUP" } ``` -------------------------------- ### Autoplay in 3.5.0 SDK: play() on Subscriber Source: https://www.red5.net/docs/red5-pro/development/sdks/red5-webrtc-sdk/red5-webrtc-sdk-migrating-from-3-5-to-4 In SDK 3.5.0, calling play() on a Red5ProSubscriber automatically starts playback upon successful subscription. The example shows a basic subscriber setup with a video element without autoplay attribute. ```html ``` -------------------------------- ### Full application example Source: https://www.red5.net/docs/red5-cloud/development/sdks/backend-sdk/node Complete example that initializes the client, generates an admin conference token (2 hours) and a chat token (read/write, 1 hour), and logs both. ```javascript import Red5Client from 'red5-bcs-node'; async function main() { const masterKey = "MASTER_KEY"; const masterSecret = "MASTER_SECRET"; const client = new Red5Client(masterKey, masterSecret); // Admin conference token (2 hours) const adminToken = await client.getConferenceToken( "userA", "room1", "admin", 120 ); console.log(adminToken); // Chat token (read/write, 1 hour) const chatToken = await client.getChatToken( "userA", "channel1", true, true, 60 ); console.log(chatToken); } main(); ``` -------------------------------- ### Red5 WebRTC SDK Implementation Example Source: https://www.red5.net/docs/red5-pro/development/sdks/red5-webrtc-sdk/red5-webrtc-sdk-example A complete HTML structure including the WebRTC adapter, video containers for publishing and subscribing, and the JavaScript logic to initialize and start the WHIP and WHEP clients with StreamManager 2.0 endpoint configuration. ```html
``` -------------------------------- ### getLiveStreamStatistics Example Request Source: https://www.red5.net/docs/red5-pro/development/api/server/red5-pro-server-streams-api A concrete example of a GET request for stream statistics. ```http http://localhost:5080/api/v1/applications/live/streams/stream1?accessToken=xyz123 ``` -------------------------------- ### Example output of df -h Source: https://www.red5.net/docs/red5-pro/users-guide/installation/archive/auto-oci/nfs-on-oci Example output showing the NFS mount. ```text 10.0.0.39:/AutoScaleTestFileSystem 8.0E 0 8.0E 0% /usr/local/red5pro/webapps/live/streams ``` -------------------------------- ### Execute the basic example on Linux/MacOS Source: https://www.red5.net/docs/red5-pro/development/sdks/red5-core-sdk/examples/red5-core-sdk-examples-overview Run the basic example executable from the basic directory. ```bash cd ~/Red5Core//examples/basic ./r5sdk_example_basic ``` -------------------------------- ### stopStreamRecord Example Request Source: https://www.red5.net/docs/red5-pro/development/api/server/red5-pro-server-streams-api A concrete example of a GET request to stop recording for a specific stream. ```http http://localhost:5080/api/v1/applications/live/streams/stream1/action/stoprecord?accessToken=xyz123 ``` -------------------------------- ### Start Red5 Pro and tail log (startred5pro.sh) Source: https://www.red5.net/docs/red5-pro/users-guide/installation/archive/auto-aws-wav/red5proservice Creates a script to start the Red5 Pro service and follow the log file. Make it executable with chmod +x startred5pro.sh. Note that starting via systemctl produces no console logging; logs are written to /log/red5.log. ```bash #!/bin/bash sudo systemctl start red5pro tail -f /usr/local/red5pro/log/red5.log ``` -------------------------------- ### Install NTP on the instance Source: https://www.red5.net/docs/red5-pro/users-guide/installation/archive/auto-aws/prepare-red5-pro-ami-for-nodes Install NTP (network time protocol) to ensure the Stream Manager and all nodes are in sync. The service should start automatically once installed. ```bash sudo apt-get install ntp ``` -------------------------------- ### Install CMake via Homebrew Source: https://www.red5.net/docs/red5-pro/development/sdks/red5-core-sdk/red5-core-sdk-mac Installs CMake using Homebrew, required for generating build files for the examples. ```bash brew install cmake ``` -------------------------------- ### Navigate to Installation Directory Source: https://www.red5.net/docs/red5-pro/users-guide/installation/archive/jdk8-docs/ubuntuinstall-jdk8 Change the current working directory to /usr/local to prepare for the server installation. ```bash cd /usr/local ``` -------------------------------- ### Publisher example using R5Stream Source: https://www.red5.net/docs/red5-pro/resources/migration-guides/wowza-to-red5-pro-migration-guide/wowza-to-red5-pro-sdk-migration-guide Java code showing how to set up a publisher with R5Configuration, R5Connection, R5Stream, attach camera and microphone, and publish to a live stream. Requires a valid license key and camera access method. ```Java public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.publish_test, container, false); preview = (R5VideoView)rootView.findViewById(R.id.videoView); publish(); return rootView; } protected void publish() { String b = getActivity().getPackageName(); R5Configuration config = new R5Configuration(R5StreamProtocol.RTSP, "your-red5-domain.com", 8554, "live", 0.5); config.setLicenseKey("YOUR_SDK_LICENSE_KEY"); config.setBundleID(b); R5Connection connection = new R5Connection(config); R5Stream publishStream = new R5Stream(connection); Camera cam = openFrontFacingCameraGingerbread(); // Camera access method R5Camera camera = new R5Camera(cam, 640, 480); R5Microphone mic = new R5Microphone(); publishStream.attachCamera(camera); publishStream.attachMic(mic); preview.attachStream(publishStream); publishStream.publish("mystream", R5Stream.RecordType.Live); } ``` -------------------------------- ### GET Request for Stream Metadata Source: https://www.red5.net/docs/red5-pro/development/api/archive/rest-api-v-310/abr-json-schema Example of a GET request to retrieve the provisioned stream metadata from the Stream Manager. ```http https://yourstreammanager.com/streammanager/api/3.1/admin/event/meta/live/mystream?accessToken=myaccessToken ``` -------------------------------- ### Get all Scheduled Events Example Response Source: https://www.red5.net/docs/red5-pro/development/api/archive/rest-api-v-310/smapi-events A concrete example of a successful 200 OK response for a scheduled event. ```json [ { "id": 4, "eventName": "auction", "date": "1537795840000", "data": { "launchConfig": "default", "scalePolicy": "auction", "region": [ { "name": "us-east-1", "info": { "minSubscribers": "15", "minPublishers": "15", "maxPublishers": "20", "maxSubscribers": "20" } } ] }, "state": "pending" } ] ``` -------------------------------- ### Restreamer Provision Example Source: https://www.red5.net/docs/red5-pro/development/api/stream-manager-2.0/stream-manager-2-streams-provision-api Example provision for a restreamer that creates an IP camera stream. It specifies the provision GUID, stream GUID, ABR level 0, and camera parameters including host, port, and remote stream details. ```json { "provisionGuid": "restreamer1", "streams": [ { "streamGuid": "live/test1", "abrLevel": 0, "camParams": { "properties": { "type": "ipcam", "action": "create", "remoteContextPath": "axis-media", "remoteStreamName": "media.amp", "host": "192.168.1.10", "port": 5443 } } } ] } ``` -------------------------------- ### Subscriber example using R5Stream Source: https://www.red5.net/docs/red5-pro/resources/migration-guides/wowza-to-red5-pro-migration-guide/wowza-to-red5-pro-sdk-migration-guide Java code showing how to set up a subscriber with R5Configuration, R5Connection, R5Stream, configure audio controller, and play a live stream. Requires a valid license key. ```Java public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.publish_test, container, false); preview = (R5VideoView)rootView.findViewById(R.id.videoView); subscribe(); return rootView; } protected void subscribe() { String b = getActivity().getPackageName(); R5Configuration config = new R5Configuration(R5StreamProtocol.RTSP, "your-red5-domain.com", 8554, "live", 0.5); config.setLicenseKey("YOUR_SDK_LICENSE_KEY"); config.setBundleID(b); R5Connection connection = new R5Connection(config); R5Stream subscriberStream = new R5Stream(connection); subscriberStream.audioController = new R5AudioController(); subscriberStream.audioController.sampleRate = 44100; preview.attachStream(subscriberStream); subscriberStream.play("mystream", true); } ``` -------------------------------- ### Get Alarm Threshold - URI for transcoder node type Source: https://www.red5.net/docs/red5-pro/development/api/archive/rest-api-v-310/smapi-alarms Example URI for the GET request when the node type is 'transcoder'. ```http http://{host}:{port}/streammanager/api/3.1/admin/alarm/scaleout/default?type=transcoder&accessToken= ``` -------------------------------- ### List Compositions Request Example Source: https://www.red5.net/docs/red5-pro/development/api/archive/rest-api-v-400/smapi-mixer An example response for listing provisioned compositions. ```json [ "test9", "test8", "test1" ] ``` -------------------------------- ### Get Alarm Threshold - URI for relay node type Source: https://www.red5.net/docs/red5-pro/development/api/archive/rest-api-v-310/smapi-alarms Example URI for the GET request when the node type is 'relay'. ```http http://{host}:{port}/streammanager/api/3.1/admin/alarm/scaleout/default?type=relay&accessToken= ``` -------------------------------- ### Create build files with cmake Source: https://www.red5.net/docs/red5-pro/development/sdks/red5-core-sdk/examples/red5-core-sdk-examples-overview Navigate to the examples directory and run cmake to generate build files. ```bash cd ~/Red5Core//examples cmake . ``` -------------------------------- ### Get Alarm Threshold - URI for origin node type Source: https://www.red5.net/docs/red5-pro/development/api/archive/rest-api-v-310/smapi-alarms Example URI for the GET request when the node type is 'origin'. ```http http://{host}:{port}/streammanager/api/3.1/admin/alarm/scaleout/default?type=origin&accessToken= ``` -------------------------------- ### Example .env file configuration for LINODE Source: https://www.red5.net/docs/red5-pro/users-guide/stream-manager-2-0/installation/linode/red5-pro-sm2-linode-create-stream-manager-instance Example .env file with all variables set for a Linode deployment. ```bash R5AS_AUTH_SECRET=12345abcd R5AS_AUTH_USER=admin R5AS_AUTH_PASS=password R5AS_PROXY_USER=proxy_user R5AS_PROXY_PASS=proxy_password R5AS_CLOUD_PLATFORM_TYPE=LINODE KAFKA_HOST=10.0.0.1 TRAEFIK_HOST=red5pro-sm2.example.com TRAEFIK_SSL_EMAIL=email@example.com R5P_LICENSE_KEY=1111-2222-3333-4444 LINODE_API_TOKEN=example123xyz456token789 LINODE_SSH_KEY_NAME=example-ssh-key-name ``` -------------------------------- ### Configure init.d service for auto-start Source: https://www.red5.net/docs/red5-pro/users-guide/installation/stand-alone/red5-pro-install-linux-service Commands to enable the Red5 Pro init.d service on server startup. ```bash sudo /usr/sbin/update-rc.d red5pro defaults sudo /usr/sbin/update-rc.d red5pro enable ``` -------------------------------- ### Get Alarm Threshold - URI for edge node type Source: https://www.red5.net/docs/red5-pro/development/api/archive/rest-api-v-310/smapi-alarms Example URI for the GET request when the node type is 'edge'. ```http http://{host}:{port}/streammanager/api/3.1/admin/alarm/scaleout/default?type=edge&accessToken= ``` -------------------------------- ### Get Log Example Response Source: https://www.red5.net/docs/red5-pro/development/api/server/red5-pro-server-log-access-api An example of a successful response providing a temporary path to download a specific log file. ```json { "status": "success", "code": 200, "data": { "path": "/tmplogs/yFFFbTch/", "comment": "This download will expire in 60 seconds.", "name": "red5.log", "lastModified": 1514900045099, "size": 29642 }, "timestamp": 1515766780094 } ``` -------------------------------- ### List Launch Configurations Example Response Source: https://www.red5.net/docs/red5-pro/development/api/archive/rest-api-v-310/smapi-launchconfig An example of a successful response containing a list of configuration names. ```json [ "alltypes-01", "default-v3" ] ``` -------------------------------- ### GET /as/v1/streams/stream/default/subscribe/{streamGuid} Source: https://www.red5.net/docs/red5-pro/users-guide/stream-manager-2-0/stream-manager-2-explicit-provisioning Gets an edge server for subscribing to a stream variant. The stream GUID is specified as a path parameter. ```APIDOC ## GET /as/v1/streams/stream/default/subscribe/{streamGuid} ### Description Gets an edge server for subscribing to a stream variant. The stream GUID is specified as a path parameter. ### Method GET ### Endpoint https://streammanager.example.com/as/v1/streams/stream/default/subscribe/{streamGuid} ### Authentication Requires a valid JWT in the Authorization header as a bearer token. ### Parameters #### Path Parameters - **streamGuid** (string) - Required - The unique identifier of the stream to subscribe to. ### Request Example ``` curl "https://streammanager.example.com/as/v1/streams/stream/default/subscribe/live/stream1_1" ``` ### Response No response body is documented for this endpoint. ``` -------------------------------- ### Example .env file configuration for GCP Source: https://www.red5.net/docs/red5-pro/users-guide/stream-manager-2-0/installation/gcp/red5-pro-sm2-gcp-create-stream-manager-instance Complete example .env file with sample values for all required variables, including GCP_PROJECT_ID. ```bash R5AS_AUTH_SECRET=12345abcd R5AS_AUTH_USER=admin R5AS_AUTH_PASS=password R5AS_PROXY_USER=proxy_user R5AS_PROXY_PASS=proxy_password R5AS_CLOUD_PLATFORM_TYPE=GCP KAFKA_HOST=10.0.0.1 TRAEFIK_HOST=red5pro-sm2.example.com TRAEFIK_SSL_EMAIL=email@example.com R5P_LICENSE_KEY=1111-2222-3333-4444 GCP_PROJECT_ID=example-gcp-project-name ``` -------------------------------- ### recordLiveStream Example Request URI Source: https://www.red5.net/docs/red5-pro/development/api/server/red5-pro-server-streams-api Example URI for starting a recording on stream 'stream1' in application 'live' with access token 'xyz123'. ```http http://localhost:5080/api/v1/applications/live/streams/stream1/action/startrecord?accessToken=xyz123 ``` -------------------------------- ### Start red5pro on node VM Source: https://www.red5.net/docs/red5-pro/users-guide/troubleshooting-and-best-practices/stream-manager-1/sm-1-troubleshooting-installation Run red5pro on the instance by changing to the red5pro home directory (default: /usr/local/red5pro) and running sudo ./red5.sh ```bash sudo ./red5.sh ``` -------------------------------- ### getLiveStreams Example Request URI Source: https://www.red5.net/docs/red5-pro/development/api/server/red5-pro-server-streams-api Example GET request to retrieve live streams from the 'live' application using access token 'xyz123'. ```http http://localhost:5080/api/v1/applications/live/streams?accessToken=xyz123 ``` -------------------------------- ### POST /as/v1/streams/package/default/intent/event-abr Source: https://www.red5.net/docs/red5-pro/users-guide/stream-manager-2-0/video-packager/video-packager-abr Example API calls showing that using the provision GUID or any stream GUID in the ABR ladder resolves to the same package intent. ```http POST /as/v1/streams/package/default/intent/event-abr POST /as/v1/streams/package/default/intent/live/event_1 POST /as/v1/streams/package/default/intent/live/event_2 POST /as/v1/streams/package/default/intent/live/event_3 ``` -------------------------------- ### Copy autoscaling-with-ssl example files Source: https://www.red5.net/docs/red5-pro/users-guide/stream-manager-2-0/installation/aws/red5-pro-sm2-aws-create-stream-manager-instance Copies the example files from the autoscaling-with-ssl folder to the Stream Manager folder. ```bash sudo cp -r ./red5pro-stream-manager-2-examples/autoscaling-with-ssl/. /usr/local/stream-manager/ ``` -------------------------------- ### Start Red5 Pro v15 and monitor startup Source: https://www.red5.net/docs/red5-pro/users-guide/installation/stand-alone/red5-pro-upgrade-v14-to-v15 Starts the Red5 Pro service and tails the log file to monitor startup. Watch for 'Server started' message, no ERROR messages, and plugins loaded successfully. ```bash # Start the service sudo systemctl start red5pro # Monitor startup sudo tail -f /usr/local/red5pro-server-15.0.0/log/red5.log ``` -------------------------------- ### Get Scheduled Event - Example Request URI Source: https://www.red5.net/docs/red5-pro/development/api/archive/rest-api-v-310/smapi-events Example request URI for retrieving the scheduled event named 'auction' with access token 'xyz123'. ```http http://{host}:{port}/streammanager/api/3.1/admin/scheduler/auction?accessToken=xyz123 ``` -------------------------------- ### LiveSeekClient Example Source: https://www.red5.net/docs/red5-pro/development/sdks/red5-webrtc-sdk/red5-webrtc-sdk-live-seek Demonstrates how to create a LiveSeekClient instance, listen to events, initialize with liveSeek configuration, and subscribe to a live stream. ```APIDOC ## LiveSeekClient ### Description Creates a new LiveSeekClient instance. It is an extension of the WHEPClient, providing its familiar API and additional logic to play back historical segments of a live stream using playback controls and events. ### Constructor `new LiveSeekClient()` ### Methods #### init(configuration) Initializes the client with the provided configuration, including liveSeek settings. ##### Parameters - `configuration` (object) - Required - Configuration object. Must include `liveSeek` property. - `liveSeek` (object) - Required - Live seek configuration. - `baseURL` (string | undefined) - Optional - Base endpoint URL to locate the associated m3u8 manifest. If undefined, will look for files on the `host`. Default: `undefined`. Example: `https://myserver.cloud/streams` - `fullURL` (string | undefined) - Optional - Full endpoint URL to locate the associated m3u8 manifest. If undefined, will look for files on the `host`. Default: `undefined`. Example: `https://mycdn.cloud/streams/mystream.m3u8` - `hlsjsRef` (hls.js reference | undefined) - Optional - Explicit reference to HLS.JS dependency. If undefined, the SDK will look for `window.HLS`. Default: `undefined` - `hlsElement` (HTMLVideoElement | undefined) - Optional - Explicit reference to the target video element to load the HLS stream. If undefined, the SDK will autogenerate one. Default: `undefined` - `usePlaybackControlsUI` (boolean) - Optional - Flag to use custom player controls UI from the SDK for scrubbing. Setting to `false` requires that you provide your own controls and interact with the Playback API. Default: `true` - `options` (object | undefined) - Optional - Options to provide to HLS.JS instance directly. Example: `{ debug: false, backBufferLength: 0 }` ##### Returns - Promise that resolves when initialization is complete. #### subscribe() Subscribes to the live stream. ##### Returns - Promise that resolves when subscription is complete. ### Events Events related to live seek start with type: `WebRTC.LiveSeek`. Use `subscriber.on('*', (event) => console.log(event))` to listen to all events. ### Example ```javascript try { const subscriber = new LiveSeekClient() subscriber.on('*', (event) => console.log(event)) await subscriber.init({ ...configuration, liveSeek: { baseURL: undefined, fullURL: undefined, hlsjsRef: undefined, hlsElement: undefined, usePlaybackControlsUI: true, options: { debug: false, backBufferLength: 0 } } }) await subscriber.subscribe() } catch (error) { // Something went wrong... } ``` ``` -------------------------------- ### List Conferences - Example Success Response Source: https://www.red5.net/docs/red5-pro/development/api/archive/rest-api-v-400/smapi-mixer Example successful response (HTTP 201) for listing conferences, returning GUIDs for rooms room1, room2, and room3. ```json [ "guid: live/room1/room1", "guid: live/room2/room2", "guid: live/room3/room3", ] ``` -------------------------------- ### Launch Configuration with Metadata Tags Source: https://www.red5.net/docs/red5-pro/users-guide/installation/archive/auto-aws/tagging Example of a launch configuration JSON structure demonstrating how to define custom tags using the 'metadata' attribute. ```json { "launchconfig": { "name": "default-v2", "description": "This is a sample launch configuration for demonstrating the aws tagging", "image": "{red5pro-ami}", "version": "0.0.2", "targets": { "target": [ { "role": "origin", "instanceType": "t2.micro", "connectionCapacity": "2000" }, { "role": "edge", "instanceType": "t2.micro", "connectionCapacity": "2000" } ] }, "properties": { "property": [ ] }, "metadata": { "meta": [ { "key": "environment", "value": "production" } ] } } } ``` -------------------------------- ### Get All Intent success response Source: https://www.red5.net/docs/red5-pro/development/api/stream-manager-2.0/video-packager/as-streams-package-api Example response body for a successful Get All Intent request. Returns an array of package intent objects with packageKey, properties, and version. ```json [ { "packageKey": { "nodeGroupName": "nodegroup1", "intentGuid": "live/stream1", "type": "STREAM" }, "properties": { "hls.upload.enabled": "true" }, "version": 1 } ] ``` -------------------------------- ### Example .env configuration for DigitalOcean Source: https://www.red5.net/docs/red5-pro/users-guide/stream-manager-2-0/installation/digital-ocean/red5-pro-sm2-digitalocean-create-stream-manager-instance A complete example .env file with all required variables for a DigitalOcean deployment. ```bash R5AS_AUTH_SECRET=12345abcd R5AS_AUTH_USER=admin R5AS_AUTH_PASS=password R5AS_PROXY_USER=proxy_user R5AS_PROXY_PASS=proxy_password R5AS_CLOUD_PLATFORM_TYPE=DO KAFKA_HOST=10.10.0.10 TRAEFIK_HOST=red5pro-sm2.example.com TRAEFIK_SSL_EMAIL=email@example.com R5P_LICENSE_KEY=1111-2222-3333-4444 DIGITAL_OCEAN_API_TOKEN=dop_v1_xxxxxxxx DIGITAL_OCEAN_SSH_KEY_NAME=example-ssh-key-name DIGITAL_OCEAN_PROJECT_NAME=example-do-project-name ``` -------------------------------- ### Install and Configure MySQL on Ubuntu Source: https://www.red5.net/docs/red5-pro/users-guide/installation/archive/auto-managed/create-mysql-database Commands to install the MySQL server, run the security script, and check the service status. ```bash sudo apt-get install mysql-server ``` ```bash sudo mysql_secure_installation ``` ```bash systemctl status mysql.service ``` ```bash sudo systemctl start mysql ``` -------------------------------- ### GET /as/v1/streams/stream/default/subscribe/{streamGuid} Source: https://www.red5.net/docs/red5-pro/users-guide/stream-manager-2-0/stream-manager-2-explicit-provisioning Subscribes to a stream. This endpoint is used to start receiving the stream. ```APIDOC ## GET /as/v1/streams/stream/default/subscribe/{streamGuid} ### Description Subscribes to a stream. This endpoint is used to start receiving the stream. ### Method GET ### Endpoint https://streammanager.example.com/as/v1/streams/stream/default/subscribe/{streamGuid} ### Parameters #### Path Parameters - **streamGuid** (string) - Required - The unique identifier of the stream. ### Request Example No request body is documented. ### Response #### Success Response (200) No response body is documented. #### Response Example No response example is documented. ``` -------------------------------- ### Configure init.d auto-start on boot (Debian/Ubuntu) Source: https://www.red5.net/docs/red5-pro/users-guide/installation/archive/auto-aws-wav/red5proservice Run these commands to enable the Red5 Pro init.d service to start on boot. Do not run if systemd is already configured. ```shell sudo /usr/sbin/update-rc.d red5pro defaults sudo /usr/sbin/update-rc.d red5pro enable ``` -------------------------------- ### Create init.d script for Red5 Pro Source: https://www.red5.net/docs/red5-pro/users-guide/installation/archive/auto-aws-wav/red5proservice Copy this script into /etc/init.d/red5pro to enable starting, stopping, and restarting the Red5 Pro server via init.d. ```shell #!/bin/sh ### BEGIN INIT INFO # chkconfig: 2345 85 85 # description: Red5 Pro streaming server # Provides: Red5 Pro # Required-Start: $local_fs $network # Required-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Red5Pro # processname: red5 ### END INIT INFO PROG=red5 RED5_HOME=/usr/local/red5pro DAEMON=$RED5_HOME/$PROG.sh PIDFILE=/var/run/$PROG.pid start() { # check to see if the server is already running if netstat -an | grep ':5080'; then echo "Red5 is already started..." while netstat -an | grep ':5080'; do # wait 5 seconds and test again sleep 5 done fi cd ${RED5_HOME} && ./red5.sh & } stop() { cd ${RED5_HOME} && ./red5-shutdown.sh } case "$1" in start) start exit 1 ;; stop) stop exit 1 ;; restart) stop start exit 1 ;; **) echo "Usage: $0 {start|stop|restart}" 1>&2 exit 1 ;; esac ``` -------------------------------- ### Get Secret Metadata Response Source: https://www.red5.net/docs/red5-pro/development/api/stream-manager-2.0/stream-manager-2-secrets-api Example response for retrieving metadata for a specific secret. ```json { "nodeGroupName": "nodegroup1", "name": "clusterPassword", "useCases": ["DIGEST", "AUTOSCALING"], "createdAt": 1770000000000, "updatedAt": 1770000000000, "version": 1 } ``` -------------------------------- ### Install MySQL dependencies and server Source: https://www.red5.net/docs/red5-pro/users-guide/installation/archive/auto-linode/create-sql-database Commands to install unzip, NTP, and the MySQL server on the instance. ```bash apt-get install unzip ntp ``` ```bash apt-get install mysql-server ``` -------------------------------- ### Example Success Response Source: https://www.red5.net/docs/red5-pro/development/api/archive/rest-api-v-310/smapi-streamprovision Example response for a GET request to /streammanager/api/3.1/admin/event/meta/live/stream1?accessToken=xyz123. Shows actual stream data with three variants, georules for US and UK, and QoS index 3. ```json { "name": "stream1", "scope": "live", "data": { "meta": { "authentication": { "username": "acme", "password": "acme!newpass" }, "stream": [ { "name": "stream1_1", "bandwidth": 25000, "level": 3, "properties": {} }, { "name": "stream1_2", "bandwidth": 37500, "level": 2, "properties": {} }, { "name": "stream1_3", "bandwidth": 62500, "level": 1, "properties": {} } ], "georules": { "regions": [ "US", "UK" ], "restricted": "false" }, "qos": 3 } }, "updated": 1520946314644 } ``` -------------------------------- ### Example URI for proxy-publisher.html Source: https://www.red5.net/docs/red5-pro/users-guide/installation/archive/auto-digital-ocean/stream-manager-examples Shows how to invoke the proxy-publisher.html example with the required streamName parameter and optional verbose flag. The host, protocol, and port default to the current window's values. ```text https://streammanager.test.com/live/proxy-publisher.html?streamName=stream1&verbose=1 ``` -------------------------------- ### GET /streammanager/api/4.0/admin/event/meta Source: https://www.red5.net/docs/red5-pro/development/api/archive/rest-api-v-400/smapi-mixer Lists conferences that are provisioned through the Stream Manager. Returns an array of conference GUIDs. ```APIDOC ## GET /streammanager/api/4.0/admin/event/meta ### Description Lists conferences that are provisioned through the Stream Manager. ### Method GET ### Endpoint `http://{host}:{port}/streammanager/api/4.0/admin/event/meta?accessToken=` ### Parameters #### Query Parameters - **accessToken** (string) - Required - Access token for authentication. ### Response #### Success Response (200) - Returns an array of strings, each in the format `"guid: //"`. #### Response Example ```json [ "guid: live/room1/room1", "guid: live/room2/room2", "guid: live/room3/room3" ] ``` #### Failure Response (400 or 404) - **errorMessage** (string) - Error message. - **timestamp** (number) - Error timestamp. #### Failure Response Example ```json { "errorMessage": "", "timestamp": } ``` ``` -------------------------------- ### GET /as/v1/streams/stream/default/publish/{streamGuid} Source: https://www.red5.net/docs/red5-pro/users-guide/stream-manager-2-0/stream-manager-2-explicit-provisioning Gets a server for publishing a stream. The stream GUID is specified as a path parameter. The distribute query parameter can be set to false to skip distribution if the provision is already distributed. ```APIDOC ## GET /as/v1/streams/stream/default/publish/{streamGuid} ### Description Gets a server for publishing a stream. The stream GUID is specified as a path parameter. The distribute query parameter can be set to false to skip distribution if the provision is already distributed. ### Method GET ### Endpoint https://streammanager.example.com/as/v1/streams/stream/default/publish/{streamGuid} ### Authentication Requires a valid JWT in the Authorization header as a bearer token. ### Parameters #### Path Parameters - **streamGuid** (string) - Required - The unique identifier of the stream to publish. #### Query Parameters - **distribute** (boolean) - Optional - Whether to distribute the provision. Default is true. Set to false to skip distribution. ### Request Example ``` curl "https://streammanager.example.com/as/v1/streams/stream/default/publish/live/stream1_1?distribute=false" ``` ### Response #### Success Response (200) - **streamGuid** (string) - The stream GUID. - **serverAddress** (string) - The server address. - **nodeRole** (string) - The node role (e.g., origin). - **nodeState** (string) - The node state (e.g., INSERVICE). - **subGroup** (string) - The subgroup (e.g., us-east). #### Response Example ```json [ { "streamGuid": "live/stream1_1", "serverAddress": "192.168.1.10", "nodeRole": "origin", "nodeState": "INSERVICE", "subGroup": "us-east" } ] ``` ``` -------------------------------- ### Example 1: ApplicationAdapter sayHello Method Source: https://www.red5.net/docs/red5-pro/development/api/server/red5-pro-server-applications-api A sample ApplicationAdapter implementation with a sayHello method, followed by the corresponding request and success response. ```java public class Application extends MultiThreadedApplicationAdapter { private static Logger log = Red5LoggerFactory.getLogger(Application.class, "Application"); public String sayHello(String name) { return "Welcome " + name; } } ``` ```text http://localhost:5080/api/v1/applications/api/invoke?accessToken=xyz123 ``` ```json { "method": "sayHello", "parameters": [ "Tony" ] } ``` ```json { "status": "success", "code": 200, "data": "Welcome Tony", "timestamp": 1467193076102 } ```