这是indexloc提供的服务,不要输入任何密码
Skip to content

Advise on setting display framerate to match video (in jetpack/kotlin context)? #2602

@markg85

Description

@markg85

Hi,

I'm hacking a lot on NextPlayer to support my own custom way of sharing a video. I can get much of it working but i'm just massively stuck when it comes to frame rate control.

I did disable setVideoChangeFrameRateStrategy.

As the docs describe, i probably want to have CHANGE_FRAME_RATE_ALWAYS for video. The conceptual idea to do this is simple. Get the FPS from your video and set that on the surface with the setFrameRate function. Easy, right?..

Not so much. This is the code context i'm in and i'm having serious issues wrapping my head around how to do this. To make it more to the point in terms of questions:

  1. Where exactly does it make sense in the ExoPlayer API functions to change the surface framerate? I'm thinking as soon as anything gets rendered would be a good time. Hence onRenderedFirstFrame.
  2. But within that scope, how do you get the FPS from a current video?
  3. And how do you even get the surface from that scope?

I'm sorry if these questions seem beginner/n00b questions. I thought so too. But based on the many hours wasted on this (including AI help), it apparently just doesn't trigger for me just yet.

Thank you for any help you can provide!
Mark

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions