RidgeRun Metadata/RidgeRun Metadata Catalog/RTMP

From RidgeRun Developer Wiki

Follow Us On Twitter LinkedIn Email Share this page





NVIDIA partner logo NXP partner logo






Introduction

Real-Time Messaging Protocol (RTMP) is a TCP-based communication technology originally developed by Macromedia (later Adobe) for Flash Player, designed to transmit audio, video, and data in real time. While Flash has been deprecated, RTMP remains widely used as a first-mile ingestion protocol, transporting live video streams from an encoder to a media server or CDN before being repackaged into modern delivery formats such as HLS or DASH.

Within RTMP, metadata is typically carried inside the FLV container using Action Message Format (AMF) messages. Common metadata events include:

  • onMetaData – provides details about the stream (duration, resolution, codecs, etc.).
  • onCuePoint – inserts markers for synchronization (e.g., chapters or timed events).
  • onTextData – carries text-based information such as subtitles or annotations.

To enable flexible metadata workflows over RTMP, RidgeRun extended the standard flvmux and flvdemux elements to support metadata injection and extraction. These extensions introduce three key properties:

  • meta-string: allows insertion of string-based metadata into the RTMP/FLV stream.
  • meta-binary: enables embedding of binary metadata.
  • GstFlvMeta: metadata can also be added via GstMeta, allowing applications to attach custom metadata directly to buffers.

On the extraction side, metadata can be obtained either by enabling the emission of a signal from the demux or by configuring it to attach a GstMeta containing the extracted metadata to the output buffers.

This design ensures that metadata can be transmitted alongside video/audio in RTMP streams without breaking compatibility with existing RTMP servers or ingestion workflows.

Supported Protocols and Containers

  • Protocols: RTMP (including RTMPS for secure transport) is the primary protocol. RTMP operates over TCP, and while no longer supported natively by browsers, it is still standard for ingestion in platforms such as YouTube Live, Facebook Live, and Twitch.
  • Containers: Metadata is encapsulated within FLV (Flash Video), the native container for RTMP. FLV tags carry the audio, video, and AMF-encoded metadata streams.

Benefits and Limitations

Benefits

Category Item Description
Benefits Low latency Designed for real-time transmission, ideal for live streaming and interactive applications.
Adaptive streaming Supports adaptive bitrate delivery, adjusting quality dynamically.
Stable and reliable Optimized for continuous live transport with minimal buffering.
Codec support Works with H.264 video and AAC/MP3 audio, ensuring broad compatibility.
Industry adoption Still supported by major platforms (YouTube, Facebook, Twitch) for ingestion.
Custom metadata support RidgeRun’s plugin enables embedding custom metadata directly in the FLV/RTMP pipeline.
Limitations Server dependency Requires an RTMP server for ingest; playback usually requires re-packaging to HLS/DASH.
Limited codec support Does not support newer codecs such as H.265, VP9, or AV1.
Restricted playback Mainly used for ingestion; playback is uncommon in modern workflows.
Firewall/network issues RTMP traffic may be blocked by certain firewalls or NAT setups.

Examples

  • Injecting metadata into an RTMP stream using meta-string

Sender

gst-launch-1.0 -e   videotestsrc is-live=true pattern=smpte ! video/x-raw,framerate=30/1 !   x264enc tune=zerolatency speed-preset=ultrafast key-int-max=60 byte-stream=false !   video/x-h264,stream-format=avc,alignment=au !   flvmux name=mux streamable=true meta-string="hello_word" !   rtmpsink location="rtmp://127.0.0.1/live/test"

Receiver

gst-launch-1.0 -m   rtmpsrc location="rtmp://127.0.0.1/live/test" !   flvdemux attach-flvmeta=true flv-meta-signal=true name=d     d.video ! identity silent=false ! fakesink sync=false     d.audio ! fakesink sync=false}}
  • Injecting metadata into an RTMP stream using meta-binary
    Link
  • Injecting metadata into an RTMP stream injecting GstFlvMeta
    Link

Documentation

Documentation
For more technical details and advanced usage, see the official RidgeRun wiki: