Support for XBMC2 plugin (formerly XBMCRepeat)

Questions and comments specific to a particular plugin should go here.
jonib
Plugin Developer
Posts: 1298
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Mon Mar 18, 2019 11:56 pm

Z'Hadum wrote:
Mon Mar 18, 2019 7:32 am
Has any one a hint for me how I can get that?
XBMC2->JSONRPC->Player->GetProperties and parameters:

Code: Select all

[1, ["currentaudiostream"]]
Seems to work for the current audio codec.

Then you can use this:

Code: Select all

eg.result["currentaudiostream"]["codec"]
or

Code: Select all

eg.result["currentaudiostream"]["name"]
to get the codec name that you can use in a Python script.
Another question:
to interpret the json-rpc reply, I have to write a small python snipplet in eventghost?
I find a Python script is best but not always necessary.

You can put this in a Python command after the JSORPC action and it will create different events depending on the codec:

Code: Select all

eg.TriggerEvent("audio-%s" % eg.result["currentaudiostream"]["codec"])
That can trigger macros to do what you want depending on the codec.

Hope this helps.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

Z'Hadum
Posts: 3
Joined: Mon Mar 18, 2019 7:08 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Z'Hadum » Tue Mar 19, 2019 9:33 am

Hello jonib,
many Thx.

I played yesterday evening also a little bit. And found the getinfolabels Method:

Code: Select all

{"jsonrpc":"2.0","method":"XBMC.GetInfoLabels","id":1,"params":{"labels":["VideoPlayer.AudioCodec"]}}
With this I get the audiocodec as Kodi it sees, but this is not what I need :(
Because: Kodi can not detect an Atmos soundtrack, it is always TrueHD :evil:

I will test your suggestions today evening. Thank you!

But one Question in advance:
Get I the codec info as it is stored in the database or as the Playerengine of Kodi detects it?
And if second: How can I get only the codecinfo from the currentstream as it is stored in the database(!)?? Is there any way you know?

(Another solution, with more python scripting, will be to get the audiolanguage (or index, if there is any) from the playerengine.
With the language-info it should be possible to select the correct audiostream from the streamdetails, that are based on the database information.... :shock:

Background:
In the database I've the correct information about the codecs, because I created that Info with tinymediamanager.
Tinymediamanager gets the information with the help of mediainfo. Mediainfo is capable of detecting 3D-audio codecs....ffmpeg in Kodi is not.

Z'Hadum
Posts: 3
Joined: Mon Mar 18, 2019 7:08 am

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by Z'Hadum » Wed Mar 20, 2019 11:56 am

Ok,
I tested it yesterday evening:

Code: Select all

[1, ["currentaudiostream"]]
works, but gives me also only the codec as kodi it detects.
And kodi can't detect atmos and dts-x. :(

I only see two solutions for me, with

Code: Select all

eg.result["currentaudiostream"]["name"]
I get the stream name, sopmetimes it has a hint to the atmos codec in it.
In this case I should rename Atmos audio streams....not the best solution

The other possible way I see is to try to connect the output from currentaudiostream with the streamdetails output,
which shows me the DB information. (where the atmos codec information is stored in my case ...)
This will need some python code I guess..

Best would be to have a property like currentaudiostream, which gives the DB details of the currentaudiostream....it seems that such a property does not exist....

If I get a working solution, I will post it here...

jonib
Plugin Developer
Posts: 1298
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Fri Mar 22, 2019 2:27 pm

Unfortunately I haven't done much with the audio stuff in Kodi as I have a very basic 5.1 speaker setup.
Z'Hadum wrote:
Wed Mar 20, 2019 11:56 am
The other possible way I see is to try to connect the output from currentaudiostream with the streamdetails output,
which shows me the DB information. (where the atmos codec information is stored in my case ...)
This will need some python code I guess..
Try this code (in a Python script action) it checks the currently active audio and then gets the "streamdetails" with Player.GetItem.

Code: Select all

player = eg.plugins.XBMC2.JSONRPC(u'Player.GetActivePlayers', u'', False, True)[0]["playerid"]
result = eg.plugins.XBMC2.JSONRPC(u'Player.GetProperties', u'[{}, ["currentaudiostream", "audiostreams"]]'.format(player), False, True)
current = result["currentaudiostream"]["index"]
details = eg.plugins.XBMC2.JSONRPC(u'Player.GetItem', u'[{}, ["streamdetails"]]'.format(player), False, True)["item"]["streamdetails"]["audio"][current]
print(details["codec"])
eg.result = details["codec"]
Best would be to have a property like currentaudiostream, which gives the DB details of the currentaudiostream....it seems that such a property does not exist....
If the above code don't help, you need to ask in the Kodi JSON-RPC forum as they should know better and can add any missing features.

Background:
In the database I've the correct information about the codecs, because I created that Info with tinymediamanager.
Tinymediamanager gets the information with the help of mediainfo. Mediainfo is capable of detecting 3D-audio codecs....ffmpeg in Kodi is not.
Where is this information stored?


jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

_Michael_
Posts: 3
Joined: Sat Jun 08, 2019 1:29 pm

XBMC2 plugin is not working

Post by _Michael_ » Sat Jun 08, 2019 1:47 pm

Hello,

I'm trying to control Kodi 18.2 (from 2019-04-22). I installed the XMBC2 plugin and made the required configuration. Pushed the "Test" button and it told me that all is OK. At Kodi there was also some popup which told something like "connection … test works".
So far all seams to be OK but if I trigger e.g. XMBC2: Info or any other predefined XMBC2 macro it will not do anything at Kodi, EventGhost tells in the Log window the command was transmitted. Any idea what goes wrong? Thank you!
My Kodi settings:
Kodi_Steuerung.png
Kodi_UPnP.png
P.S. I'm a beginner in view of EventGhost and Kodi, I'm sorry if I have missed some basics.

jonib
Plugin Developer
Posts: 1298
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: XBMC2 plugin is not working

Post by jonib » Sun Jun 09, 2019 12:04 pm

_Michael_ wrote:
Sat Jun 08, 2019 1:47 pm
I'm trying to control Kodi 18.2 (from 2019-04-22). I installed the XMBC2 plugin and made the required configuration. Pushed the "Test" button and it told me that all is OK. At Kodi there was also some popup which told something like "connection … test works".
That means your IP and JSON-RPC settings are correct, great.
So far all seams to be OK but if I trigger e.g. XMBC2: Info or any other predefined XMBC2 macro it will not do anything at Kodi, EventGhost tells in the Log window the command was transmitted. Any idea what goes wrong?
Hmm, does the port number after the IP address in the XBMC2 settings match the port number in Kodis HTTP setting (8080)? post a screenshot of the XBMC2 settings window if needed.

If you are using EventGhost 0.4.x you probably should update the XBMC2 plugin as the included is very old. Latest version here download via the "Raw" button and put it in (Eventghost install dir)}Plugins\XBMCRepeat directory


jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

_Michael_
Posts: 3
Joined: Sat Jun 08, 2019 1:29 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by _Michael_ » Mon Jun 10, 2019 8:44 am

Thanks a lot jonib. My plugin is up to data, my port number after the IP is also OK. But not OK: I entered at the beginning (before I recognized the functionality of the "Search" button") under "EventServer" the port number from Kodi. So 9777 became 8080 and this was the problem.
From my point of view:
  • All settings of the XMBC2 "Settings" tab sheet which are not in the field "IP address and port of XMBC (...)" should be hidden for a default user e.g. as it is made in Kodi: Introduce a button which changes the "Settings" tab sheet between "Standard" and "Expert".
    Also: Rename XMBC to Kodi.

jonib
Plugin Developer
Posts: 1298
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by jonib » Mon Jun 10, 2019 5:19 pm

_Michael_ wrote:
Mon Jun 10, 2019 8:44 am
Thanks a lot jonib. My plugin is up to data, my port number after the IP is also OK. But not OK: I entered at the beginning (before I recognized the functionality of the "Search" button") under "EventServer" the port number from Kodi. So 9777 became 8080 and this was the problem.
So it's working now?
From my point of view:
  • All settings of the XMBC2 "Settings" tab sheet which are not in the field "IP address and port of XMBC (...)" should be hidden for a default user e.g. as it is made in Kodi: Introduce a button which changes the "Settings" tab sheet between "Standard" and "Expert".
I am working on an update that will improve many things in the plugin including the settings, I want to automate or guide the user to setup it correctly. Unfortunately I have not been able to work on it for a long time (2 years) because of health related issues, you can see the current plans here on my Github , I added an issue with your idea to hide advanced options.
Also: Rename XMBC to Kodi.
The next version will be renamed, but I have no idea when I might be able to finish it as it will be a total reconstruction and possibly not compatible with the current XBMC2 plugin.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

_Michael_
Posts: 3
Joined: Sat Jun 08, 2019 1:29 pm

Re: Support for XBMC2 plugin (formerly XBMCRepeat)

Post by _Michael_ » Mon Jun 10, 2019 6:04 pm

Yes it is working 8) .
Nice that you may consider my suggestions; I whish you good improvement / health ...
Your work helped my a lot for setting up my HTPC in a way as I want. Great work!

Post Reply