Tools & Utilities
BrightSign Media Server
Media Server
10min
the romediastreamer object allows you to configure a pipeline of multimedia processing elements for execution this may involve streaming the results over rtp or udp, but it is not capable of behaving as a true server, which listens for connections and then acts upon them this is the job of the media server, represented by the romediaserver object the media server waits for requests, deals with any negotiation, and ultimately creates a media streamer pipeline which it executes to fulfill the request the media server currently supports the rtsp protocol (as used, for example, by vlc), and http requests these requests from the client must take the following form protocol //ip address\ port/media streamer pipeline protocol either rtsp or http ip address\ port the ip address of the brightsign player and the port number on which the media server is running for more information, refer to the example below media streamer pipeline a media streamer pipeline as given in previous examples, but without the final destination component (as the destination is implicit in the request from the client) do not use ports 8888 or 9999 since these ports may be used by brightsignos media server features are currently not available in brightauthor classic, but you can set up a streamer/server using the media server https //github com/brightsign/brightauthor plugins/tree/master/media server plugin initialize the media server an rtsp media server can be started as follows s = createobject("romediaserver") s start("rtsp\ port=554") this will start an rtsp server listening on port 554 the port number and streaming protocol can be customized for example, an http server can be started on port 8080 instead as follows s = createobject("romediaserver") s start("http port=8080") the media server supports a number of optional parameters after the port parameter, which may be appended to the command string with an "&" (ampersand) port specifies a port number for the server if this parameter is not specified, the server defaults to 554 for rtsp and 8080 for http trace displays a trace of messages in the negotiation with the client this parameter is useful primarily for debugging rtsp sessions for example rtsp\ port=554\&trace maxbitrate sets the maximum instantaneous bitrate (in kbps) of the rtp transfer initiated by rtsp this parameter has no effect for http the parameter value 80000 (i e 80mbps) has been found to work well the default behavior (also achieved by passing 0) is to not limit the bitrate at all for example rtsp\ port=554\&trace\&maxbitrate=80000 threads sets the maximum number of threads the server is prepared to have running each thread handles a single client request the default value is 5 for example http port=8080\&threads=10 to stop the media server, use the stop() method this actually signals all the threads to stop, but does not wait for this to happen to block until everything has truly finished, either use s terminate() (which may also be used on its own), or simply allow the media server object to be subject to garbage collection media server examples these examples are client side urls that can be pasted into vlc for testing note that spaces between the media streamer pipeline components, as well as filenames containing commas, are not permitted request a file to stream use the following url to request the server to stream a file from local storage rtsp\ //ip address\ port/file ///file ts the loop parameter can be appended to loop the file indefinitely rtsp\ //ip address\ port/file ///file ts?loop use the following to stream the file ts using http instead http //ip address\ port/file ///file ts request an encoded hdmi input stream use the following url to request the server stream its hdmi® input rtsp\ //ip address\ port/hdmi ,encoder request a memory stream memory streaming docid\ ud 8kloqn7xk eq0rhoxi that have been previously configured can be requested either by rtsp or http the following example will stream the memory stream named name, which has been previously set running http //ip address\ port/mem /name/stream ts note that /stream ts is appended to denote the entire stream, rather than merely portions of it (as in the hls case) request an hls stream an indexed (i e non simple) memory stream component must be already running to service an hls request hls streaming can be initiated by requesting the following url http //ip address\ port/mem /name/index m3u8 this will fetch the playlist file for the memory stream named name observe that /index m3u8 must be appended to denote the index file , rather than the stream itself alternatively, if the hls index and segment files have been pre saved onto the storage of the server, they can be accessed by regular http requests this test stream can be used on brightsign players http //qthttp apple com edgesuite net/1010qwoeiuryfg/sl m3u8 http //qthttp apple com edgesuite net/1010qwoeiuryfg/sl m3u8 url syntax for an rtsp client when specifying the url, a brightsign player acting as a client may interpret parts of the url after a "?" (question mark) as options for it to parse; likewise, the stages on the media server that fulfill the client request may expect the same for example, in the following url, it may be ambiguous whether the loop parameter is destined for the player on the client side or the media streamer on the server side rtsp\ //ip address\ port/file ///file ts?loop to clarify this ambiguity, the client side player will look for parameters after the final "?", though it will ignore parameters that it does not recognize to ensure that all parameters are going through to the server side, append an additional final "?" to the url rtsp\ //ip address\ port/file ///file ts?loop? multi device pipeline stages when one player is acting as the streaming client, and another player is acting as the media server, it may at times be necessary for the client to define pipeline stages on the media server for example, the client may require the media server to encode its hdmi input before streaming it over http (because a server cannot stream raw hdmi video frames over the network) in these cases, you can use parentheses in the client request to delineate pipeline stages on the server (http //ip address\ port/hdmi ,encoder ),file ///hdmi ts in the above example, the client side code instructs the media server to encode hdmi input and stream it to the client, which then saves it as a file remote pipelines it is possible to have a client player specify pipeline stages on the media server only for example, the client can have the media server initialize a multicast stream, without actually connecting to the stream the following code will command the media server to initialize a multicast stream using a file on its local storage (remote //ip address\ port/filesimple ///file ts,rtpsimple //239 192 0 0 5004/) the remote protocol and encompassing parentheses indicate to the server that this is a fully self contained pipeline to execute no media is streamed to the client, but any signals (including end of stream and error messages) are forwarded across the socket to the client, which can use the romessageport object to receive such messages resetting the romediastreamer instance on the client side will force the socket connection to close and will thus terminate the pipeline on the server as well