gst-launch-1.0 pipeline with H.264 video and AAC audio encoding.
Setup
-
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— providesx264encfor H.264 encodinggstreamer1.0-libav— providesavenc_aacfor AAC encodinggstreamer1.0-plugins-good— providesflvmux,rtpbin, and other elements
-
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}
- RTMP — copy the Server URL and Stream Key. Append the Stream Key to the Server URL to form the full ingest URL:
Pushing via RTMP
The pipeline below encodes a synthetic test source and sends it to the Gcore RTMP ingest endpoint:{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 throughsrtsink:
?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=smpteandaudiotestsrc wave=sineare 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=zerolatencycombined withkey-int-max=60andbframes=0produces a keyframe every 2 seconds at 30 fps and avoids B-frames, keeping latency low for live ingest.- For this RTMP pipeline,
flvmux streamable=trueproduces a live FLV stream suitable for RTMP ingest — it enables output of the FLV header before all streams are configured. mpegtsmuxmultiplexes H.264 and AAC into MPEG-TS, the container used by Gcore SRT ingest. This is why RTMP usesflvmuxand SRT usesmpegtsmux.