KODI JSONRPC Player.GetItem method provide almost empty (incomplete) details
#1
I start a new video with a JSON-RPC call:

    {"jsonrpc": "2.0",
        "method": "Player.Open",
        "params":
            {"item":
                {"file": "c:\\MyCodes\\samples\\sample-6s.mp4" }},
        "id": 1
    }

Video started and I want to get the video details and use the following Player.GetItem method:

    {
        "jsonrpc": "2.0",
        "method": "Player.GetItem",
        "params": {
            "properties": [
                "title",
                "album",
                "artist",
                "season",
                "episode",
                "duration",
                "showtitle",
                "tvshowid",
                "thumbnail",
                "file",
                "fanart",
                "streamdetails"
            ],
            "playerid": 1
        },
        "id": "VideoGetItem"
    }

The problem I got back this:

    {
        "id": "VideoGetItem",
        "jsonrpc": "2.0",
        "result": {
            "item": {
                "album": "",
                "artist": [],
                "episode": -1,
                "fanart": "",
                "file": "c:\\MyCodes\\samples\\sample-6s.mp4",
                "label": "sample-6s.mp4",
                "season": -1,
                "showtitle": "",
                "streamdetails": {
                    "audio": [],
                    "subtitle": [],
                    "video": []
                },
                "thumbnail": "",
                "title": "",
                "tvshowid": -1,
                "type": "unknown"
            }
        }
    }

but if I start the same video from KODI GUI I got back this:

    {
        "id": "VideoGetItem",
        "jsonrpc": "2.0",
        "result": {
            "item": {
                "album": "",
                "artist": [],
                "episode": -1,
                "fanart": "",
                "file": "C:\\MyCodes\\samples\\sample-6s.mp4",
                "label": "sample-6s.mp4",
                "season": -1,
                "showtitle": "",
                "streamdetails": {
                    "audio": [
                        {
                            "channels": 2,
                            "codec": "mp3",
                            "language": ""
                        }
                    ],
                    "subtitle": [],
                    "video": [
                        {
                            "aspect": 1.3333330154418946,
                            "codec": "mpeg4",
                            "duration": 2701,
                            "hdrtype": "",
                            "height": 384,
                            "language": "",
                            "stereomode": "",
                            "width": 512
                        }
                    ]
                },
                "thumbnail": "image://video@C%3a%5cMyCodes%5csamples%5csample-6s.mp4/",
                "title": "",
                "tvshowid": -1,
                "type": "unknown"
            }
        }
    }

Any idea, or experience? Maybe I should use a different method to get the currently running video details?
Reply
#2
There are some known problems with this. I faced similar problems in the past (see https://forum.kodi.tv/showthread.php?tid=367542).

Alternatively you might use another command, e.g.

json:
{"jsonrpc": "2.0",
        "method": "XBMC.GetInfoLabels",
        "params": {"labels": ["MusicPlayer.Codec", "MusicPlayer.SampleRate", "MusicPlayer.BitRate", "MusicPlayer.BitsPerSample", "MusicPlayer.Channels", "VideoPlayer.VideoResolution", "VideoPlayer.VideoAspect", "VideoPlayer.AudioCodec", "VideoPlayer.VideoCodec"]},
        "id": 1
    }
Reply
#3
Thank you for the hint. XBMC.GetInfoLabels works. I found two things. First, I made a spelling mistake because Kodi is case-sensitive and c:\ is not equal to C:\. The second is: Player.GetItem data comes from the Kodi sqlite database (MyVideos121.db). If the file is recorded there I will get details if not I will not get anything (tables: files and streamdetails). The KODI inserts the details to these tables automatically when I enter the folder via GUI, but I was not able to find the same json method for this (like emulate or call the original procedure). I tried the VideoLibrary. Scan without any luck. Maybe I should register a library first which I can refresh or scan later on. But I have no idea how to do that.
Reply

Logout Mark Read Team Forum Stats Members Help
KODI JSONRPC Player.GetItem method provide almost empty (incomplete) details0