Skip to main content
GStreamer can push a live stream to Gcore Video Streaming over RTMP or SRT. Get the ingest URL and stream key from the Gcore Customer Portal, then run a gst-launch-1.0 pipeline with H.264 video and AAC audio encoding.

Setup

  1. Install GStreamer and the required plugins. Download instructions are available on gstreamer.freedesktop.org. The pipelines below require the following plugin packages:
    • gstreamer1.0-plugins-ugly — provides x264enc for H.264 encoding
    • gstreamer1.0-libav — provides avenc_aac for AAC encoding
    • gstreamer1.0-plugins-good — provides flvmux, rtpbin, and other elements
  2. In the Gcore Customer Portal, navigate to Streaming → Live Streaming, then open the live stream settings for the target stream. In the URLs for encoder section, select the protocol to use:
    • RTMP — copy the Server URL and Stream Key. Append the Stream Key to the Server URL to form the full ingest URL: rtmp://vp-push-ed2.gvideo.co/in/{STREAM_ID}?{TOKEN}
    • SRT — copy the full SRT URL. The URL format is srt://vp-push-ed2-srt.gvideo.co:5001?streamid={STREAM_ID}#{TOKEN}

Pushing via RTMP

The pipeline below encodes a synthetic test source and sends it to the Gcore RTMP ingest endpoint:
Replace {STREAM_ID} and {TOKEN} with the values from the URLs for encoder section of the live stream settings. The example uses synthetic video and audio sources for testing.

Pushing via SRT

The SRT example keeps the same H.264/AAC encoding settings, then packages the output as MPEG-TS and sends it through srtsink:
Pass the value after ?streamid= as the separate streamid parameter. This avoids URI parsing issues caused by the # separator between the stream ID and token. Replace {STREAM_ID} and {TOKEN} with the values from the portal SRT URL.

Pipeline notes

  • videotestsrc pattern=smpte and audiotestsrc wave=sine are synthetic sources that produce color bar video and a sine tone. Use them to verify the pipeline without a physical camera. Replace them with the appropriate GStreamer source elements when streaming from a real device or file.
  • x264enc tune=zerolatency combined with key-int-max=60 and bframes=0 produces a keyframe every 2 seconds at 30 fps and avoids B-frames, keeping latency low for live ingest.
  • For this RTMP pipeline, flvmux streamable=true produces a live FLV stream suitable for RTMP ingest — it enables output of the FLV header before all streams are configured.
  • mpegtsmux multiplexes H.264 and AAC into MPEG-TS, the container used by Gcore SRT ingest. This is why RTMP uses flvmux and SRT uses mpegtsmux.