Issue Description
Remote video display may experience a significant delay of several seconds following a remote participant's entry into the channel, persisting even after the SDK has initiated stream reception and decoding. This gap between "hearing audio" and "seeing video" is often referred to as a high First Frame Out (FFO) delay.
Platform/SDK
Platform: iOS
SDK: Agora Video SDK for iOS (v4.x)
Root Cause
The delay occurs due to a timing mismatch between stream decoding and UI binding. When a remote stream is detected, the SDK begins decoding frames immediately. However, if the application waits several seconds after the user has joined to call the rendering setup API, setupRemoteVideo or setupRemoteVideoEx, the decoded frames have no target surface to render on. The SDK must then buffer or wait for the next keyframe, leading to a perceived delay.
Solution
-
Call the Rendering Setup API as Early as Possible
To achieve near-instant rendering, ensure the rendering view is bound before or at the moment the stream arrives. Use setupRemoteVideo for single-channel applications or setupRemoteVideoEx for multi-channel and advanced scenarios.
Known UIDs: If your app knows the remote UID beforehand, call the setup API before joining the channel.
Dynamic UIDs: Call the setup API immediately within the
onUserJoinedcallback. Do not wait for other business logic to complete before binding the view.
-
Enable Instant Video Rendering Optimization
Agora v4.x offers a suite of APIs to minimize FFO time. For maximum impact, use these in combination:
enableInstantMediaRendering: Call this during engine initialization to accelerate the internal rendering pipeline.preloadChannel: If you know the room the user is about to join, call this API to pre-warm the connection and resolve network negotiation before the actual join.startMediaRenderingTracingEx: Enable this feature to trigger the onVideoRenderingTracingResult callback, which provides data for auditing the precise millisecond latency of every stage from channel join to the final rendering of the first video frame.
-
Verify Media Subscription Timing
Confirm that remote video subscription and unmute actions complete before rendering setup, preventing redundant delays.
Best Practice
By ensuring the rendering view is prepared as soon as remote participation is detected, the first remote frame can be displayed immediately, eliminating the several‑second rendering delay.
Corresponding Document/Link
- Video SDK for Unreal Engine - IRtcEngine
- Video SDK for Unreal Engine - IRtcEngineEx