Menu Close

How to act as a standalone RTSP server?

How Can We Help?

< Back

– install the Rrtsp-simple-server, (the .exe for Windows can be downloaded here) on one of the computers of the LAN (in the example below with IP address

By default this server works “out of the box”, just to put rtsp-simple-server.exe and rtsp-simple-server.yml in a folder of your choice and run rtsp-simple-server.exe.
First initialize this global variable:

int StreamingEncoderId = -1;

then the typical code to start the streaming is:

   // select the video source as usual
   VideoGrabber.VideoSource = ...
   if (EnableStreaming)
      if (FStreamingEncoderId) == -1
         FStreamingEncoderId := VideoGrabber.Encoders_CreateInstanceForStreaming ("rtsp://");
      VideoGrabber.Encoder_SetInt (FStreamingEncoderId, Enc_Video_Enabled_bool, 1);
      VideoGrabber.Encoder_SetStr (FStreamingEncoderId, Enc_Video_Codec, "h264");
      VideoGrabber.Encoder_SetInt (FStreamingEncoderId, Enc_Video_BitRate_kb, 768);
      // enable this section only if audio is needed
      VideoGrabber.Encoder_SetStr (FStreamingEncoderId, Enc_Audio_Codec, "aac");
      VideoGrabber.Encoder_SetInt (FStreamingEncoderId, Enc_Audio_Enabled_bool, 1);
      VideoGrabber.Encoder_SetInt (FStreamingEncoderId, Enc_Audio_SamplesPerSec, 44100);
      // if quality problem increase the number of threads, but this will increase the latency
      VideoGrabber.Encoder_SetInt (FStreamingEncoderId, Enc_Video_Thread_Count, 1);
      VideoGrabber.Encoder_SetInt (FStreamingEncoderId, Enc_IsActive_bool, 1);

– for the TVideoGrabber component(s) that will view the live RTSP stream above, the typical sample code is:

VideoGrabber.VideoSource = vs_IPCamera
VideoGrabber.IPCameraURL = "rtsp://";
VideoGrabber.AudioDeviceRendering = true; // only if audio needed

To create multiple concurrent sessions, just use different stream names, e.g.livestream1, livestream2, mystream3, etc…

Table of Contents
    Your Cart
    Your cart is emptyReturn to Shop