Non-monotonically-increasing PTS

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
garbear Offline
Team-Kodi Developer
Posts: 1,748
Joined: Dec 2010
Reputation: 112
Location: city of angels
Post: #1
I'm working on better understanding VideoPlayer. Specifically, I'm wondering why PTS are out of order:

http://paste.ubuntu.com/23640002/

(excerpt: )

Code:
22:15:49.649 T:2348807136   DEBUG: Calling m_pVideoCodec->Decode() - iSize: 1151, dts: 0.000000, pts: 83416.666667
22:15:50.223 T:2348807136   DEBUG: Calling m_pVideoCodec->Decode() - iSize: 54, dts: 41708.333333, pts: 250250.000000
22:15:50.224 T:2348807136   DEBUG: Calling m_pVideoCodec->Decode() - iSize: 53, dts: 83416.666667, pts: 166833.333333
22:15:50.224 T:2348807136   DEBUG: Calling m_pVideoCodec->Decode() - iSize: 53, dts: 125125.000000, pts: 125125.000000
22:15:50.224 T:2348807136   DEBUG: Calling m_pVideoCodec->Decode() - iSize: 53, dts: 166833.333333, pts: 208541.666667
22:15:50.527 T:2348807136   DEBUG: CVideoPlayerVideo::CalcDropRequirement - hurry: 1
22:15:50.527 T:2348807136   DEBUG: Calling m_pVideoCodec->Decode() - iSize: 60, dts: 208541.666667, pts: 417083.333333
22:15:50.528 T:2348807136   DEBUG: Calling m_pVideoCodec->Decode() - iSize: 55, dts: 250250.000000, pts: 333666.666667
22:15:50.528 T:2348807136   DEBUG: Calling m_pVideoCodec->Decode() - iSize: 53, dts: 291958.333333, pts: 291958.333333
22:15:50.529 T:2348807136   DEBUG: Calling m_pVideoCodec->Decode() - iSize: 53, dts: 333666.666667, pts: 375375.000000
22:15:50.694 T:2348807136   DEBUG: CVideoPlayerVideo::CalcDropRequirement - hurry: 1
22:15:50.694 T:2348807136   DEBUG: Calling m_pVideoCodec->Decode() - iSize: 60, dts: 375375.000000, pts: 583916.666667
22:15:50.694 T:2348807136   DEBUG: Calling m_pVideoCodec->Decode() - iSize: 55, dts: 417083.333333, pts: 500500.000000
22:15:50.695 T:2348807136   DEBUG: Calling m_pVideoCodec->Decode() - iSize: 53, dts: 458791.666667, pts: 458791.666667
22:15:50.696 T:2348807136   DEBUG: Calling m_pVideoCodec->Decode() - iSize: 53, dts: 500500.000000, pts: 542208.333333
22:15:50.861 T:2348807136   DEBUG: CVideoPlayerVideo::CalcDropRequirement - hurry: 1

This causes packets to be dropped because they're detected as late.

With all the h.264 videos I've tried, pts fluctuates until every 4th frame, where it matches dts. Also, every 4 frames is the period of the "CVideoPlayerVideo::CalcDropRequirement - hurry: 1" message, which shows up about 15 times before going away.

If I have my decoder drop the pts, VideoPlayer will use the rendertime, no packets are dropped, and the video plays fine.

Is this normal behavior? Can someone clarify what's going on?

What does "hurry: 1" mean?

Is it always true that 1 demux packet sent to Decode() == 1 frame?

Thanks for the insights.

BTC: 1JtXwJdGdE9YnYgThWBT2StFCU5sEYkbVD (personal), https://kodi.tv/contribute/donate-bitcoin (foundation). Donations in the form of controllers, especially ones that don't work in Kodi, are also appreciated.
find quote
FernetMenta Offline
Team-Kodi Developer
Posts: 6,190
Joined: Jul 2010
Reputation: 140
Location: Munich
Post: #2
Quote:Is this normal behavior? Can someone clarify what's going on?

I don't see anything wrong here. On h.264 streams frames may be not in output order before decoding. They get reordered by decoder.

Quote:What does "hurry: 1" mean?

Render buffers are about to run dry. Decoder is requested to output as quickly as possible

Quote:Is it always true that 1 demux packet sent to Decode() == 1 frame?

This API is outdated. I dropped the Decode method. retroplayer needs to adapt to this: https://github.com/FernetMenta/kodi-agile
find quote
garbear Offline
Team-Kodi Developer
Posts: 1,748
Joined: Dec 2010
Reputation: 112
Location: city of angels
Post: #3
That answers all my questions ATM. thanks!

Do you have an idea of when/how the agile dev is expected to make it to v18?

BTC: 1JtXwJdGdE9YnYgThWBT2StFCU5sEYkbVD (personal), https://kodi.tv/contribute/donate-bitcoin (foundation). Donations in the form of controllers, especially ones that don't work in Kodi, are also appreciated.
find quote
FernetMenta Offline
Team-Kodi Developer
Posts: 6,190
Joined: Jul 2010
Reputation: 140
Location: Munich
Post: #4
(2016-12-17 10:04)garbear Wrote:  Do you have an idea of when/how the agile dev is expected to make it to v18?

That depends on when devs like you submit required adaptions to the agile branch. Once all required changes are submitted I can create a PR for merging back changes to kodi master.
find quote
da-anda Offline
Team-Kodi Member
Posts: 5,777
Joined: Jun 2009
Reputation: 77
Location: germany
Post: #5
FernetMenta, have you pinged the devs and notified them about the required changes? Garbear didn't seem to be aware, and probably others aren't as well.
find quote
FernetMenta Offline
Team-Kodi Developer
Posts: 6,190
Joined: Jul 2010
Reputation: 140
Location: Munich
Post: #6
(2016-12-19 11:18)da-anda Wrote:  FernetMenta, have you pinged the devs and notified them about the required changes? Garbear didn't seem to be aware, and probably others aren't as well.

At least I informed popcornmix, koying, peak3d, garbear. Also aware at least fritsch, wisler, ace, alwin
find quote
fritsch Offline
Team-Kodi Developer
Posts: 17,897
Joined: Aug 2011
Reputation: 553
Location: Stuttgart*
Post: #7
I already sent patches for ffmpegimage

"Your most vocal users are not reflective of your userbase" J.M.
"Of course, they [XP Users and people with outdated hardware] need to tell the world about the kind of hero they are, and block innovation for everyone else because their decades old OS / hardware needs to work =p" nevcairiel (ffmpeg)
No Debug Log no issue.
find quote
da-anda Offline
Team-Kodi Member
Posts: 5,777
Joined: Jun 2009
Reputation: 77
Location: germany
Post: #8
thanks
find quote