Issue Description:
Users are experiencing a lack of video playback when replaying RTC streams, specifically with cases where the pixel buffer is empty during playback.
Platform/SDK:
Agora Native SDK for iOS, involving both live streaming and playback scenarios.
Error Message (optional):
In the logs, users may see messages indicating videoFrame.pixelBuffer = 0, resulting in no video being displayed.
Step by Step Solution:
1. Check Data Transmission Rate:
Ensure that the rate of sending TS (Transport Stream) data does not exceed 4 Mbps.
- If the rate is exceeded, it can cause the video stream to fail to render.
2. Adjust Sending Frequency:
If receiving error codes such as -604, it indicates the UDP socket is full.
- Implement a delay mechanism where, upon receiving this error, the system sleeps for 50-100ms before attempting to resend the TS packet.
3. Log Analysis:
Use debug-level logging in the app to provide detailed logs for inspection.
- Increase log file size to capture longer durations without log rotation.
4. Test with Lower Resolution:
When encountering issues after switching resolutions (like from 4K to 360p), ensure the SDK can process the lower resolution correctly by using compatible SDK versions.
5. Confirmation with New SDK:
Utilize a newer version of the SDK shared by support which may address known issues related to pixel buffer handling.
6. Firmware Update:
Coordinate with firmware developers to ensure the implementation is robust and checks for errors related to packet delivery.
Root Cause:
The primary technical issue is tied to the data transmission rate exceeding threshold limits, causing the video frames to fail in rendering properly. This results in an empty pixel buffer during playback sessions.
Prevention/Best Practice (optional):
- Regularly update to the latest SDK versions to take advantage of bug fixes and improvements.
- Monitor real-time data rates and implement flow control to prevent congestion.
- Use analytics tools to track and analyze stream performance for early detection of anomalies.
Corresponding Document/Link (optional):
For supporting documents or further reading on the Agora data rate limitations and SDK usage guidelines, please refer to Agora's official support documentation.