Set subtitle filepath via JSON-RPC
#1
Hello,

I really like XBMC and have great respect for its developers. I've been working with audio/visual transcoding for like 10 years, and as a software developer I know that you guys have a lot of work on your hands!

My current project would greatly benefit from being able to specify a filepath to a subtitle via the JSON-RPC protocol (I am using TCP). I'm doing some processing on the file after downloading it and would like to push those changes back to XBMC while the show is running, if possible (I make the changes in an external file once after the subtitle is downloaded and would like to switch to the processed copy one time).

That is:
  1. Add movie/download subtitles
  2. The TCP listener I wrote will see the subtitle file, make a copy
  3. The TCP listener will make changes to the copy
  4. The TCP listener will tell XBMC to switch to using the copy it made

Is there a better way of handling this, or would this feature be possible? I would be willing to implement it myself, if that is allowed.
Reply
#2
You want to edit an external subtitle file as the video is playing?
Reply
#3
I am so sorry for taking so long to reply. This has been a huge project.

My goal is to actually just display subtitle text on the screen. However, the text needs to be set dynamically via JSON-RPC. My dream situation would be to say, for instance, "Hey, playerid:1, show message:"SOME TEXT" from timespan:'00:00:10,234' to timespan:'00:00:14,432'!". However, I know that XBMC does not support that without writing a python plugin, and even then I am not sure I could get it to hook into JSON-RPC.

So, I settled on using srt files. Currently, I'm monitoring movies as they are added and pre-processing the files. The functionality is much more limited than I had planned (but MUCH better than if I had to write the whole media player myself... you guys are amazing!)

However, if I can implement such functionality for you, I'd be happy to. There are a lot of requests on the forums for similar behaviour.

If I have missed something and this is possible, please tell me! I'd be happier than a fish... uh... swimming... uh... in water.
Reply
#4
idk how you would do that, but in recent XBMC/Kodi iirc all gui settings are exposed to json-rpc so you can pretty much tell xbmc to do anything via that. Someone off the top of my head that probably knows this is Milhouse I think. He wrote the pythonscript texturecache.py and recent features already include changing some xbmc settings via jsonrpc. If I wanted to look at what is being done, I would use that script in debug and look at the jsonrpc calls going on.
Reply
#5
what I would do is create some python "helper" addon that has a window class with blank background and some labels, you could call that helper addon with parameters from JSON and addon could display them for you. sounds easy to me...
Reply
#6
@uNiversal: Thanks! I'll take a look. I've been trying to find some examples of python scripts that are similar to what I want or at least steer me in the right path--maybe these will do the trick.

@amet: That was my first idea for a solution, but I could not find a good python example (never done any python before--C++/JavaScript guy). However, with uNiversal's suggestion and your blessing that it might be easy, I think I'll give it a go. Thanks!
Reply

Logout Mark Read Team Forum Stats Members Help
Set subtitle filepath via JSON-RPC0