Skip to content

Set up the source stream using GStreamer

Use GStreamer, a command-line tool to configure your source stream.

We recommend using GStreamer v1.18 or later.

Terminal window
gst-launch-1.0 -v
videotestsrc ! video/x-raw,width=1920,height=1080,framerate=30/1 !
x264enc tune=zerolatency bitrate=500 speed-preset=superfast key-int-max=60 !
h264parse ! queue ! mux.
audiotestsrc ! audio/x-raw,rate=44100 !
voaacenc bitrate=128000 ! queue ! mux.
flvmux streamable=true name=mux !
rtmpsink location="rtmp://<rtmp-server-ip-or-url>/<path>"

The table describes each part of the command:

CommandDescription
videotestsrcThis is a test video source in GStreamer, which generates a test pattern. Replace this with your actual video source (e.g. v4l2src for webcams).
video/x-raw,width=1920,height=1080,framerate=30/1This caps filter sets the resolution and framerate of the raw video (1920x1080 sets the resolution to 1080p).
x264encEncodes the video as H.264. tune=zerolatency lowers latency. bitrate=500 sets the bitrate to 500 kbps. speed-preset=superfast selects the encoding-speed preset. key-int-max=60 sets a 60-frame keyframe interval, which is two seconds at 30 frames per second. Match this value to the Input key frame interval configured in MK.IO. h264parse prepares the H.264 stream for RTMP.
CommandDescription
audiotestsrcA test audio source for generating sample audio. Replace with your own audio source.
voaacencEncodes the audio to AAC, which is compatible with RTMP.
queueAdds buffers between streams to help with sync issues.
CommandDescription
flvmuxPacks the H.264 video (and audio if included) into an FLV container, suitable for RTMP.
rtmpsinkSends the output stream to an RTMP server.
location="rtmp://<rtmp-server-ip-or-url>/<path>"The RTMP Input URL provided after you start the live event.
© 2025–2026 MediaKind. All rights reserved.