Posts: 29
Joined: Jun 2015
Reputation:
0
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
Posts: 319
Joined: Mar 2015
Reputation:
25
peak3d
Team-Kodi Member
Posts: 319
2017-04-02, 20:46
(This post was last modified: 2017-04-02, 21:34 by peak3d.)
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