Hello There,
The best place to put scripts you just want to use yourself is in the bin folder in your home directory. (you'll have to create it but if it exists ubuntu adds it to the $PATH)
here is the script I use to record TV with mencoder:
Quote:
#!/bin/bash
#
# script to encode tv using mencoder
#
# usage tape <channel#> <name> <duration>
#
CHAN="$1"
FNAME="$2"
DURATION="$3"
if [ $# -ne 3 ]
then
echo "Usage tape <Channel> <Name> <duration>"
echo "duration = hh:mm:ss"
exit
fi
echo
echo "Taping " "$FNAME""_`date +%m%d`"
echo
mencoder tv:// -tv driver=v4l:device=/dev/video0:width=352:height=240:fps=29.970:norm=ntsc:chanlist=us-cable:channel=$CHAN:saturation=-20:contrast=-20:audiorate=48000:immediatemode=0 -vf denoise3d -oac mp3lame -lameopts fast:
preset=medium -ovc lavc -lavcopts vcodec=mpeg4:vqscale=4:aspect=4/3 -endpos $DURATION -ffourcc DX50 -o "$FNAME"_`date +%m%d`.avi -quiet
|
everything after mencoder is one long line so if you cut and paste you may need to put that back together if LQ split it into multiple lines.
you'll need to change norm=ntsc,width=,height=,chanlist=,fps= if you are not in north america (most of europe would change this to norm=pal for example).
chanlist= - should be set to the correct one for your area
width=,height= - are set to preference as you can see I am not doing fullframe NTSC (that would be closer to 720x480) but my machine isnt currently fast enough to capture full frame as that requires deinterlacing.
fps= - varies by Standard also, but can be set to less then the full framerate if you choose. (NTSC=29.970, PAL=25, etc)
The -vf denoise3d is not strictly necessary I have some noise on some of my cable channels and that helps to clean it up.. but it can be dropped for slower machines.
Also the "saturation=,contrast=" are not strictly necessary I put them in as my tv card tends to "wash out" the video on some channels.
I usually run the "tape" script from a cron job. This will run it automatically and tape the programs I want.
for example the line:
00 17 * * 1-5 bin/tape 20 Voyager 01:00:00
tapes Voyager for me at 5 pm Mon-Friday. this is my user crontab not roots cron tab or the system cron scripts.. it's very easy to edit your local crontab using the "crontab -e" command in a terminal.
I also installed a "local mail only" postfix so that I get e-mail notifications of how my cronjobs did so I can see if there was a problem. (in /var/spool/mail/[username])
of course test the script from a terminal until you are sure it is working satisfactorally before you set it up as a cron job.
Hope this helps
Freemor