Saturday, March 10, 2007

Video Alarm

I sleep in the same room as my PC and keep it on at night so as to download stuff. Consequently, I used my PC for my morning alarm. For that purpose I employed some software which used to play a mp3 file of my choice at the chosen time. The setup at my place is such that I as soon I open my eyes I am able to see my monitor. So I wondered if it is possible to rig my PC in such a way so that it will a video at a specified time. So I did some research and figured it out. I now wake up to the trailer of the movie 300 :)

To set up a video alarm all you need is VLC player and Windows Scheduled tasks.
(You can also use Windows Media Player, but I prefer VLC as it supports more file formats)

STEP I: Setting up VLC Player

VLC player provides us with command line options which allows us to prepare it for Video Alarm. First of all, after installing the VLC player the locate the exe file and note down the path. If the default installation is used then it will be as follows:

C:\Program Files\VideoLAN\VLC\vlc.exe

Now locate the video file that you want to use eg. the path of the file that I use is C:\300.mov. Append this to the path of vlc.exe in the following manner:


"C:\Program Files\VideoLAN\VLC\vlc.exe" C:\300.mov

Now go to Start >> Run and type this there. The selected file should play in VLC player. If not then make sure that the path you have entered is correct. Once you are done with this, then move head.

Now to make the video run in full screen mode you will need to append --fullscreen to the previous path.


"C:\Program Files\VideoLAN\VLC\vlc.exe" C:\300.mov --fullscreen

Try this in Run again and verify that it runs in full screen mode.
Now to set the volume you can use --volume followed by a number between 0 - 1024. You will need to test this and decide the suitable loudness.

"C:\Program Files\VideoLAN\VLC\vlc.exe" C:\300.mov --fullscreen --volume 256

To play the file in a loop, use --loop.

Also, you can add videos in a queue by including multiple filenames separated by a space in the above string.

To find out more about the command line options of VLC player you can visit Videolan.org

STEP II: Setting up Scheduled tasks

Go to Start >> Control Panel >> Scheduled Tasks >> Add Scheduled Task
The Scheduled Task wizard commences. Click on Next

A list of programs will be shown. If VLC player is not one of them then select Browse and locate vlc.exe.


Select the Daily radio button and name the task as Video Alarm



Set the time when you want the alarm to run.


Type the name and password of the user who is associated with this task. Make sure that you choose a user with sufficient permissions to run the program. By default, the wizard selects the name of the user who is currently logged on. Also a scheduled task cannot be run with a blank password. The solution to this problem is available here: http://support.microsoft.com/kb/310715

Tick the check box next to "Open Advanced Properties for this task when I click Finish" and then click finish.


In Advanced property, replace the existing path in Run with the one created in Step I.

Now switch over to the schedule tab and check Show Multiple Schedules. Add a new schedule and configure it to run just once immediately in a couple of minutes to check whether it works properly or not.

STEP III: Configuring your monitors power setting


Now you dont want your monitor to be on the entire night. So we will add a timeout of 1 min after which the monitor will be turned off if there is no activity within that period. To do so go to Control Panel >> Power Options. Set the Turn off monitor time to 1 min( or whatever suits your needs).


And we are done setting up the video alarm. Now at the specified time your monitor will automatically turn on and the video of your choice will be played. As VLC plays a variety of files you can also use this method to play music files.

I would be glad to hear some suggestions from you guys as to what Videos to use for the morning alarm or what else can this setup be used for.

, , ,

4 comments:

Anonymous said...

Hey, thanks so much for this, I've been looking for an answer.

Obviously this can be used for good or evil. Evil: how about programming porn to come on during the middle of your friend's party? Full screen and really loud :-P No, I don't think even I could be that mean. But it's another idea nonetheless.

alexherder said...

I appreciate this post you've written about using VLC as a "video alarm clock." I have been hunting around for applications that work as an alarm and ignoring the fact that I can use the Windows that I ...ahem... payed for. I will definitely try this out, who knows, maybe I'll feature it on my site.

Also, I love that your computer is called MENTAT. That's awesome.

Phill said...

Thank you, chief. this was marvelously helpful.

Mick said...

Thanks, I'm planning on turning on an episode of 'Sunrise Earth' a few minutes before an audio alarm goes off. Nice relaxing way to wake up.