Try Live Demo

Let us introduce to you our game-changing RTSP Output Live Streaming Plugin for Ant Media Server. With this integration users gain the remarkable ability to effortlessly link Ant Media Server with a wide array of RTSP-compatible devices, platforms, and systems.

Ant Media Server is an absolute powerhouse of a media server, capable of handling an impressive array of streaming protocols like WebRTC, RTMP, SRT, RTSP input, WebRTC, DASH and HLS output. But, hang on to your hats because there’s been one noticeable protocol missing from this star-studded lineup โ€“ RTSP output! 

And here’s the thrilling news: we’ve been work hard to bridge this gap, and today, we are thrilled to unveil this update.

Note: The RTSP Output Plugin works with Ant Media Server v2.6.4 and above.

Who can use RTSP Egress?

We explained what Real-Time Streaming Protocol is and how it works in our previous article. Make sure to check it out. Let’s just note here that RTSP remains a top protocol choice for IP cameras and therefore finds the most usage by video surveillance software and apps.  

What are the benefits of using RTSP Output Live Streaming Plugin?

The RTSP Output Plugin seamlessly extends the capabilities of projects built on Ant Media Server enabling it to communicate with external devices and platforms through the RTSP protocol. The most common advantages are:

  • Interoperability: Achieve interoperability with a wide range of RTSP-compatible devices and platforms.
  • Remote Monitoring: Enable remote monitoring and surveillance applications with ease.
  • Live Streaming: Facilitate live streaming from the Ant Media Server to various RTSP clients.
  • Integration: Seamlessly integrate with video management systems, IP cameras, and video surveillance systems that typically use RTSP as an ingestion protocol for applying various analytics on the video stream.

Now, picture this: a high-stakes security surveillance system that heavily relies on IP cameras to vigilantly monitor critical areas. By seamlessly integrating Ant Media Server with this plugin, the security system gains a remarkable superpower. It can effortlessly stream video and audio data in real-time over RTSP, opening up a world of possibilities.

What does this mean in practical terms? Well, for starters, it enables smooth integration with third-party video management systems that are fully compatible with the RTSP protocol.

The best part? Our versatile plugin is no one-trick pony. It’s designed to ingest data in any protocol supported by Ant Media, whether it’s WebRTC, SRT, RTMP, or RTSP, and then effortlessly transform it into RTSP, RTMP, or even RTP if that’s what your heart desires. The possibilities are boundless, and the results are nothing short of spectacular!

How the RTSP Output Plugin works?

In the diagram below, you can see how our RTSP Output Plugin acts as a bridge between Ant Media Server and an RTSP-compatible system:

RTSP Output Live Streaming
How the RTSP Output Plugin works with Ant Media Server

Getting Started with RTSP Output Plugin

How to install the RTSP Output Plugin?

  2. Download the file according to your Antmedia Version
  3. Unzip the file file
  4. Run sudo sh
  5. restart the server
  6. sudo service antmedia restart

The plugin will be installed.

How to get an RTSP output Stream?

There are two ways to register a stream for RTSP output.

  1. If you want to have RTSP output for any stream, you can simply send a REST API request to enable RTSP for that particular stream.
  2. If you want to have RTSP output for every stream without having to call a REST API, you can simply set RTSP by default in the plugin configuration file. In this way, you don’t need to call the rest API, and the RTSP stream will be available for every stream that you publish to Ant Media Server.

REST API Method:

  1. You can send a video stream either with WebRTC, RTMP, RTSP, or SRT.
  2. Send a REST API request. RTSP supports both UDP and TCP, so you can set the protocol as TCP or UDP.
  3. curl -X POST -H "Content-Type: application/json" -d '{"streamId":"stream111","pipeline_type":"RTSP_OUT","protocol":"TCP"}' http://localhost:5080/LiveApp/rest/pipeline/register-pipeline/
  4. Play the stream with ffplay..
  5. Change the IP Address in the command.
  6. ffplay rtsp://

Enabling RTSP by Default In the Configuration File:

  1. Edit to /usr/local/antmedia/gst-plugin.cfg
  2. Set RTSP in Default Protocols to 1 to set the desired protocol and port for RTSP output.
    Screenshot from 2023 09 06 14 32 45
  3. Save the settings.
  4. Restart the server.
  5. Now for every stream that is published to the Ant Media server, The RTSP output stream will be available by default.

Current Limitations

  1. Currently, the plugin is under Beta Release.
  2. Currently, one stream can either be registered for RTSP, RTMP, or a custom Gstreamer pipeline. No two pipelines can be registered at the same time.
  3. For video, we support  : H264 ,  H265 , VP8
  4. For audio, we support : AAC   Opus
  5. The output stream for RTSP is non-muxed.
  6. RTSP can work on top of UDP as well as TCP. But UDP might give Artifact on the video.


The introduction of our RTSP Output Plugin for Ant Media Server marks a thrilling leap towards extending the horizons of this already formidable media server. With the integration of RTSP output, users gain the remarkable ability to effortlessly link Ant Media Server with a wide array of RTSP-compatible devices, platforms, and systems.

We extend an invitation for you to delve into the boundless opportunities that our plugin presents, actively participate in its ongoing development, and join us on this exciting journey to elevate and enrich media streaming experiences for everyone. Together, we can shape the future of media streaming! ๐ŸŒŸ

Start your free 30-day trial today!

Categories: Tutorial

Usama Tahseen

Usama is a Software Engineer at Ant Media. His technical stack includes WebRTC, Gstreamer , FFmpeg , Python, Javascript, Node.js