Page 93 of 94
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Mon Mar 18, 2019 11:56 pm
by jonib
Z'Hadum wrote: Mon Mar 18, 2019 7:32 amHas any one a hint for me how I can get that?
XBMC2->JSONRPC->Player->GetProperties and parameters:
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
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Tue Mar 19, 2019 9:33 am
by Z'Hadum
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
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....
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.
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Wed Mar 20, 2019 11:56 am
by Z'Hadum
Ok,
I tested it yesterday evening:
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...
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Fri Mar 22, 2019 2:27 pm
by jonib
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 is not working
Posted: Sat Jun 08, 2019 1:47 pm
by _Michael_
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:
P.S. I'm a beginner in view of EventGhost and Kodi, I'm sorry if I have missed some basics.
Re: XBMC2 plugin is not working
Posted: Sun Jun 09, 2019 12:04 pm
by jonib
_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
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Mon Jun 10, 2019 8:44 am
by _Michael_
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.
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Mon Jun 10, 2019 5:19 pm
by jonib
_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
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Mon Jun 10, 2019 6:04 pm
by _Michael_
Yes it is working

.
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!
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Wed Dec 25, 2019 5:01 am
by jachin99
I use emby for kodi, and I'm wondering how I should use this plugin to send the following command to kodi via EG
ActivateWindow(10025,videodb://movies/titles/,return)
Thanks for the help, and Merry Christmas.
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Wed Dec 25, 2019 12:29 pm
by jonib
jachin99 wrote: Wed Dec 25, 2019 5:01 am
I use emby for kodi, and I'm wondering how I should use this plugin to send the following command to kodi via EG
ActivateWindow(10025,videodb://movies/titles/,return)
I'll look into it, but I have not worked on this for a while so I am a bit rusty. For faster result I think you should ask what JSON-RPC command is needed on the
JSON-RPC Kodi forum.
After we can get it working in the plugin.
Thanks for the help, and Merry Christmas.
Merry Christmas to you too, and everyone else on the forum.
jonib
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Wed Dec 25, 2019 12:51 pm
by jonib
jachin99 wrote: Wed Dec 25, 2019 5:01 amActivateWindow(10025,videodb://movies/titles/,return)
Hmm, seems it was easier then I remembered add action "XBMC2->Experimental->BuiltInFuntions" then choose "ActivateWindow" function and Parameters "10025,videodb://movies/titles/,return".
Seems to work, hopefully is what you need.
jonib
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Sun Dec 29, 2019 8:02 pm
by fuqit3
Hey guys
IÔÇÖm hoping for a solution to a minor issue with kodi and serverwmc issue that doesnÔÇÖt refresh recorded tv until kodi is restarted.
This is the tread
https://forum.kodi.tv/showthread.php?tid=341184
A user there has a script working for home assistant. Is there a way to run this with EG?
Or perhaps an alternative?
HereÔÇÖs the script IÔÇÖm referring to
restart_pvrwmc_media_room:
alias: Restart Kodi pvr.wmc Media Room
sequence:
- service: kodi.call_method
data:
entity_id: media_player.media_room_kodi
method: Addons.SetAddonEnabled
addonid: pvr.wmc
enabled: false
- delay:
seconds: 1
- service: kodi.call_method
data:
entity_id: media_player.media_room_kodi
method: Addons.SetAddonEnabled
addonid: pvr.wmc
enabled: true
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Mon Dec 30, 2019 2:29 am
by jonib
fuqit3 wrote: Sun Dec 29, 2019 8:02 pm
Hey guys
IÔÇÖm hoping for a solution to a minor issue with kodi and serverwmc issue that doesnÔÇÖt refresh recorded tv until kodi is restarted.
Should be possible with the XBMC2 plugin using the Experimental\JSON-RPC action with method "Addons.SetAddonEnabled"
I'll look into the exact details when am able.
jonib
Re: Support for XBMC2 plugin (formerly XBMCRepeat)
Posted: Mon Dec 30, 2019 9:41 pm
by fuqit3
Jonib
Thanks! but I don't need it, things are working correctly now after an update.