0

I start a video with JSON-RPC call:

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

Video is started. To get the video's details I use 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"
}

It returns:

{
    "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's GUI I get:

{
    "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"
        }
    }
}

Should I use a different method to get the currently playing video's details?

user4157124
  • 2,809
  • 13
  • 27
  • 42
  • 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. – Szabó Győző Feb 07 '23 at 20:59
  • I got a hint to alternatively use: XBMC.GetInfoLabels method. Example: {"jsonrpc": "2.0", "method": "XBMC.GetInfoLabels", "params": {"labels": ["VideoPlayer.Duration"]}, "id": 1 } – Szabó Győző Feb 07 '23 at 20:59
  • The same and similar question is asked here: https://forum.kodi.tv/showthread.php?tid=371822 and here https://forum.kodi.tv/showthread.php?tid=371880 – Szabó Győző Feb 15 '23 at 21:13

0 Answers0