androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
Apache License 2.0
1.42k stars 331 forks source link

RTSP seeking forward fails after several attempts #595

Open hasan-mohammadi opened 11 months ago

hasan-mohammadi commented 11 months ago

on devices with low ram( 1GB or less), when using Media3 (version 1.1.1) to stream RTSP videos in my Android Kotlin app, I am unable to consistently seek through the video.

Seeking forward and backward works for the first few times, usually 5-10 seeks of 10-15 seconds each. However, after repeating this pattern of short seek attempts, the video will freeze and not play anymore. also, any further seeking stops working. after freezing I can see that video buffered successfully but can not be played anymore.

I enabled logging with setDebugLoggingEnabled(true) for RTSP media source but Logcat shows no errors or warnings when this happens. also releasing player and set mediasource again not working. the only trick that works is moving seekbar to 0:0, waiting to video played from the beginning, and then choosing the right moment with the seekbar.

I have tried:

So it seems the issue lies in my application code handling repeated seeks, and not the stream itself. But I have not been able to pinpoint what exactly is going wrong.

Any help troubleshooting why the RTSP source seems to fail after several seek attempts would be greatly appreciated! Let me know if any other specific code snippets or debug details would be helpful.

microkatz commented 8 months ago

@hasan-mohammadi. Sorry for the delay in response. Would you be able to provide us logs from a bug report created while reproducing this issue? If you're unable to share bug reports publicly, please send them to android-media-github@google.com with the subject Issue #595. Please also update this issue to indicate you've done this.

Also, are you able to reproduce this with the ExoPlayer demo application? You can use the demo application to stream from your RTSP source and try to reproduce. https://developer.android.com/guide/topics/media/exoplayer/demo-application

If the logcat did not show any ExoPlayer logs then you might need to add the EventLogger to your player. https://developer.android.com/guide/topics/media/exoplayer/debug-logging

It would be helpful to see for instance when it froze if the RTSP session setup did not occur.

trycatchx commented 4 months ago

+1