Jump to content
thisguyiknow

Obtaining data from emby server---Remotes--Data Acquisition

Recommended Posts

thisguyiknow

I am curious whether there is a way to query the emby server for title and timecode information of what is currently being played - Ideally a serial stream through an IP/TCP port that on my end I can parse for use on an ipad remote control system for a theater 

 

In the past I was using MPC-HC as the backend player for emby within media center - when the web interface was enabled I could essentially 'query' MPC HC  by IP address port # and then [in this case] /info.html and parse the data on my remote. All the remote 'sees' is the raw html or source of that specific page and I set rules on the remote to disregard the gibberish so to speak--

 

For example the timecode feedback was displayed on the remote by setting a rule on the remote to only look for data in between a line that begins with "<p id="positionstring"> and ends in <p>" --the number in between that specific prefix and suffix were displayed on the remote --Because of this, the remote only displayed the static timecode when you queried it --it is crude compared to the Oppo player that sends out a constant serial stream of timecode, track, chapter etc information via its RS232 port --> connected to a serial card in a computer that runs an rs232 to tcp/ip service, forwarding the serial data as TCP packets--> i.e. constant RX bytes.  I connect to that bridge and parse and display the information on the remote. 

 

*note -> there was an aspect of the mpc hc web interface, a remote that displayed the title and current rolling timecode but it appeared to work by using a javascript to constantly refresh the data and I am not smart enough to figure out how to create a bridge from that rolling timecode I see in the browser {post that javascript} to my remote.  

 

We are moving to emby theater from a Windows Media Center plugin solution. Wondering if this kind of data can be easily accessed or whether a server plugin could be developed to help system integrators use a serial stream of 'remote feedback' in their projects. Obviously this data exists as can be seen in the dashboard--how do I extract that information?

 

Getting too tired to really explain myself but I hope the developers understand the gist of what I am asking about 

 

-Thanks for the wonderful program 

Edited by thisguyiknow

Share this post


Link to post
Share on other sites
Luke

Hi, welcome. Yes you can do that by checking out our API:

https://github.com/MediaBrowser/Emby/wiki

 

Specifically the remote control section. Please let us know if this helps. Thanks !

Share this post


Link to post
Share on other sites
ebr

I edited the title of your topic - hope you don't mind :).

Share this post


Link to post
Share on other sites
thisguyiknow

Thank you guys so much - I believe this is what I am after -- forgive my density by asking this question:

 

if I browse to the server like 'http://192.168.15.231:8096/Sessions'I will get a message saying 'access token is required' - could you spell it out for me exactly how to present that access token-

 

Thanks again-

 

Derek 

Share this post


Link to post
Share on other sites
Luke

You're going to have to go through our wiki and learn how to use the API. Step 1 is you need to get your requests authenticated with an access token. For quick testing purposes you can create one in the server dashboard under advanced.

Share this post


Link to post
Share on other sites
speechles

Lets make it simple. Create an api key, then append it to your requests. it's easier to give the answer than make people hunt for it.

 

Ia1BfE2.png

 

 

http://192.168.15.231:8096/Sessions?api_key=<your api key generated goes here>
Edited by speechles
  • Like 1

Share this post


Link to post
Share on other sites
thisguyiknow

Thanks for the help - was able to bring up the sessions screen to begin parsing data -- am I correct in saying that there is no 'running' time code stream from the sessions page in the HH:MM:SS format? 

 

I am getting stuff on the remote so I am moving in the right direction- thanks for the continued help 

 

This is the room this remote and emby are in use in:

 

https://www.soundandvision.com/content/world%E2%80%99s-most-kick-ass-home-theater

Share this post


Link to post
Share on other sites
speechles

You can use PositionTicks to get the exact point played up to in milliseconds.

 

seconds = PositionTicks / 10000000

 

From there you should be able to HH:MM:SS :)

Share this post


Link to post
Share on other sites
thisguyiknow

Okay I probably can figure out some macro command to process that data and forward it to me in the form I want -- here's another stupid question -- using windows 7 - how to get websocket support -- lots of mixed information on the topic. Windows 7 does not have websocket support OOB but there is a workaround correct? so far I am just using http protocol because our server is on windows 7 

 

Again, 

 

Thank you 

Edited by thisguyiknow

Share this post


Link to post
Share on other sites
thisguyiknow

anyone want to do some contract software programming? -- I think a feedback server plugin would be an awesome app for the home automation people who just want to connect to a specific local tcp port and have that data streaming to their touch screen remote - 

Share this post


Link to post
Share on other sites
Luke

Can you explain a little bit more what it would do? Thanks.

Share this post


Link to post
Share on other sites
thisguyiknow

I use an irule based remote panel in our theater - almost all of the hardware used in the theater (i.e. projector, preamp, amps, blu-ray etc) have either an RS232 and or a CAT5 connector to send and receive commands/feedback.

 

I want to give the users of the theater some useful feedback from the emby server. I have already setup rules on the remote to parse the /Sessions html but I find this not the best solution since that information is static/// I choose a new a movie - I have to re-query the /Sessions to scrape the new information.

 

Ah, but websockets....... yes websockets provide a continuous bi-directional data stream but there are a few obstacles standing in my way -

 

1) Using windows 7 as the server means I would have to find an opensource implementation of websockets to use on the server side which I have no idea how to setup. The server was just rebuilt and I don't feel like rebuilding what is a fairly complicated machine just to use Windows 8/10 for OOB websocket support

 

2)Even if I rebuilt the machine and started using websockets I would still have to figure out how to forward websocket messages to a TCP/IP server since iRule does not use websockets in their remote

 

 

  I have attached a screenshot of a typical irule remote TCP gateway setup.

 

5b2c152beee3f_tcpscreen001.png

 

I will attempt to write a more cogent description of even more detailed needs  

 

also I have a basic workflow diagram -

 

5b2c155e4f132_Untitled1.jpg

Edited by thisguyiknow

Share this post


Link to post
Share on other sites
thisguyiknow

***I might just have to bite the bullet and build around windows 8/10 and really start to learn about websockets*** I basically am wanting a virtual COM port --- I want streaming emby data like I get streaming data from an Oppo blu ray player via its RS232 port --*** But part of what this fantasy plugin would do is allow the user choose which data to forward and which data to omit - I would omit everything but 'play pause' status, movie title, time code, artist & song name when playing music etc. just to trim the amount of data the ipad has to further parse on its end 

Edited by thisguyiknow

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...