can kodi set framerate info through mediacodec api?

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
yvonne.chen Offline
Junior Member
Posts: 33
Joined: Jun 2015
Reputation: 0
Post: #1
Hello Guys
For some MKV or AVI files with unstable pts. We need to use duration to keep video out smooth. Can kodi send frame-rate to mediacodec ? Thanks!

XBMC-lover & trouble-maker
find quote
Koying Online
Team-Kodi Developer
Posts: 5,784
Joined: Sep 2008
Reputation: 187
Location: Brussels, Belgium
Post: #2
Is it https://developer.android.com/reference/...FRAME_RATE that you want?
In float, I guess?
find quote
peak3d Offline
Team-Kodi Member
Posts: 132
Joined: Mar 2015
Reputation: 10
Post: #3
I guess the issue is: mkv stores DTS and not PTS values.

The current mediacodec implementation handle things wrong: DTS are passed as PTS just hoping that it matches (what is not true for mkv/vc-1 + b-frames).

For linux / amlogic we already changed a.) the kodi implementation and b.) the kernel driver.
For android the simplest way ist simply to pass 0 as timestamp in case we don't have pts from stream container.
Drawback is that a/v sync gets worse over the time.

Solutions:

a.) Use VC-1 Bitstreamconverter and calculate PTS from DTS (nothing magic but need to buffer ~16 frames
b) Talk to amlogic that they adapt our changes to android kernel so we let aml vc-1 decoder do things right.

a.) would be a short term solution, but costs some cpu (b is from cpu for free)

Edit: Just to make it more clear: If you pass 0 as PTS to mediacodec on ARM devices, AML driver uses duration internally.
0 ist the PTS_NO_VALUE value for mediacodec
(This post was last modified: 2017-04-02 21:34 by peak3d.)
find quote
Koying Online
Team-Kodi Developer
Posts: 5,784
Joined: Sep 2008
Reputation: 187
Location: Brussels, Belgium
Post: #4
@peak3d not sure we speak about the same issue.

Amlcodec always needed the framerate, and aml mediacodec is just a layer above amcodec /amplayer if I got it right, so I guess aml mediacodec still needs the framerate, somehow, when mkv are not extracted via the built-in mediaextractor...
find quote