androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.74k stars 416 forks source link

Improve ability to seek frame by frame forward and backward #1248

Open folio3-naveedali opened 7 months ago

folio3-naveedali commented 7 months ago

Version

Media3 main branch

More version details

In my android application, user needs to identify the frame and then request for the process on the frame. When I pause the video and shift in frame backward or forward the behaviors is not correct. first time it always shifts frame to opposite direction. Frame forward shift code: val seekPositionForNewFrame = exoPlayer.currentPosition + ((1000 / fps)) exoplayer.seekTo(seekPositionForNewFrame)

Frame Backward shift code: val seekPositionForNewFrame = exoPlayer.currentPosition - ((1000 / fps)) exoplayer.seekTo(seekPositionForNewFrame)

Mostly videos used are 60 fps.

Devices that reproduce the issue

Samsung x200. Android virtual device PIXEL C tablet.

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

Play downloaded video, pause video. shift frame forward or backward. on first time it always reproduces.

Expected result

Smooth shift to new frame

Actual result

First time it shifts to opposite direction, may the viual display and currentPosition is not synced properly.

Media

In the video share privately, I pause and then, hit previous frame every time. but on first frame its always forward shift

Bug Report

folio3-naveedali commented 7 months ago

Hi @marcbaechinger, could you able to look in to the issue?

folio3-naveedali commented 7 months ago

This issue is reproducible when we pause the video and note the the current time, and playing again and seeking to same time using player.seekTo(resumeTime) aswell.

marcbaechinger commented 7 months ago

Thanks for your report.

These seeking issues are known issues. Seeking with ExoPlayer is currently not efficient enough for your use case. There are several approaches how we think this can be improved, but this is not something we currently work on.

To set the expectations, I mark this issue as an enhancement rather than a bug. This expresses that there probably won't be a fix available short term.