androidx / androidx/media

RTSP seeking forward fails after several attempts

Open
#595 2 comments 0 reactions 1 assignee View on GitHub

@microkatz is already working on this.

Since Aug 21, 2023.

needs triage question
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

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:

  • Properly releasing and re-preparing the player on each seek
  • Adjusting the min and max buffer ms values by setBufferDurationsMs(1000, 5000, 500, 1000)
  • Testing with a simple RTSP sample app where seeking works fine
  • Using an RTSP stream that claims to support seeking
  • Try to do seeking manually

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.