Question

I would like to make a simple script to push a movie to a Smart TV. I have already install miniupnp or ushare, but I don't want to go in a folder by the TV Smart Apps, i want to push the movie to the TV, to win time and in future why not make the same directly from a NAS.

Can anyone have an idea how to do this ? This application SofaPlay make it great but only from my mac.

Thanks you

Was it helpful?

Solution

You will still need a DLNA server to host your videos on. Via UPnP you only hand the URL to the TV, not the video directly. Once you have it hosted on a DLNA server, you can find out the URL to a video by playing it in Windows Media Player (which has DLNA-support) or by using UPnP Inspector (which I recommend anyways, if you are going to be working with UPnP). You can then push this URL to the TV, which will download and play the video, if its format is supported.

I do not know my way around python, but you since UPnP is HTTP based, you will need to send an HTTP request with appropriate UPnP-headers (see wikipedia or test it yourself with UPnP Inspector) and the proper XML-formatted body for the function you are trying to use.

The UPnP-function I worked with to push a link to the TV is "SetAVTransportURI", but it might differ from your TV. Use UPnP Inspector to find the correct one, including its parameters.

In summary: Get a DLNA-Server to host you videos on. Find out the links to those videos using UPnP Inspector or other DLNA-clients. Find out the UPnP-function that sends a URL to your TV (again, I recomment UPnP Inspector, you can explore and call all functions with it). Implement a call to that function in your script.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top