MOQ Beta | Now Open For Developers / Learn More
Last updated

How to Connect Your Drone or IP Camera Feeds to Red5

how to connect your drone or ip camera feeds to red5

Since it comes up so often during the course of my week, I want to share a few simple options with interested parties for publishing your streams to Red5. This covers all the drones and IP cameras that I’ve had exposure to over the years that do not already have a means to egress via RTMP. While Flash Player is “dead,” RTMP as a protocol certainly is not.

Using GStreamer for Stream Processing

First up is to download the GStreamer application, a powerful multimedia framework that can handle the conversion and streaming process. To learn more about it, read our previous blog on using GStreamer for low-latency streaming.

Discovering Your Stream Format

If you don’t know the format of the video and/or audio (if present) on your drone, the discoverer application can be used to see what you’re working with:

gst-discoverer-1.0 rtsp://10.0.0.10:554/stream

Replace 10.0.0.10:554 in the RTSP stream URL with your drone or camera IP address and port.

Video-Only Streams

When the source only provides video, this is the pipeline you’d use (assuming H.264):

gst-launch-1.0 rtspsrc location="rtsp://10.0.0.10:554/stream" latency=0 name=rtsp ! rtph264depay ! h264parse ! video/x-h264 ! queue ! flvmux name=mux ! rtmpsink location="rtmp://10.0.0.35:1935/live/drone1 live=1"

Audio-Only Streams

If the source is just audio, use this pipeline assuming an AAC codec:

gst-launch-1.0 rtspsrc location="rtsp://10.0.0.221:554/stream" latency=0 name=rtsp ! rtpmp4gdepay ! aacparse ! audio/mpeg ! queue ! flvmux name=mux ! rtmpsink location="rtmp://10.0.0.35:1935/live/remotemic1 live=1"

Combined Audio and Video Streams

Finally, for sources providing both audio and video:

gst-launch-1.0 -v rtspsrc location="rtsp://10.0.0.10:554/stream" latency=0 name=rtsp rtsp. ! rtph264depay ! h264parse ! video/x-h264 ! queue ! mux.video rtsp. ! rtpmp4gdepay ! aacparse ! audio/mpeg ! queue ! mux.audio flvmux name=mux ! rtmpsink location="rtmp://10.0.0.35:1935/live/audvid1 live=1"

Alternative: Red5 Restream API

This example demonstrates the simplest means to get your source devices providing egress via RTSP into Red5 without RTMP, using the Red5 Restream API via curl:

curl -X POST http://10.0.0.35:5080/live/restream \
  -H "Content-Type: application/json" \
  -d '{
    "guid":"live/audvid1",
    "context":"live",
    "name":"audvid1",
    "level":0,
    "parameters":{
      "type":"ipcam",
      "action":"create",
      "remoteContextPath":"stream",
      "remoteStreamName":"",
      "host":"10.0.0.10",
      "port":554
    }
  }'

Note: Postman may also be used for this API call, but that’s not covered here.

Final Notes

These examples use a non-routable network, and you can change the fields to fit your devices and environment. For more detailed information and advanced configurations, see our documentation. Whether you’re working with consumer drones, professional camera equipment, or IP security cameras, these methods should help you get your RTSP streams flowing into Red5 for further distribution and processing.

red5 logo – white bg

The Red5 Team brings together software, DevOps, and quality assurance engineers, project managers, support experts, sales managers, and marketers with deep experience in live video, audio, and data streaming. Since 2005, the team has built solutions used by startups, global enterprises, and developers worldwide to power interactive real-time experiences. Beyond core streaming technology, the Red5 Team shares insights on industry trends, best practices, and product updates to help organizations innovate and scale with confidence.

By Red5 Team

Paul Gregoire is a software engineer, application developer, and network engineer with extensive experience building client-server and rich media applications. He has been a core contributor to the Red5 open-source media server project for many years, helping shape the architecture and development of one of the most widely used open-source media server platforms. His technical background spans server-side Java development, real-time media systems, and cross-platform application development. Paul has also worked with technologies such as Flex and AIR for rich internet applications, PHP for database-driven systems, and mobile development for both Android and iOS. His work focuses on designing scalable architectures and enabling reliable real-time streaming and media applications across a variety of platforms.