Skip to content

Stutter on AWS IVS(real-time) RTMP Publishing #867

@jeekpark

Description

@jeekpark

Hello, Sir.

I'm encountering an intermittent stutter (brief buffering or playback freeze) when publishing RTMP streams to AWS IVS. The same stream configuration works fine with AWS MediaLive, but AWS IVS(real-time) consistently exhibits this stutter. Below are my current encoder settings and environment details:

Environment & Settings: (Tried things...)

  • Platform: Android
  • Encoder Library: SrsEncoder (latest commit)
  • Video Settings:
    • Codec: H.264
    • Profile: Baseline
      (We set the "profile" to MediaCodecInfo.CodecProfileLevel.AVCProfileBaseline to disable B-frames)
        videoFormat.setInteger("profile", MediaCodecInfo.CodecProfileLevel.AVCProfileBaseline);
        videoFormat.setInteger("level", MediaCodecInfo.CodecProfileLevel.AVCLevel3); 
  • Keyframe Interval (IDR Interval):
    VGOP = 48 and VFPS = 24 (i.e., a 2-second interval; we have also tested with a 1-second interval)
  • x264 Preset: "veryfast,zerolatency,b-frames=0, sliced-threads=0"
    public void setVideoHDMode() {
        vBitrate = 1200 * 1024;  // 1200 kbps
        x264Preset = "veryfast,zerolatency,bframes=0,sliced-threads=0";
    }
  • Resoultion: 1280 * 720
  • Bitrate: 1200 kbps

Current Situation:

  • The methods onGetPcmFrame and onGetRgbaFrame in SrsEncoder log normal frame cache values and steadily increasing presentation timestamps (PTS), with no apparent issues in encoding or buffer processing.
  • When publishing via AWS MediaLive, the stream plays without stutter. However, when publishing to AWS IVS, the viewer experiences a brief stutter every second.
  • The AWS IVS RTMP Publishing documentation recommends a keyframe interval of 1–2 seconds, disabling B-frames, and using a lower maximum bitrate (e.g., below 6 Mbps) to prevent stream disconnects. We have applied these recommended settings.

Please

  • Are there any additional encoding settings or stream configuration adjustments we should consider to mitigate the 1-second stutter on AWS IVS?

We have implemented all the recommended settings (keyframe interval of 1–2 seconds, B-frame disablement via Baseline profile, and a conservative maximum bitrate) as outlined in the documentation, yet the issue persists.

Thank you for your assistance.


Reference

https://docs.aws.amazon.com/ivs/latest/RealTimeUserGuide/rt-stream-ingest.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions