pedroSG94 / RootEncoder

RootEncoder for Android (rtmp-rtsp-stream-client-java) is a stream encoder to push video/audio to media servers using protocols RTMP, RTSP, SRT and UDP with all code written in Java/Kotlin
Apache License 2.0
2.57k stars 775 forks source link

No audio packet #903

Closed vlj21 closed 3 years ago

vlj21 commented 3 years ago

Hi @pedroSG94! Thanks for this great library. We have been encountering a problem with sending audio packets to some devices but video packets are present. We are getting encoding error java.lang.IndexOutOfBoundsException. Here's part the logs.

2021-07-05 14:45:58.225 12931-12931/com.myapp.dev D/AudioRecord: set(): inputSource 8, sampleRate 48000, format 0x1, channelMask 0xc, frameCount 1920, notificationFrames 0, sessionId 0, transferType 0, flags 0, opPackageName com.myapp.dev uid -1, pid -1 2021-07-05 14:45:58.238 12931-12931/com.myapp.dev I/MicrophoneManager: Internal microphone created, 48000hz, Stereo 2021-07-05 14:45:58.240 12931-12931/com.myapp.dev I/AudioEncoder: 2 encoders found 2021-07-05 14:45:58.240 12931-12931/com.myapp.dev I/AudioEncoder: Encoder OMX.google.aac.encoder 2021-07-05 14:45:58.240 12931-12931/com.myapp.dev I/AudioEncoder: Encoder c2.android.aac.encoder 2021-07-05 14:45:58.240 12931-12931/com.myapp.dev I/AudioEncoder: Encoder selected c2.android.aac.encoder 2021-07-05 14:45:58.273 12931-15369/com.myapp.dev D/CCodec: allocate(c2.android.aac.encoder) 2021-07-05 14:45:58.285 12931-15369/com.myapp.dev I/Codec2Client: Available Codec2 services: "software" 2021-07-05 14:45:58.285 12931-15369/com.myapp.dev I/Codec2Client: Creating a Codec2 client to service "software" 2021-07-05 14:45:58.286 12931-15369/com.myapp.dev I/Codec2Client: Client to Codec2 service "software" created 2021-07-05 14:45:58.382 12931-15369/com.myapp.dev I/CCodec: Created component [c2.android.aac.encoder] 2021-07-05 14:45:58.382 12931-15369/com.myapp.dev D/CCodecConfig: read media type: audio/mp4a-latm 2021-07-05 14:45:58.384 12931-15369/com.myapp.dev D/ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.max-count.values 2021-07-05 14:45:58.384 12931-15369/com.myapp.dev D/ReflectedParamUpdater: extent() != 1 for single value type: output.subscribed-indices.values 2021-07-05 14:45:58.384 12931-15369/com.myapp.dev D/ReflectedParamUpdater: extent() != 1 for single value type: input.buffers.allocator-ids.values 2021-07-05 14:45:58.384 12931-15369/com.myapp.dev D/ReflectedParamUpdater: extent() != 1 for single value type: output.buffers.allocator-ids.values 2021-07-05 14:45:58.384 12931-15369/com.myapp.dev D/ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.allocator-ids.values 2021-07-05 14:45:58.384 12931-15369/com.myapp.dev D/ReflectedParamUpdater: extent() != 1 for single value type: output.buffers.pool-ids.values 2021-07-05 14:45:58.384 12931-15369/com.myapp.dev D/ReflectedParamUpdater: extent() != 1 for single value type: algo.buffers.pool-ids.values 2021-07-05 14:45:58.386 12931-15369/com.myapp.dev I/CCodecConfig: query failed after returning 9 values (BAD_INDEX) 2021-07-05 14:45:58.386 12931-15369/com.myapp.dev D/CCodecConfig: c2 config is Dict { c2::u32 coded.bitrate.value = 64000 c2::u32 coded.pl.level = 0 c2::u32 coded.pl.profile = 8192 c2::u32 coding.aac-sbr-mode.value = 3 c2::u32 input.buffers.max-size.value = 2048 c2::u32 input.delay.value = 0 string input.media-type.value = "audio/raw" string output.media-type.value = "audio/mp4a-latm" c2::u32 raw.channel-count.value = 1 c2::u32 raw.sample-rate.value = 44100 } 2021-07-05 14:45:58.387 12931-15369/com.myapp.dev D/CCodecConfig: no c2 equivalents for aac-profile 2021-07-05 14:45:58.387 12931-15369/com.myapp.dev D/CCodecConfig: no c2 equivalents for encoder 2021-07-05 14:45:58.387 12931-15369/com.myapp.dev D/CCodecConfig: c2 config is Dict { c2::u32 coded.bitrate.value = 131072 c2::u32 coded.pl.level = 0 c2::u32 coded.pl.profile = 8192 c2::u32 coding.aac-sbr-mode.value = 3 c2::u32 input.buffers.max-size.value = 4096 c2::u32 input.delay.value = 0 string input.media-type.value = "audio/raw" string output.media-type.value = "audio/mp4a-latm" c2::u32 raw.channel-count.value = 2 c2::u32 raw.sample-rate.value = 48000 } 2021-07-05 14:45:58.387 12931-15369/com.myapp.dev W/Codec2Client: query -- param skipped: index = 1107298332. 2021-07-05 14:45:58.387 12931-15369/com.myapp.dev D/CCodec: setup formats input: AMessage(what = 0x00000000) = { int32_t channel-count = 2 int32_t max-input-size = 7680 string mime = "audio/raw" int32_t sample-rate = 48000 } and output: AMessage(what = 0x00000000) = { int32_t bitrate = 131072 int32_t channel-count = 2 int32_t level = 0 int32_t max-bitrate = 131072 string mime = "audio/mp4a-latm" int32_t profile = 2 int32_t sample-rate = 48000 } 2021-07-05 14:45:58.387 12931-12931/com.myapp.dev I/AudioEncoder: prepared 2021-07-05 14:45:58.388 12931-12931/com.myapp.dev I/VideoEncoder: 3 encoders found 2021-07-05 14:45:58.388 12931-12931/com.myapp.dev I/VideoEncoder: Encoder OMX.qcom.video.encoder.avc 2021-07-05 14:45:58.388 12931-12931/com.myapp.dev I/VideoEncoder: Color supported: 2141391878 2021-07-05 14:45:58.388 12931-12931/com.myapp.dev I/VideoEncoder: Color supported: 2141391876 2021-07-05 14:45:58.388 12931-12931/com.myapp.dev I/VideoEncoder: Color supported: 2141391872 2021-07-05 14:45:58.388 12931-12931/com.myapp.dev I/VideoEncoder: Color supported: 2141391881 2021-07-05 14:45:58.388 12931-12931/com.myapp.dev I/VideoEncoder: Color supported: 2141391882 2021-07-05 14:45:58.388 12931-12931/com.myapp.dev I/VideoEncoder: Color supported: 2141391880 2021-07-05 14:45:58.388 12931-12931/com.myapp.dev I/VideoEncoder: Color supported: 2141391879 2021-07-05 14:45:58.388 12931-12931/com.myapp.dev I/VideoEncoder: Color supported: 2130708361 2021-07-05 14:45:58.389 12931-12931/com.myapp.dev I/VideoEncoder: Encoder selected OMX.qcom.video.encoder.avc 2021-07-05 14:45:58.391 12931-15376/com.myapp.dev I/OMXClient: IOmx service obtained 2021-07-05 14:45:58.400 12931-12931/com.myapp.dev I/VideoEncoder: Prepare video info: SURFACE, 1280x720 2021-07-05 14:45:58.401 12931-12931/com.myapp.dev I/VideoEncoder: bitrate mode CBR not supported using default mode 2021-07-05 14:45:58.404 12931-15376/com.myapp.dev I/ExtendedACodec: setupVideoEncoder() 2021-07-05 14:45:58.404 12931-15376/com.myapp.dev W/OMXUtils: do not know color format 0x7fa30c06 = 2141391878 2021-07-05 14:45:58.404 12931-15376/com.myapp.dev W/OMXUtils: do not know color format 0x7fa30c04 = 2141391876 2021-07-05 14:45:58.405 12931-15376/com.myapp.dev W/OMXUtils: do not know color format 0x7fa30c00 = 2141391872 2021-07-05 14:45:58.405 12931-15376/com.myapp.dev W/OMXUtils: do not know color format 0x7fa30c09 = 2141391881 2021-07-05 14:45:58.405 12931-15376/com.myapp.dev W/OMXUtils: do not know color format 0x7fa30c0a = 2141391882 2021-07-05 14:45:58.405 12931-15376/com.myapp.dev W/OMXUtils: do not know color format 0x7fa30c08 = 2141391880 2021-07-05 14:45:58.406 12931-15376/com.myapp.dev W/OMXUtils: do not know color format 0x7fa30c07 = 2141391879 2021-07-05 14:45:58.406 12931-15376/com.myapp.dev W/OMXUtils: do not know color format 0x7f000789 = 2130708361 2021-07-05 14:45:58.408 12931-15376/com.myapp.dev I/ACodec: setupAVCEncoderParameters with [profile: High] [level: Level1] 2021-07-05 14:45:58.409 12931-15376/com.myapp.dev I/ACodec: [OMX.qcom.video.encoder.avc] cannot encode HDR static metadata. Ignoring. 2021-07-05 14:45:58.409 12931-15376/com.myapp.dev I/ACodec: setupVideoEncoder succeeded 2021-07-05 14:45:58.409 12931-15376/com.myapp.dev I/ExtendedACodec: [OMX.qcom.video.encoder.avc] configure, AMessage : AMessage(what = 'conf', target = 17) = { int32_t color-format = 2130708361 int32_t i-frame-interval = 2 string mime = "video/avc" int32_t width = 1280 int32_t bitrate = 3072000 int32_t max-input-size = 0 int32_t frame-rate = 30 int32_t height = 720 int32_t encoder = 1 } 2021-07-05 14:45:58.409 12931-15376/com.myapp.dev W/OMXUtils: do not know color format 0x7f000789 = 2130708361 2021-07-05 14:45:58.431 12931-12931/com.myapp.dev I/VideoEncoder: prepared 2021-07-05 14:45:58.431 12931-12931/com.myapp.dev D/LiveStreamManager$LiveStreamReceiver: isAudioReady: true 2021-07-05 14:45:58.431 12931-12931/com.myapp.dev D/LiveStreamManager$LiveStreamReceiver: isVideoReady: true 2021-07-05 14:45:58.431 12931-12931/com.myapp.dev D/LiveStreamManager$LiveStreamReceiver: isInternalAudio: true 2021-07-05 14:45:58.432 12931-12931/com.myapp.dev D/AudioRecord: set(): inputSource 0, sampleRate 48000, format 0x1, channelMask 0xc, frameCount 9600, notificationFrames 0, sessionId 0, transferType 0, flags 0, opPackageName com.myapp.dev uid -1, pid -1 2021-07-05 14:45:58.439 12931-12931/com.myapp.dev I/MicrophoneManager: Microphone created, 48000hz, Stereo 2021-07-05 14:45:58.439 12931-12931/com.myapp.dev D/AudioRecord: start(18225): sync event 0 trigger session 0 2021-07-05 14:45:58.447 12931-12931/com.myapp.dev D/AudioService: broadcastRecorderState:com.myapp.dev 2021-07-05 14:45:58.448 12931-12931/com.myapp.dev I/MicMM: Microphone started 2021-07-05 14:45:58.448 12931-12931/com.myapp.dev D/LiveStreamManager$LiveStreamReceiver: myapp RTMP is available. 2021-07-05 14:45:58.448 12931-12931/com.myapp.dev D/LiveStreamManager$LiveStreamReceiver: START:myapp_STREAM 2021-07-05 14:45:58.448 12931-12931/com.myapp.dev I/VideoEncoder: started 2021-07-05 14:45:58.450 12931-15375/com.myapp.dev I/MediaCodec: MediaCodec will operate in async mode 2021-07-05 14:45:58.532 12931-12931/com.myapp.dev I/AudioEncoder: started 2021-07-05 14:45:58.563 12931-15369/com.myapp.dev I/MediaCodec: MediaCodec will operate in async mode 2021-07-05 14:45:58.564 12931-15274/com.myapp.dev W/BpBinder: Slow Binder: BpBinder transact took 519 ms, interface=android.hardware.ICamera, code=5 oneway=false 2021-07-05 14:45:58.566 12931-15369/com.myapp.dev W/Codec2Client: query -- param skipped: index = 1342179345. 2021-07-05 14:45:58.566 12931-15369/com.myapp.dev W/Codec2Client: query -- param skipped: index = 2415921170. 2021-07-05 14:45:58.569 12931-15369/com.myapp.dev D/CCodecBufferChannel: [c2.android.aac.encoder#64] Created input block pool with allocatorID 16 => poolID 17 - OK (0) 2021-07-05 14:45:58.570 12931-15369/com.myapp.dev I/CCodecBufferChannel: [c2.android.aac.encoder#64] Created output block pool with allocatorID 16 => poolID 499 - OK 2021-07-05 14:45:58.571 12931-15369/com.myapp.dev D/CCodecBufferChannel: [c2.android.aac.encoder#64] Configured output block pool ids 499 => OK 2021-07-05 14:45:58.573 12931-15369/com.myapp.dev E/ion: ioctl c0044901 failed with code -1: Invalid argument 2021-07-05 14:45:58.577 12931-15387/com.myapp.dev E/SurfaceManager: GL already released 2021-07-05 14:45:58.579 12931-15387/com.myapp.dev I/SurfaceManager: GL initialized 2021-07-05 14:45:58.638 12931-15387/com.myapp.dev E/SurfaceManager: GL already released 2021-07-05 14:45:58.640 12931-15387/com.myapp.dev I/SurfaceManager: GL initialized 2021-07-05 14:45:58.643 12931-12931/com.myapp.dev I/SurfaceManager: GL released 2021-07-05 14:45:58.643 12931-12931/com.myapp.dev E/SurfaceManager: GL already released 2021-07-05 14:45:58.645 12931-12931/com.myapp.dev I/SurfaceManager: GL initialized 2021-07-05 14:45:58.646 12931-12931/com.myapp.dev I/SurfaceManager: GL initialized 2021-07-05 14:45:58.653 12931-12931/com.myapp.dev D/AudioRecord: start(18223): sync event 0 trigger session 0 2021-07-05 14:45:58.705 12931-12931/com.myapp.dev D/AudioService: broadcastRecorderState:com.myapp.dev 2021-07-05 14:45:58.705 12931-12931/com.myapp.dev I/MicMM: Microphone started 2021-07-05 14:45:58.708 12931-12931/com.myapp.dev I/Choreographer: Skipped 30 frames! The application may be doing too much work on its main thread. 2021-07-05 14:45:58.710 12931-12931/com.myapp.dev W/Looper: Slow Looper main: doFrame is 501ms late because of 1 msg, msg 1 took 510ms (seq=11857 running=57ms runnable=18ms io=34ms reclaim=17ms h=android.os.Handler c=kotlinx.coroutines.internal.DispatchedContinuation) 2021-07-05 14:45:58.756 12931-15385/com.myapp.dev I/AudioEncoder: Encoding error java.lang.IndexOutOfBoundsException: off=4, len=7680 out of bounds (size=7680) at java.nio.Buffer.checkBounds(Buffer.java:587) at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:292) at com.pedro.encoder.BaseEncoder.processInput(BaseEncoder.java:168) at com.pedro.encoder.BaseEncoder.inputAvailable(BaseEncoder.java:208) at com.pedro.encoder.BaseEncoder$2.onInputBufferAvailable(BaseEncoder.java:229) at android.media.MediaCodec$EventHandler.handleCallback(MediaCodec.java:1738) at android.media.MediaCodec$EventHandler.handleMessage(MediaCodec.java:1696) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:224) at android.os.HandlerThread.run(HandlerThread.java:67) 2021-07-05 14:45:58.784 12931-15376/com.myapp.dev D/ACodec: dataspace changed to 0x10c10000 (R:2(Limited), P:3(BT601_6_625), M:3(BT601_6), T:3(SMPTE170M)) (R:2(Limited), S:2(BT601_625), T:3(SMPTE_170M)) 2021-07-05 14:45:58.789 12931-15385/com.myapp.dev I/AudioEncoder: Encoding error java.lang.IndexOutOfBoundsException: off=4, len=7680 out of bounds (size=7680) at java.nio.Buffer.checkBounds(Buffer.java:587) at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:292) at com.pedro.encoder.BaseEncoder.processInput(BaseEncoder.java:168) at com.pedro.encoder.BaseEncoder.inputAvailable(BaseEncoder.java:208) at com.pedro.encoder.BaseEncoder$2.onInputBufferAvailable(BaseEncoder.java:229) at android.media.MediaCodec$EventHandler.handleCallback(MediaCodec.java:1738) at android.media.MediaCodec$EventHandler.handleMessage(MediaCodec.java:1696) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:224) at android.os.HandlerThread.run(HandlerThread.java:67) 2021-07-05 14:45:58.794 12931-12931/com.myapp.dev D/ViewBot$startNewInterval: Current Time: 1; Next Increment: 77 2021-07-05 14:45:58.801 12931-15394/com.myapp.dev I/Handshake: writing C0 2021-07-05 14:45:58.801 12931-15394/com.myapp.dev I/Handshake: C0 write successful 2021-07-05 14:45:58.801 12931-15394/com.myapp.dev I/Handshake: writing C1 2021-07-05 14:45:58.801 12931-15394/com.myapp.dev I/Handshake: writing time 1625467558 to c1 2021-07-05 14:45:58.802 12931-15394/com.myapp.dev I/Handshake: writing zero to c1 2021-07-05 14:45:58.802 12931-15394/com.myapp.dev I/Handshake: writing random to c1 2021-07-05 14:45:58.805 12931-15394/com.myapp.dev I/Handshake: C1 write successful 2021-07-05 14:45:58.806 12931-15394/com.myapp.dev I/Handshake: reading S0 2021-07-05 14:45:58.827 12931-15384/com.myapp.dev I/RtmpClient: send sps and pps 2021-07-05 14:45:58.827 12931-15384/com.myapp.dev I/chatty: uid=10445(com.myapp.dev) VideoEncoder identical 2 lines 2021-07-05 14:45:58.828 12931-15384/com.myapp.dev I/RtmpClient: send sps and pps 2021-07-05 14:45:58.832 12931-15385/com.myapp.dev I/AudioEncoder: Encoding error java.lang.IndexOutOfBoundsException: off=4, len=7680 out of bounds (size=7680) at java.nio.Buffer.checkBounds(Buffer.java:587) at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:292) at com.pedro.encoder.BaseEncoder.processInput(BaseEncoder.java:168) at com.pedro.encoder.BaseEncoder.inputAvailable(BaseEncoder.java:208) at com.pedro.encoder.BaseEncoder$2.onInputBufferAvailable(BaseEncoder.java:229) at android.media.MediaCodec$EventHandler.handleCallback(MediaCodec.java:1738) at android.media.MediaCodec$EventHandler.handleMessage(MediaCodec.java:1696) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:224) at android.os.HandlerThread.run(HandlerThread.java:67) 2021-07-05 14:45:58.837 12931-15394/com.myapp.dev I/Handshake: read S0 successful 2021-07-05 14:45:58.837 12931-15394/com.myapp.dev I/Handshake: reading S1 2021-07-05 14:45:58.838 12931-15394/com.myapp.dev I/Handshake: read S1 successful 2021-07-05 14:45:58.838 12931-15394/com.myapp.dev I/Handshake: writing C2 2021-07-05 14:45:58.838 12931-15394/com.myapp.dev I/Handshake: C2 write successful 2021-07-05 14:45:58.838 12931-15394/com.myapp.dev I/Handshake: reading S2 2021-07-05 14:45:58.867 12931-15394/com.myapp.dev I/Handshake: read S2 successful 2021-07-05 14:45:58.875 12931-15385/com.myapp.dev I/AudioEncoder: Encoding error java.lang.IndexOutOfBoundsException: off=4, len=7680 out of bounds (size=7680) at java.nio.Buffer.checkBounds(Buffer.java:587) at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:292) at com.pedro.encoder.BaseEncoder.processInput(BaseEncoder.java:168) at com.pedro.encoder.BaseEncoder.inputAvailable(BaseEncoder.java:208) at com.pedro.encoder.BaseEncoder$2.onInputBufferAvailable(BaseEncoder.java:229) at android.media.MediaCodec$EventHandler.handleCallback(MediaCodec.java:1738) at android.media.MediaCodec$EventHandler.handleMessage(MediaCodec.java:1696) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:224) at android.os.HandlerThread.run(HandlerThread.java:67) 2021-07-05 14:45:58.878 12931-15394/com.myapp.dev I/CommandsManager: send Command(name='connect', transactionId=1, timeStamp=0, streamId=0, data=[AmfString value: connect, AmfNumber value: 1.0, AmfObject properties: {AmfString value: app=AmfString value: live, AmfString value: flashVer=AmfString value: FMLE/3.0 (compatible; Lavf57.56.101), AmfString value: swfUrl=AmfString value: , AmfString value: tcUrl=AmfString value: rtmp://dev.myapp.tv/live, AmfString value: fpad=AmfBoolean value: false, AmfString value: capabilities=AmfNumber value: 239.0, AmfString value: audioCodecs=AmfNumber value: 3191.0, AmfString value: videoCodecs=AmfNumber value: 252.0, AmfString value: videoFunction=AmfNumber value: 1.0, AmfString value: pageUrl=AmfString value: , AmfString value: objectEncoding=AmfNumber value: 0.0}], bodySize=271) 2021-07-05 14:45:58.906 12931-15394/com.myapp.dev I/CommandsManager: read WindowAcknowledgementSize(acknowledgementWindowSize=5000000) 2021-07-05 14:45:58.972 12931-15394/com.myapp.dev I/CommandsManager: read SetPeerBandwidth(acknowledgementWindowSize=5000000, type=DYNAMIC) 2021-07-05 14:45:58.972 12931-15394/com.myapp.dev I/CommandsManager: read SetChunkSize(chunkSize=4096) 2021-07-05 14:45:58.972 12931-15394/com.myapp.dev I/RtmpClient: chunk size configured to 4096 2021-07-05 14:45:58.973 12931-15394/com.myapp.dev I/CommandsManager: read Command(name='_result', transactionId=1, timeStamp=0, streamId=0, data=[AmfString value: _result, AmfNumber value: 1.0, AmfObject properties: {AmfString value: fmsVer=AmfString value: FMS/3,0,1,123, AmfString value: capabilities=AmfNumber value: 31.0}, AmfObject properties: {AmfString value: level=AmfString value: status, AmfString value: code=AmfString value: NetConnection.Connect.Success, AmfString value: description=AmfString value: Connection succeeded., AmfString value: objectEncoding=AmfNumber value: 0.0}], bodySize=190) 2021-07-05 14:45:58.973 12931-15394/com.myapp.dev I/CommandsManager: send Command(name='releaseStream', transactionId=2, timeStamp=0, streamId=0, data=[AmfString value: releaseStream, AmfNumber value: 2.0, AmfNull, AmfString value: FM-Joi4KDk?i=9xrvvrTjZ&l=8a250948d290c6254784aca2ed077c9f], bodySize=86) 2021-07-05 14:45:58.974 12931-15394/com.myapp.dev I/CommandsManager: send Command(name='FCPublish', transactionId=3, timeStamp=0, streamId=0, data=[AmfString value: FCPublish, AmfNumber value: 3.0, AmfNull, AmfString value: FM-Joi4KDk?i=9xrvvrTjZ&l=8a250948d290c6254784aca2ed077c9f], bodySize=82) 2021-07-05 14:45:58.974 12931-15394/com.myapp.dev I/CommandsManager: send Command(name='createStream', transactionId=4, timeStamp=0, streamId=0, data=[AmfString value: createStream, AmfNumber value: 4.0, AmfNull], bodySize=25) 2021-07-05 14:45:58.974 12931-15394/com.myapp.dev I/RtmpClient: success response received from connect 2021-07-05 14:45:59.076 12931-15394/com.myapp.dev I/CommandsManager: read Command(name='onFCPublish', transactionId=0, timeStamp=0, streamId=0, data=[AmfString value: onFCPublish, AmfNumber value: 0.0, AmfNull, AmfObject properties: {AmfString value: level=AmfString value: status, AmfString value: code=AmfString value: NetStream.Publish.Start, AmfString value: description=AmfString value: FM-Joi4KDk?i=9xrvvrTjZ&l=8a250948d290c6254784aca2ed077c9f}], bodySize=149) 2021-07-05 14:45:59.076 12931-15394/com.myapp.dev I/RtmpClient: unknown onFCPublish response received from unknown command 2021-07-05 14:45:59.145 12931-15394/com.myapp.dev I/CommandsManager: read Command(name='_result', transactionId=4, timeStamp=0, streamId=0, data=[AmfString value: _result, AmfNumber value: 4.0, AmfNull, AmfNumber value: 1.0], bodySize=29) 2021-07-05 14:45:59.145 12931-15394/com.myapp.dev I/CommandsManager: send Command(name='publish', transactionId=5, timeStamp=1, streamId=1, data=[AmfString value: publish, AmfNumber value: 5.0, AmfNull, AmfString value: FM-Joi4KDk?i=9xrvvrTjZ&l=8a250948d290c6254784aca2ed077c9f, AmfString value: live], bodySize=87) 2021-07-05 14:45:59.145 12931-15394/com.myapp.dev I/RtmpClient: success response received from createStream 2021-07-05 14:45:59.193 12931-15394/com.myapp.dev I/CommandsManager: read Command(name='onStatus', transactionId=0, timeStamp=0, streamId=0, data=[AmfString value: onStatus, AmfNumber value: 0.0, AmfNull, AmfObject properties: {AmfString value: level=AmfString value: status, AmfString value: code=AmfString value: NetStream.Publish.Start, AmfString value: description=AmfString value: Start publishing}], bodySize=105) 2021-07-05 14:45:59.196 12931-15394/com.myapp.dev I/CommandsManager: send Data(name='@setDataFrame', data=[AmfString value: onMetaData, AmfEcmaArray length: 12, properties: {AmfString value: duration=AmfNumber value: 0.0, AmfString value: width=AmfNumber value: 1280.0, AmfString value: height=AmfNumber value: 720.0, AmfString value: videocodecid=AmfNumber value: 7.0, AmfString value: framerate=AmfNumber value: 30.0, AmfString value: videodatarate=AmfNumber value: 0.0, AmfString value: audiocodecid=AmfNumber value: 10.0, AmfString value: audiosamplerate=AmfNumber value: 48000.0, AmfString value: audiosamplesize=AmfNumber value: 16.0, AmfString value: audiodatarate=AmfNumber value: 0.0, AmfString value: stereo=AmfBoolean value: true, AmfString value: filesize=AmfNumber value: 0.0}], bodySize=284) 2021-07-05 14:45:59.196 12931-15394/com.myapp.dev D/LiveStreamManager$RtmpConnectionListener: LIVESTREAM::CONNECT_SUCCESS 2021-07-05 14:45:59.197 12931-15394/com.myapp.dev D/StreamSocketClient: Socket sending payload: {"stream_id":"FM-Joi4KDk","event":"RECONNECT_STREAM"} 2021-07-05 14:45:59.237 12931-15394/com.myapp.dev I/ImageStreamObject: finish load image 2021-07-05 14:45:59.239 12931-15394/com.myapp.dev I/ImageStreamObject: finish load image 2021-07-05 14:45:59.248 12931-15394/com.myapp.dev I/TextStreamObject: finish load text 2021-07-05 14:45:59.262 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 51 2021-07-05 14:45:59.262 12931-15402/com.myapp.dev D/LiveStreamManager$RtmpConnectionListener: LIVESTREAM::NEW_BITRATE 2021-07-05 14:45:59.264 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 3393 2021-07-05 14:45:59.287 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 1585 2021-07-05 14:45:59.359 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 131569 2021-07-05 14:45:59.364 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 7617 2021-07-05 14:45:59.394 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 881 2021-07-05 14:45:59.429 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 2433 2021-07-05 14:45:59.461 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 3201 2021-07-05 14:45:59.498 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4705 2021-07-05 14:45:59.532 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4369 2021-07-05 14:45:59.567 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4289 2021-07-05 14:45:59.600 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4321 2021-07-05 14:45:59.620 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 3409 2021-07-05 14:45:59.648 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4321 2021-07-05 14:45:59.659 12931-13895/com.myapp.dev W/AudioTrack: restoreTrack_l(18209): dead IAudioTrack, PCM, creating a new one from obtainBuffer() 2021-07-05 14:45:59.687 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4337 2021-07-05 14:45:59.715 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4305 2021-07-05 14:45:59.748 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4305 2021-07-05 14:45:59.785 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4305 2021-07-05 14:45:59.786 12931-12931/com.myapp.dev D/ViewBot$startNewInterval: Current Time: 2; Next Increment: 77 2021-07-05 14:45:59.817 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4305 2021-07-05 14:45:59.845 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4289 2021-07-05 14:45:59.878 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4321 2021-07-05 14:45:59.912 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4289 2021-07-05 14:45:59.946 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4289 2021-07-05 14:45:59.985 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4305 2021-07-05 14:46:00.017 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4305 2021-07-05 14:46:00.053 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4305 2021-07-05 14:46:00.089 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4273 2021-07-05 14:46:00.116 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4289 2021-07-05 14:46:00.151 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4305 2021-07-05 14:46:00.184 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4337 2021-07-05 14:46:00.236 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4321 2021-07-05 14:46:00.265 12931-15402/com.myapp.dev I/RtmpSender: wrote Video packet, size 4321

pedroSG94 commented 3 years ago

I see. The problem seem to be the offset: java.lang.IndexOutOfBoundsException: off=4, len=7680 out of bounds (size=7680) Since I can't reproduce the problem. I will create a fix an a branch and I will share you the commit to test it

pedroSG94 commented 3 years ago

Try last commit: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/commit/aed6232682c00bb511bad0f7e13c1425575d88e4

vlj21 commented 3 years ago

Try last commit: aed6232

Thanks! We'll try it.

vlj21 commented 3 years ago

This seems to fix the problem so far. Thank you. I'm gonna close this issue for now.