Script to open a movie

6 views
Skip to first unread message

Satish

unread,
Jul 22, 2010, 6:14:38 PM7/22/10
to Linux Experts Group - LEG
Hi friends,
I am newbie to Linux.I've worked on the environment but not an expert.
I have a doubt plz help me out. I need a script to play a movie file
in vlc player by def. Also I need to schedule it when linux boots up
and gets loads up I need to play this movie file after 2 mins and stop
after 5 mins. is it possible? Can you give me the script for it?? or
any syntax or links are welcome....

Rajeshg

unread,
Aug 27, 2010, 8:44:50 AM8/27/10
to Linux Experts Group - LEG
Hi Satish,

During booting, all the servies (either started/stopped) based on run
level.. when you need any job or any custom script, you can edit the
file /etc/rc.d/rc.local
this file gets executed after all your boot process.

so for your requirement, I would suggest below lines at the end of
file,

sleep 120 # Sleep for 2 mins
vlc -vvv <FILENAME> & # Launch the vlc with the
required video file in background
process_no=$! # Get the job number of
the launched process
sleep 300 # Sleep for 5 mins
kill -9 ${process_no} # Kill playing

I haven't done any research on vlc commandline interface.. the above
may not play exact 5 mins of video.. if you got any solution
meanwhile.. please share with me...

Thanks,
Rajesh

SHIVA

unread,
Aug 27, 2010, 1:18:52 PM8/27/10
to Rajeshg, Linux Experts Group - LEG
I am not sure whether the below steps will work, since VLC required X11 it will not work with rc.local. May be you can try it with user login scripts (.bashrc or .profile) this will work whenever the users login.

Regards
Shiva


--
LEG - Linux Experts Group:   http://groups.google.co.in/group/linuxexperts
        To subscribe:   linuxexpert...@googlegroups.com
                     Visit  LEG - Webpage: http://gmix.in/leg

Reply all
Reply to author
Forward
0 new messages