-
-
Notifications
You must be signed in to change notification settings - Fork 784
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
Is there a way to listen to the frames of RTMP packets? #1621
Comments
I don't know what do you mean with "verify that the current frame is correct" but you have multiple methods related to get info about frames in the stream: abstract fun hasCongestion(percentUsed: Float): Boolean
@Throws(RuntimeException::class)
abstract fun resizeCache(newSize: Int)
abstract fun clearCache()
abstract fun getCacheSize(): Int
abstract fun getItemsInCache(): Int
abstract fun getSentAudioFrames(): Long
abstract fun getSentVideoFrames(): Long
abstract fun getDroppedAudioFrames(): Long
abstract fun getDroppedVideoFrames(): Long
abstract fun resetSentAudioFrames()
abstract fun resetSentVideoFrames()
abstract fun resetDroppedAudioFrames()
abstract fun resetDroppedVideoFrames() You can access all this methods with: rtmpStream.getStreamClient().hasCongestion(20f) |
Hello @pedroSG94 , thanks your reply. |
I don't have a way to do it. I think It is not a correct way to work, return frames is not recommended. |
I aim to define the streaming status based on RTMP packet information to provide the client app with the current streaming status. Therefore, I am looking for a way to use RTMP information to determine the status. |
But you don't need get frames to know if the stream status is poor. You can use the bitrate and the method hasCongestion to know it. If your internet speed is not enough to send frames the bitrate provided in the callback will be lower than the provided in prepareVideo + prepareAudio methods. Also, you can check if frames in cache increase or the percent of the cache filled to know if you can't send frames with enough speed using hasCongestion method and methods provided in my other comment. |
Hello, |
Hello @pedroSG94,
I have a situation where, when the network speed is very poor, the streaming becomes unstable or even stops. Is there a way to listen to the frames of RTMP packets so that I can use the packet information to verify that the current frame is correct?
The text was updated successfully, but these errors were encountered: