VideoPlayer.Duration returning incorrect number
#1
The infolabel VideoPlayer.Duration is returning 1800 for a show that I can see is only around 1200.

It looks like it is just rounding to 30 minutes.

Anyone else come across this?

Any ideas how I can get an accurate TV show duration?

Edit:
The duration is being reported as 1800 when the show is played, but if it is stopped and started again, the duration is being reported accurately. Bug?

Edit:
And now runtime for a specific episode is returning 0? WTF?
Reply
#2
Video Player.duration will return Kodi's database runtime, not actual runtime...

Only way to get accurate runtime is to parse the media files individually. Here is a link to my code:
https://github.com/Lunatixz/XBMC_Addons/...oParser.py
https://github.com/Lunatixz/XBMC_Addons/...ib/parsers
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#3
The parser option is probably more stable and a more viable ongoing solution, thanks for that.

The weird thing is that the actual runtime IS showing sometimes. Perhaps I was using "total" from the "resume" data set, but even then some times that comes through as zero.
Reply
#4
(2015-08-11, 23:42)Karnagious Wrote: The parser option is probably more stable and a more viable ongoing solution, thanks for that.

The weird thing is that the actual runtime IS showing sometimes. Perhaps I was using "total" from the "resume" data set, but even then some times that comes through as zero.

I've never been able to retrieve accurate runtimes from Kodi db... unless the database was scraped using NFO data and NFO data has accurate runtime info (which isn't likely)... rounded runtimes seems to be the main stream value.

::EDIT::
Actually come to think of it... $INFO[Player.Duration] will return accurate runtime... It uses the players runtime... not the databases...
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#5
Shouldnt that be the same as VideoPlayer.Duration?

If not, then that might explain the problem, as I am using Videoplayer duration, but previously might have used player duration.
Reply
#6
I think videoplayer is a new infolabel type... extended version of player.

http://kodi.wiki/view/InfoLabels
Code:
Player.Duration    Total duration of the current playing media

VideoPlayer.Duration    Length of current movie
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#7
Yeah, looks like the same thing to me. No obvious reason why it would be different.

I will switch to Player.Duration and see if it makes any difference.

If it works, I will use that. Hopefully it is not scheduled for deprecation.
Reply
#8
Yep, Player.Duration works as advertised.

I will keep an eye on it though.

Thanks for the help Lunatixz.
Reply

Logout Mark Read Team Forum Stats Members Help
VideoPlayer.Duration returning incorrect number0