RTMP Receiver
Play live RTMP/RTMPS streams in Unreal Engine 5.8: video texture for materials and UMG, spatialized audio, low latency mode, pull from servers and Media Framework.
The RTMP receiver decodes a live H.264/AAC stream and plays it through the Media Framework: you get a video texture for materials and UMG, and a spatialized audio component. It can receive a stream published to this machine (OBS, FFmpeg, another Unreal) or pull one from any RTMP server. See the RTMP overview for complete flows.
Unreal Engine 5.8 and DirectX 12 only
RTMP is supported only on Unreal Engine 5.8, Win64, with the DirectX 12 RHI. Set Project Settings > Platforms > Windows > Default RHI to DirectX 12. On DirectX 11 or Vulkan the GPU encoder refuses to start, and publishing fails with an error.
References
How to use
Blueprint: add a Construct Object from Class node, set Class to IPRtmp Receiver and Outer to self, and store the result in a variable.
Call one of the start nodes (Start From Server, Start Pull or Start Url), then plug Get Video Texture into a material and call Create Audio Component for sound.
C++: Use the code bellow
#include "IPRtmpReceiver.h"
UIPRtmpReceiver* Receiver = NewObject<UIPRtmpReceiver>(this);
Receiver->StartFromServer(Server, TEXT("live"), StreamKey, EIPRtmpLatencyMode::LowLatency);
ScreenMaterial->SetTextureParameterValue(TEXT("Video"), Receiver->GetVideoTexture());
Receiver->CreateAudioComponent(ScreenActor);Keep a reference
Store the receiver in a variable (Blueprint) or a UPROPERTY (C++). An object that nothing references is destroyed by the garbage collector, and the stream stops.
Latency modes
EIPRtmpLatencyMode sets the size of the jitter buffer. Audio is the master clock.
| Mode | Default buffer | Use it for |
|---|---|---|
Low Latency | 150 ms | Lowest delay, on a good local network. More rebuffering on bad networks. |
Smooth (default) | 1000 ms | Internet streams: tolerant to network jitter. |
Latency Ms overrides the buffer size of the mode (0 uses the default above, up to 10000 ms).
Nodes
Start From Server
- Receives the stream published to an
RTMP Serverof this plugin, with the givenAppandStream Key. - The server must already be open: otherwise it returns false and
On Erroris triggered. - You can start the receiver before the publisher connects:
On Startedfires when the stream arrives.
Start Pull
- Plays a stream from an RTMP server: MediaMTX, nginx-rtmp, or another Unreal with playback enabled.
Urlisrtmp://host[:port]/apporrtmps://host[:port]/app. TheStream Key(or view key) is passed separately: it is kept in memory only and never logged.- Reconnects with exponential backoff if the connection drops. Server refusals (unknown key, TLS errors...) are reported through
On Errorand are not retried. - For
rtmps://, certificates are always verified.
Start Url
- Starts from a single URL:
iprtmp://host:port/app/key: a stream published to this machine. The port is served by anRTMP Serveropened on it or, when none exists, by an internal listener.rtmp://host[:port]/app/keyorrtmps://...: plays the stream from that RTMP server, likeStart Pull.
- Prefer
Start PullorStart From Serverwhen the key is a secret, so it is not part of a URL.
Stop
- Stops receiving.
On Endedis triggered if a stream was playing.
Is Active
- Return true between a successful start and
Stop.
Is Streaming
- Return true while a publisher is sending the stream.
Get Video Texture
Media Texturewith the video, usable in materials and UMG. Valid after a start node.
Get Media Player
- The underlying
Media Player, for anything the Media Framework offers.
Create Audio Component
- Creates (or returns) a spatialized
Media Sound Componentplaying the stream audio, attached to the root ofOwner. - Configure attenuation on the returned component as for any audio component. It can be called before or after a start node.
Get Stats
- Return a
FIPRtmpReceiverStatsstruct with the current playback statistics.
Events
On Started
- A publisher started sending the stream (also after the publisher reconnects).
On Ended
- The stream stopped: the publisher disconnected, or
Stopwas called.
On Error
- An error happened: invalid URL, server not open, refused key, TLS error... The message never contains the stream key.
On Frame
- A new video frame was presented.
Framecarries metadata only (never the pixels): width, height, time and fps.
Structs
Receiver Stats
FIPRtmpReceiverStats, returned by Get Stats.
| Field | Type | Description |
|---|---|---|
Streaming | Boolean | A publisher is currently sending this stream. |
Width, Height | Integer | Video size. |
Fps | Float | Video frames handed to the Media Framework per second. |
Bitrate Kbps | Float | Incoming media bitrate (audio + video). |
Buffered Ms | Float | Media buffered ahead of presentation (jitter buffer). Network and encoder delay are not included. |
Audio Sample Rate, Audio Channels | Integer | Audio format. |
Dropped Video Frames, Dropped Audio Frames | Integer64 | Frames dropped since the start. |
Rebuffers | Integer | Times the buffer ran out and playback paused to refill it. |
Discontinuities | Integer | Timestamp jumps of more than 1 s in the incoming stream (for example when the publisher restarts). |
Video Decoder, Audio Decoder | String | Name of the decoders in use. |
Video Frame Info
FIPVideoFrameInfo, sent by On Frame.
| Field | Type | Description |
|---|---|---|
Width, Height | Integer | Frame size. |
Time | Float (double) | Presentation time on the player timeline, in seconds. |
Fps | Float | Frames per second measured over the last second. |
Media Source
The receiver plays through the Media Framework, so streams also work with your own Media Player, Media Texture, Media Sound Component and Media Plate. The plugin registers a media player for these URLs:
iprtmp://0.0.0.0:1935/<app>/<stream key>: a stream published to this machine. The port is served by anRTMP Serveropened on it or, when none exists, by an internal listener.rtmp://host[:port]/<app>[/<key>]orrtmps://...: plays the stream from that RTMP server (pull).
IP Rtmp Media Source (UIPRtmpMediaSource) is the media source for these URLs. Create it at runtime (Construct Object from Class) and open it with the Open Source node of a Media Player.
| Property | Default | Description |
|---|---|---|
URL | iprtmp://0.0.0.0:1935/live/stream | Stream URL, see above. |
Latency Mode | Smooth | See Latency modes. |
Latency Ms | 0 | Jitter buffer target in ms (0 = default of the mode). |
Keys in saved assets
A key written in a URL ends up in saved assets and in source control. Set the URL at runtime, or use Set Stream Key.
Set Stream Key
- Stream key for
rtmp(s)://URLs, kept in memory only (never saved). When empty, the last path segment of the URL is used.
RTMP Server
RTMP/RTMPS server for Unreal Engine: receive OBS and FFmpeg streams, serve viewers with view keys, Blueprint nodes and C++ usage.
RTMP Publisher
Stream Unreal Engine 5.8 to Twitch, YouTube, MediaMTX or nginx-rtmp over RTMP/RTMPS: viewport, render target or scene capture with GPU H.264 and AAC audio.