RootEncoder: Handshake S0 crash on AWS MediaLive RTMP transmission

We use AWS MediaLive https://aws.amazon.com/medialive/ for RTMP live transmission. Everything is working as expected, but we get the following error (reproducible) if we do the following:

  • prepare encoders 🆗
  • connect to RTMP endpoint 🆗
  • send media data (audio and video) 🆗
  • stop the connection 🆗
  • stop encoders 🆗
  • prepare encoders (because we want to connect again) 🆗
  • connection to RTMP endpoint 🛑 CRASH

Sidenote: the same works with YouTube RTMP connection without any problem.

Used rtmp-rtsp-stream-client-java version: 2.0.7

Log of our Android (Android 7.1.1):

I/VideoEncoder: 2 encoders found
I/VideoEncoder: Encoder OMX.Nvidia.h264.encoder
I/VideoEncoder: Color supported: 2135033992
    Color supported: 19
    Color supported: 21
    Color supported: 2130708361
    Encoder selected OMX.Nvidia.h264.encoder
I/OMXClient: MuxOMX ctor
I/VideoEncoder: Prepare video info: SURFACE, 1280x720
I/VideoEncoder: bitrate mode CBR not supported using default mode
E/ACodec: [OMX.Nvidia.h264.encoder] storeMetaDataInBuffers (output) failed w/ err -2147483648
W/ACodec: do not know color format 0x7f000789 = 2130708361
I/ACodec: setupAVCEncoderParameters with [profile: Baseline] [level: Level5]
I/ACodec: [OMX.Nvidia.h264.encoder] cannot encode color aspects. Ignoring.
    [OMX.Nvidia.h264.encoder] cannot encode HDR static metadata. Ignoring.
    setupVideoEncoder succeeded
W/ACodec: do not know color format 0x7f000789 = 2130708361
I/VideoEncoder: prepared
E/SurfaceManager: GL already released
I/SurfaceManager: GL initialized
E/SurfaceManager: GL already released
I/SurfaceManager: GL initialized
I/SurfaceManager: GL released
E/SurfaceManager: GL already released
I/SurfaceManager: GL initialized
I/SurfaceManager: GL initialized
I/MicrophoneManager: Microphone created, 32000hz, Stereo
I/AudioEncoder: 1 encoders found
    Encoder OMX.google.aac.encoder
    Encoder selected OMX.google.aac.encoder
I/OMXClient: MuxOMX ctor
I/AudioEncoder: prepared
V/Camera: No recordingCaptureSession to close
V/Camera: open successful 
I/Handshake: writing C0
    C0 write successful
    writing C1
    writing time 1630676498 to c1
    writing zero to c1
    writing random to c1
I/Handshake: C1 write successful
I/Handshake: reading S0
E/RtmpClient: connection error
    java.io.IOException: Handshake error, unexpected -1 S0 received
        at com.pedro.rtmp.rtmp.Handshake.readS0(Handshake.kt:126)
        at com.pedro.rtmp.rtmp.Handshake.sendHandshake(Handshake.kt:64)
        at com.pedro.rtmp.rtmp.RtmpClient.establishConnection(RtmpClient.kt:218)
        at com.pedro.rtmp.rtmp.RtmpClient.connect$lambda-0(RtmpClient.kt:145)
        at com.pedro.rtmp.rtmp.RtmpClient.$r8$lambda$2Ex0pWOcGVHPFRJWQRhtgifpZyQ(RtmpClient.kt)
        at com.pedro.rtmp.rtmp.RtmpClient$$ExternalSyntheticLambda0.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
E/RTMP: Rtmp connection failed Error configure stream, Handshake error, unexpected -1 S0 received

What we do wrong? Any suggestion? Happy to get your feedback! Best, Andrew

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Thank you, everything works with ‘639ad54949’ no errors