-
-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RtmpClient uses H265 encoding to push the stream, and the program crashes with the error message java.lang.IndexOutOfBoundsException: index=20 out of bounds (limit=20) #1544
Comments
Hello, This seems that the SPS is not correct and fail to parse. Can you share me the byte array of SPS, PPS and VPS? |
The following is the sps, pps, and vps data obtained using the decodeSpsPpsFromH265 function,Switch to version 2.4.5, the problem still exists VPS: 0, 0, 0, 1, 64, 1, 12, 1, -1, -1, 1, 64, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 120, -84, 9
SPS: 0, 0, 0, 1, 66, 1, 1, 1, 64, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 0, 3, 0, 120, -96, 3, -64, -128, 17, 7, -53, -106, -76, -92, 37, -110, -29, 1, 1, 0, 0, 3, 0, 1, 0, 0, 3, 0, 15, 8
PPS: 0, 0, 0, 1, 68, 1, -64, -9, -64, -52, -112 |
Ok, I will test it and let you know the result |
Thank you so much! |
I found the error. SPS, PPS and VPS are correct the problem is that you send each buffer in the incorrect parameter. In your case you have: return Triple(vps, sps, pps) But setVideoInfo expect: setVideoInfo(sps: ByteBuffer, pps: ByteBuffer?, vps: ByteBuffer?) And you are using the method like this: mRtmpClient.setVideoInfo(
ByteBuffer.wrap(result.first),
ByteBuffer.wrap(result.second),
ByteBuffer.wrap(result.third)
) According with the previous code should be: mRtmpClient.setVideoInfo(
vps = ByteBuffer.wrap(result.first),
sps = ByteBuffer.wrap(result.second),
pps = ByteBuffer.wrap(result.third)
) |
I'm very sorry that my carelessness caused such a low-level mistake. The problem has been solved |
Closing as solved |
Describe the bug
Using the latest version 2.4.7, RtmpClient uses H265 encoding to push the stream, and the program crashes with the error message java.lang.IndexOutOfBoundsException: index=20 out of bounds (limit=20)
Below is the code I wrote
logcat info
The text was updated successfully, but these errors were encountered: