Kodi Community Forum

Full Version: Issue with millisecond progress granularity with live streams?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have found something odd while developing a python script on Eden xbmcbuntu which I'm running on a Zotac ID-11. Namely there seems to be an issue with millisecond granularity when playing live streams.

I'm playing back a stream from tvheadend:

Relevant debug:

Code:
14:18:32 T:4726880  NOTICE: DVDPlayer: Opening: htsp://192.168.1.80:9982/tags/16/1014.ts

I've created a simple script to periodically report the programme progress time, and noticed the first three decimal places are always '001':

Relevant code:

Code:
# Get the player progress time in fractional seconds
progress_time = round(xbmc_player.getTime(),10)
print 'Progress Time : ' + str(progress_time)

Output:

Code:
15:02:18 T:2835348336  NOTICE: Progress Time : 1938.00109205
15:02:44 T:2835348336  NOTICE: Progress Time : 1964.00109329
15:03:10 T:2835348336  NOTICE: Progress Time : 1990.00109452
15:03:36 T:2835348336  NOTICE: Progress Time : 2016.00109575
15:04:02 T:2835348336  NOTICE: Progress Time : 2042.00109699
15:04:28 T:2835348336  NOTICE: Progress Time : 2068.00109822
15:04:53 T:2835348336  NOTICE: Progress Time : 2093.00109941
15:05:18 T:2835348336  NOTICE: Progress Time : 2118.0011006
15:05:44 T:2835348336  NOTICE: Progress Time : 2144.00110183


Thinking this was caused by using whole seconds in python time.sleep(), I then crafted a JSON-RPC query which I executed over the raw TCP socket by hand at random times and found that milliseconds is always reported as '1':

Command:

Code:
{"jsonrpc": "2.0", "method": "Player.GetProperties", "params": {"playerid": 1, "properties": ["time"]}, "id": 1}

Output:

Code:
{"id":1,"jsonrpc":"2.0","result":{"time":{"hours":0,"milliseconds":1,"minutes":25,"seconds":14}}}
{"id":1,"jsonrpc":"2.0","result":{"time":{"hours":0,"milliseconds":1,"minutes":25,"seconds":30}}}
{"id":1,"jsonrpc":"2.0","result":{"time":{"hours":0,"milliseconds":1,"minutes":25,"seconds":33}}}
{"id":1,"jsonrpc":"2.0","result":{"time":{"hours":0,"milliseconds":1,"minutes":25,"seconds":34}}}
{"id":1,"jsonrpc":"2.0","result":{"time":{"hours":0,"milliseconds":1,"minutes":25,"seconds":35}}}
{"id":1,"jsonrpc":"2.0","result":{"time":{"hours":0,"milliseconds":1,"minutes":25,"seconds":37}}}
{"id":1,"jsonrpc":"2.0","result":{"time":{"hours":0,"milliseconds":1,"minutes":25,"seconds":38}}}


However when I play back a music video file from Serviio, milliseconds seem to be reported correctly:

Relevant Debug:

Code:
14:53:34 T:4726880  NOTICE: DVDPlayer: Opening: http://192.168.1.80:8895/resource/493/MEDIA_ITEM/MATROSKA*0

Command:

Code:
{"jsonrpc": "2.0", "method": "Player.GetProperties", "params": {"playerid": 1, "properties": ["time"]}, "id": 1}

Output:

Code:
{"id":1,"jsonrpc":"2.0","result":{"time":{"hours":0,"milliseconds":455,"minutes":0,"seconds":14}}}
{"id":1,"jsonrpc":"2.0","result":{"time":{"hours":0,"milliseconds":321,"minutes":0,"seconds":19}}}
{"id":1,"jsonrpc":"2.0","result":{"time":{"hours":0,"milliseconds":369,"minutes":0,"seconds":22}}}
{"id":1,"jsonrpc":"2.0","result":{"time":{"hours":0,"milliseconds":552,"minutes":1,"seconds":5}}}

Is this the result of my own faulty methodology, an issue with tvheadend, the nature of the way streams are handled, an issue in xbmc, or...?