View Full Version : Clock-triggered playlist: can this be done?
Doc Sane
20th August 2008, 06:49
Hi all,
I really want to automate a video room at a convention I'm involved with, and this will require building a playlist which is triggered by the system clock. Now, I have no programming skill and my scripting abilities are pretty much limited to very simple AVISynth stuff, so my question to you all is does anyone out there know how I can accomplish this?
I know I could theoretically set up a playlist with filler video in between the main features and just let the whole thing rip, but that's asking for trouble. I really want to see if I can make this work with a proper scheduling system.
Anyone out there have any ideas?
dat720
20th August 2008, 11:36
2 ways i would look at is:
VB Script
Windows Task Scheduler
jeffy
20th August 2008, 15:51
So if I understood correctly, you would like to play some video at 6pm and some other video at 7pm and another third video at 8pm, all of them starting automatically? Fullscreen? What player, what video file formats, if I may ask? With or without repeat?
Video Dude
20th August 2008, 16:48
There are many macro programs that pre-record key presses / mouse click postions and execute them at the desired times.
I use a program called Macro Scheduler. The trial version has a nag screen, but it never expires. I use the older version but I assume the current version would be the same.
Doc Sane
20th August 2008, 21:46
So if I understood correctly, you would like to play some video at 6pm and some other video at 7pm and another third video at 8pm, all of them starting automatically? Fullscreen? What player, what video file formats, if I may ask? With or without repeat?
I would be using Zoom Player via the command line and the video should automatically output to the TV out on the video card. The formats would be a mixture of MPEGs and AVIs, some with subtitles and others without. No, there shouldn't be any repeats, although I suppose they could be repeated by making a separate call in the scheduling script. At the end of a video, I'd like to either simply display a still graphic showing what was coming next or (even better) trigger a randomly shuffled video playback of shorts from a separate folder until it was time for the next main feature.
I'm already investigating Visual Basic as a possibility for this, but I am literally starting at ground zero here, with almost no programming or scripting experience. Personally, I wish the guys who do Zoom Player could just integrate this function into the playlist editor. I think it would be an excellent enhancement of an already excellent product. There's really no reason why a video room needs a person constantly shoving discs into a DVD player or clicking on the files to play. Putting an entire weekend's worth of video on a hard drive and then letting the computer playback according to the system clock would make running the video rooms so much easier.
jeffy
20th August 2008, 22:32
Might be helpful:
http://www.inmatrix.com/zplayer/parameters.shtml
http://www.ss64.com/nt/at.html
dat720
21st August 2008, 10:30
Definetly sounds like a task for VB!
Heres a messy little script but it should give you an idea of how to do schedueling in VB:
Dim objShell
Set objShell = CreateObject("WScript.Shell")
Sub Pause(intSeconds)
Dim strCommand
strCommand = "%COMSPEC% /c ping -n " & intSeconds & " 127.0.0.1>nul"
objShell.Run strCommand,0,1
End Sub
'1st task
settime = "20:20"
do until (Hour(Time)) & ":" & (Minute(Time)) = settime
pause(30)
if (Hour(Time)) & ":" & (Minute(Time)) = settime then objShell.Run "notepad"
loop
'2nd task
settime = "20:20"
do until (Hour(Time)) & ":" & (Minute(Time)) = settime
pause(30)
if (Hour(Time)) & ":" & (Minute(Time)) = settime then objShell.Run "notepad"
loop
The thing to remember is the tasks must be set in order, ie earliest time at the top, latest time at the end.
Actually looking at that code, it may be pretty crap, if the script is started after the first time it will wait until that time comes around again before moving to the next loop......
Let me think about it for abit and i'll post something better, but that should be enough to give you some ideas.
Doc Sane
21st August 2008, 19:37
Dim objShell
Set objShell = CreateObject("WScript.Shell")
Sub Pause(intSeconds)
Dim strCommand
strCommand = "%COMSPEC% /c ping -n " & intSeconds & " 127.0.0.1>nul"
objShell.Run strCommand,0,1
End Sub
'1st task
settime = "20:20"
do until (Hour(Time)) & ":" & (Minute(Time)) = settime
pause(30)
if (Hour(Time)) & ":" & (Minute(Time)) = settime then objShell.Run "notepad"
loop
'2nd task
settime = "20:20"
do until (Hour(Time)) & ":" & (Minute(Time)) = settime
pause(30)
if (Hour(Time)) & ":" & (Minute(Time)) = settime then objShell.Run "notepad"
loop
Okay, as I (a total newb) read this, that first subroutine you set up is creating a timer to let the script pause until the system time reaches 20:20. First question: is there not simply a "wait until" command which would let the script wait until the system clock equals the first event time that you set? I'm also not quite clear why you seem to be pinging a network target in order to establish the timer.
dat720
23rd August 2008, 04:35
As far as i know there is no wait until in vb... which is why i do the if time = check......
And as for the pause, that could be replaced with wscript.wait 500, this would wait 500ms, i tend to use the pause sub with the ping command as i do allot of HTA work and it is the only way to get a hta to pause without caining the CPU to death.......
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.