Automatic stream (cast) to Smart TV

Discuss third party additions, plugins and translations for Universal Media Server
Post Reply
aleks2x
Posts: 2
Joined: Wed Feb 10, 2016 4:01 am

Automatic stream (cast) to Smart TV

Post by aleks2x » Wed Feb 10, 2016 4:11 am

Hello everybody,

I've been trying to find a program (media server) that can do the scenario explained in the following topic and so far UMS is the only media server that is promising enough to do this.

I have 2 smart LG TVs connected in LAN. Both of them automatically turn on specifically at 7am every day and turn off at 4pm.
My first question Is: Is it possible that i can create some kind of script that can push video content to one of the tvs (corporate video) that need to loop until the tv is automatically turned off at 4pm?
My second question is: Is it possible to create a script to stream TWO JPEG photos to the second tv (slide show) until the tv is turned off automatically at 4 pm?

The idea of the photos is to be automatically added to a playlist when someone adds them in a shared folder.

The whole concept is intended to have minimum human input (besides adding the photos in the shared network folder)

Thanks in advance!

P.S. Sorry for using the word "automatically" to often :)

User avatar
valib
Developer
Posts: 651
Joined: Fri Feb 08, 2013 3:11 am

Re: Automatic stream (cast) to Smart TV

Post by valib » Wed Feb 10, 2016 10:30 am

All communication between a renderer and a media server is the DLNA protocol based so the renderer is always asking for the media which should be played. It is not a responsibility of a media server to push something to them. If you would be able to make a script in your smart TV then it could work. Or you can make a new UMS plugin which can use the UPnP support implemented and push the media to your TV. We don't use scripts for such cases.

infidel
Developer
Posts: 571
Joined: Thu Jul 12, 2012 5:37 am

Re: Automatic stream (cast) to Smart TV

Post by infidel » Thu Feb 11, 2016 8:10 am

aleks2x wrote:Is it possible that i can create some kind of script that can push video content to one of the tvs
You can try this using the jumpy plugin's (undocumented) pms.play(uri, renderer_ip) scripting command, e.g. working example in python to start a video at a given time and stop it a minute later (timedplay.py):

Code: Select all

import sys, time, jumpy

def push_at(hour, min, uri, renderer):
	while True:
		now = time.localtime()
		if now.tm_hour == hour and now.tm_min == min:
			# push the uri to the renderer
			pms.play(uri, renderer)
			return
		time.sleep(1)

# parse start time
t = sys.argv[1]
hour, min = [int(x) for x in t.split(':')]

# schedule start at hour:min
push_at(hour, min, 'c:\\video.mp4', '192.168.1.5')

# playing...

# schedule stop after one minute by pushing
# a dummy uri to interrupt previous stream
push_at(hour, min + 1, 'dummy', '192.168.1.5')
Assuming this script is located in plugins/jumpy/timer/timedplay.py, you would need to add it as an asynchronous (note the '&' at the end of the command) startup script to your jumpy-scripts.ini like so:

Code: Select all

[+timedplay]
cmd = ${home}/timer/timedplay.py 07:00 &
and it should get launched 'automatically' :) at UMS startup and wait for the appointed time before kicking in and doing its thing. The uri could be a jpeg too.

Note that you would need to script all the directory-scanning, timing and looping logic yourself in python, and push uris accordingly.

aleks2x
Posts: 2
Joined: Wed Feb 10, 2016 4:01 am

Re: Automatic stream (cast) to Smart TV

Post by aleks2x » Fri Feb 19, 2016 2:36 am

Thank you very much!
I'll definitely try this and let everybody know how it goes.

Kind regards!

widi
Posts: 3
Joined: Fri Jan 11, 2019 12:49 am

Re: Automatic stream (cast) to Smart TV

Post by widi » Fri Jan 11, 2019 1:05 am

Hello

When I was seeing this post, I was really happy, thinking, I have a solution for my challenge - but unfortunately not :-( We want to use displays around our company to show certain information, which are been propagated via a picture. At the moment, we have this picture as desktop-background on some client-computers - as an addition, we want to have some bigger screens standing around to propagate those information more.

For this reason I installed UMS on the server, where the picture is and want to push it to the screens. I can do so manually: I switch on the TV and then work according the following manual: https://github.com/UniversalMediaServer ... a-Renderer.

According this forum topic, I wanted to create and run a script to send this command to the TVs, but as Jumpy seems not to work and also is not supported anymore, it is not really an option to run an outdated UMS with a not-anymore-supported plugin to solve this. So I wanted to find an alternative - but unfortunately, I am not a developer - therefore programming something on my own is not really an option...

So what command could I use to push the content automatically? I imagine, that I would run a task every few minutes to push it to the IPs, which I define (TVs would have predefined IPs). I COULD do that manually - but how can I do it automatically (Manually it IS possible - so can I hook somehow on that process and let it been done automatically)? U use UMS version 7.7.1.

Thank you very much and kind regards
David

widi
Posts: 3
Joined: Fri Jan 11, 2019 12:49 am

Re: Automatic stream (cast) to Smart TV

Post by widi » Tue Jan 15, 2019 3:24 am

Hello

Could it be possible to solve this by an entry in the Custom Device profile .conf-file? What parameter could I add there?

Thank you for any input - especially as it is my only idea for the moment to solve this...

Kind regards
David

User avatar
valib
Developer
Posts: 651
Joined: Fri Feb 08, 2013 3:11 am

Re: Automatic stream (cast) to Smart TV

Post by valib » Fri Feb 15, 2019 12:34 am

I have one proposal. Try to make some folder with the pistures you want to show and add that folder to the UMS shared folders. Than if your TVs are really smart there should be a choice to play the slide show. TV will be asking for all pictures from the folder and the UMS will serve it.

widi
Posts: 3
Joined: Fri Jan 11, 2019 12:49 am

Re: Automatic stream (cast) to Smart TV

Post by widi » Tue Apr 09, 2019 8:06 pm

Hi valib

Thank you very much for your answer! I finally got some time to look again into this...

Hmm, according your suggestion, after switching it on, the TV should automatically choose to pull some content via DLNA. Unfortunately, I cannot set it to do this. If I start up the TV, there is nothing shown (it would show a TV media from a cable or satellite program, if configured).
I have already defined a share folder and I have my picture there and I can load the content from there on my TV but the TV does not open that DLNA source by itself right after switching it on - but this is, what i would need.

If I do NOT want to have to do anything at the TVs, I have to go to the UMS Main menu, then click on the TV in the devices screen. After that, I can choose a file on the bottom of the device-window and click the run button: It immediately start showing the picture. So here is my question:
How could i automate this? I could imagine, that i would need to start a command (for a batch file for example) where i can tell UMS:
Use file C:\example\example.jpg and run it on Device with IP xxx.xxx.xxx.xxx

I then can run this command on the media Server on a regular base, and therefore would push the picture to the desired devices, if they are switched on. I could create a line like this for every device I wish to control and then it works. How could I create such a command?
-> I don't know if there even exist TVs, that could actively pull content from an internal DLNA LAN-server automatically right at startup - or not even how to search for right devices :-(

Thank you very much for again look into this!

Kind regards
David

Post Reply