UPnP AV Remote Control in Java or C #

I need to create some kind of remote control that can interact with the UPnP media server.

I read that there are three applications for the UPnP AV stack: media server, media rendering, checkpoint. Firstly, I thought that the control point is what I want to program, however, after scrolling through documents from several libraries, it seems to me that the control point still wants to play the multimedia files that the server provides on the device itself, the control point runs using external software (as opposed to media rendering, which plays the files themselves).

Did I get it right or am I completely wrong?

Also, I could not find any library that seemed easy enough to use. This is probably due to my poor skills, but I also have the feeling that the documentation for many libraries is pretty poor and incomplete.

I don’t remember all the libraries I came across, but they included frequently mentioned names such as Cling, Fraunhofer FOKUS and CyberLink. I read most of the material on my sites, including some documents, and couldn't really find out how I can use them the way I want.

I just need something that allows me to connect to the server, index the lists of media files so that I can go to any track, and only give me the ability to play, pause, pause, next, prev and control the volume . However, the files must be played on the server .

Do you know any such wonderful thing for Java or C #? Thanks a lot in advance.:)

+4
source share
1 answer

At first I thought that the control point is what I want to program, however, after slipping through several documents through documents, it seems to me that the control point still wants to play media files on the server provides on the device, the control point It works using external ones (unlike the multimedia visualization tool, which plays the files themselves).

To be compatible with UPnP AV, software applications or hardware devices must include at least one UPnP AV device (MediaServer, ControlPoint, or MediaRenderer) and its required services. There are applications that provide multiple devices, so logical separation cannot be found in practice. Often video players only implement ControlPoint services to view the server and download its contents (content can even be hosted on another server).

I just need something that allows me to connect to the server, index the media lists, so that I can go to anything track, and just give me the ability to play, stop, pause, next, prev and control the volume. files must be played back server.

UPnP defines several Services that must be implemented by the device (for example, MediaServer must provide a DirectoryService). Each service has mandatory and optional actions (for example, DirectoryService can be viewed through the Browse method). To achieve what you want, your server must implement UPnP MediaServer (necessary to view its contents) and UPnP MediaRenderer (necessary to control playback). UPnP ControlPoint acts as a kind of remote control. It is used to view the server and select a server to play files.

The view request is as follows (ObjectID 0 always indicates the root of the tree):

 <Browse xmlns:u =" urn:schemas-upnp-org:service:ContentDirectory:1 "> <ObjectID>0</ObjectID> <Filter></Filter> <RequestedCount>0</RequestedCount> <StartingIndex >0</StartingIndex> <SortCriteria ></ SortCriteria> <BrowseFlag> BrowseDirectChildren </BrowseFlag > </u:Browse> 

The server responds with a response that might look like this:

 <DIDL-Lite> <item id="1" parentID ="0" restricted ="1"> <upnp:class>object.item.videoItem </upnp:class> <dc:title>Video file</dc:title> <upnp:artist>John Doe</upnp:artist> <upnp:genre>Action</ upnp:genre> <upnp:director>John Doe Jr.</upnp:director> <res protocolInfo="http-get:*:video/mpeg:*" resolution ="352x288"> http://10.20.30.40:12345/ExportContent?id=1 </res> </item> </DIDL-Lite > 

In this case, the server has only one video element (usually the server will have several folders containing many elements). The res element contains information about the resource itself (where it is located, which transport protocol should be used, type mime, ...). In your case, the server may even respond with "localhost" as the address, preventing the file from loading. The MediaRenderer part of your server should have access to it anyway.

I don’t remember all the libraries I came across, but they included frequently mentioned names such as Cling, Fraunhofer FOKUS and CyberLink.

Personally, I would recommend CyberLink for Java . I used it to implement MediaServer, however it offers enough to implement ControlPoint or MediaRenderer. In addition, you should get a UPnP developer tool, such as Developer Tools for UPnP (originally Intel UPnP Tools ) or GUPnP Tools for Linux . GUPnP also provides the UPnP library for C. These developer tools let you invoke and debug UPnP commands and come in handy during development. Another useful resource is UPnP device descriptions from the UPnP consortium.

+1
source

All Articles