Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to push DLNA content from the command line

I am going to integrate broadcasted channels with IPTV channels into one menu on my TVs. The problem is that swithing between different sources is a pain. So basically I need to create a menu on the tv to select the channel I want to watch and then switch the TV to that very channel. I know how to create the menu.

The other part of the solution is to push the ITPV channel from the mediaserver to the TV screen. This is a hard part. I ended up installing gupnp and playing with it. It works and I'll be able to write the application.

May be you have an idea of a better solution to pushing the content via DLNA? Is there a command line utility or a mediaserver that can be controlled from the command line? That'll be an ideal option.

The very basic question is how would you programmatically play a resource from a mediaserver on a renderer?

Thanks.

like image 523
slonick Avatar asked Feb 13 '13 11:02

slonick


2 Answers

This shows how you can instruct your renderer to play media from a mediaServer, using curl from the command line. You can easily make a similar http request from within a program.

http://www.accella.net/knowledgebase/sending-a-video-content-to-a-dlnaupnp-softwaredevice-using-curl/

and this too: http://djoepnpoep.blogspot.co.za/2015/07/command-line-dlnaupnp-av-with-curl.html

like image 69
ehrhardt Avatar answered Sep 20 '22 07:09

ehrhardt


The very basic question is how would you programmatically play a resource from a mediaserver on a renderer

The very basic answer is, you can't. UPnP MediaServer in itself is not designed for ability to start playing content to a renderer, exactly the same way as a HTTP server can't start displaying HTML on a particular browser window without the browser making at least one request first. So you have two options:

  1. your implementation of "the menu in TV" (whatever that is) is capable of UPnP discovery and browse the mediaserver for the wanted content (perhaps on hardcoded URL to simplify).
  2. introduce an UPnP Control Point into your network, which knows how to discover and browse the mediaserver and push the content into a selected Renderer. I don't see any reason why that shouldn't be possible to do from commandline, gUPnP seems to provide a source for sufficiently powerful Control Point which you can tweak and tailor to your needs.

Mind that both options effectively result in your TV making a request on MediaServer and actively downloading the stream data. There is no hidden wizardry in the second option, "push" practically means that the Control Point tells the renderer "here is the URL which you start downloading".

like image 42
Pavel Zdenek Avatar answered Sep 19 '22 07:09

Pavel Zdenek