I was in a country far far away last month. So far that there was no broadband access (yes, this is possible). Anyway… Generally I use my mobile phone as a clock and as an alarm clock. Unfortunalty I brake it down just before my night flight.
So, to simplify, I was abroad in a hotel, the sun was down since a while, I was tired, and I had to wake up early. No electronic devices to help me, except my laptop… And then came the idea to combine cron and mplayer to automaticcaly play some MP3s at a given time.
Here is how I’ve done it. First, as root, create an empty file in /etc/cron.d/. Let us call it wake-up:
touch /etc/cron.d/wake-up
Then edit it to put the following command:
15 6 * * * root mplayer /home/kevin/music/CoolCavemen/AllCoolHits/*.flac > /dev/null 2>&1 /dev/null
This mean that mplayer will be launched at 6:15 and will play all FLAC files from the /home/kevin/music/CoolCavemen/AllCoolHits/ directory. I let you adapt those parameters to fit your needs.
Random Tips:
- Take care of time zone (system time and local time are very different).
- Check that your volume is not muted and crank the volume up !
- Run the
mplayer /home/kevin/music/CoolCavemen/AllCoolHits/*.flac > /dev/null 2>&1 /dev/null command alone in another terminal before you go to sleep to be sure it work (i.e. to check that all sound-related sub-systems are loaded).
- Be sure that cron deamon is up an running (do a
/etc/init.d/crond restart if you are not sure).
Compile gvidcap !
Get the last stable source code archive on xvidcap Sourceforge project page or download it from the CVS:
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/xvidcap co -P xvidcap
Install required dependencies:
urpmi gcc automake libgtk+2-devel ffmpeg-devel liblame0-devel
Dirty compile:
make distclean [optional]
CPPFLAGS=-I/usr/include/ffmpeg LDFLAGS=-L/usr/bin/ffmpeg
./configure --with-gtk2 --with-forced-embedded-ffmpeg && make gvidcap
make gvidcap
make install [optional]
Quick test:
./src/gvidcap &
Use gvidcap !
Raw capture:
gvidcap --gui no -v --file ~/img_%04d.xwd --frames 0 --fps 10 --cap_geometry 1024x768+0+0
The following can be used but it slow down the machine (png compression require too cpu):
gvidcap --gui no -v --compress 9 --file ~/img_%04d.png --frames 0 --fps 10 --cap_geometry 1024x728+0+0
Convert .xwd images to .png images because mplayer only support .png, .jpg, .tga and .sgi image file format:
convert img_*.xwd img_%04d.png && rm -rf ./*.xwd
Preview the video:
mplayer "mf://*.png" -mf fps=10
Make a video from successive screenshots:
mencoder "mf://*.png" -mf fps=10 -ovc lavc -o ./video.avi
Documentation:
Latest blog activity
kev, djib
Hrr, bhanu, Amor, Miller, Teodoro, Darius [...]
Toma, kev, Toma
William Kulich, Roland Gesthuizen, bbr, Girish, Ozmumcu, gavjof [...]
kev, djib