ding:tvrecording
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
ding:tvrecording [2008/06/04 19:10] – removed 138.220.76.37 | ding:tvrecording [2008/06/04 19:39] (current) – old revision restored ach | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== TV recording using mencoder ====== | ||
+ | |||
+ | Sometimes there is a show on TV I want to record for watching it later. I have a TV card in the [[ding: | ||
+ | |||
+ | Bus 0, device | ||
+ | Multimedia video controller: Brooktree Corporation Bt848 Video Capture (rev 18). | ||
+ | IRQ 5. | ||
+ | Master Capable. | ||
+ | Prefetchable 32 bit memory at 0xef000000 [0xef000fff]. | ||
+ | |||
+ | ===== Kernel Support ===== | ||
+ | |||
+ | Here are the modules I did select in the kernel configuration to get the TV card running. | ||
+ | |||
+ | Character devices | ||
+ | I2C support | ||
+ | <M> I2C support | ||
+ | <M> I2C bit-banging interfaces | ||
+ | Multimedia devices | ||
+ | <M> Video For Linux | ||
+ | Video For Linux ---> | ||
+ | [*] V4L information in proc filesystem | ||
+ | < | ||
+ | Sound ---> | ||
+ | <M> Sound card support | ||
+ | < | ||
+ | < | ||
+ | |||
+ | ===== Recording Script ===== | ||
+ | |||
+ | I use [[http:// | ||
+ | |||
+ | < | ||
+ | #!/bin/sh | ||
+ | |||
+ | #Duration in seconds | ||
+ | TIME=$1 | ||
+ | #Channel like S35 or E12 | ||
+ | CH=$2 | ||
+ | #name of program (filename) | ||
+ | NAME=$3 | ||
+ | |||
+ | #Where to put the stuff | ||
+ | OUTDIR="/ | ||
+ | OUT=" | ||
+ | |||
+ | #Bitrate for video encoding | ||
+ | VBR=500 | ||
+ | |||
+ | # | ||
+ | ABR=96 | ||
+ | |||
+ | #mencoder | ||
+ | ME='/ | ||
+ | |||
+ | CMD=" | ||
+ | -tv driver=v4l: | ||
+ | -ovc lavc -lavcopts vcodec=mpeg4: | ||
+ | -oac mp3lame -lameopts cbr:br=$ABR | ||
+ | -endpos $TIME -sws 1 -o $OUT" | ||
+ | |||
+ | echo " | ||
+ | echo "vol PhoneIn 60" | / | ||
+ | $CMD | ||
+ | echo "vol PhoneIn 0" | / | ||
+ | </ | ||
+ | |||
+ | The script uses [[ding: | ||
+ | |||
+ | For more info on the mencoder options used see http:// | ||
+ | |||
+ | ===== Programmed Recording ===== | ||
+ | |||
+ | To program this VCR I use '' | ||
+ | |||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | RECORDER="/ | ||
+ | |||
+ | OPTS=' | ||
+ | |||
+ | NAME=`dialog $OPTS --title " | ||
+ | if test $? -ne 0 ; then exit; fi | ||
+ | |||
+ | PROG=`dialog $OPTS --title " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | if test $? -ne 0 ; then exit; fi | ||
+ | |||
+ | DATE=`dialog $OPTS --title " | ||
+ | if test $? -ne 0 ; then exit; fi | ||
+ | DATE=`echo $DATE | sed -e ' | ||
+ | |||
+ | START=`dialog $OPTS --title " | ||
+ | if test $? -ne 0 ; then exit; fi | ||
+ | START=" | ||
+ | |||
+ | |||
+ | TIME=`dialog $OPTS --title " | ||
+ | if test $? -ne 0 ; then exit; fi | ||
+ | |||
+ | #Calculate seconds from TIME: | ||
+ | THRS=`echo $TIME | cut -d : -f 1` | ||
+ | THRS=`expr $THRS \* 3600` | ||
+ | TMIN=`echo $TIME | cut -d : -f 2` | ||
+ | TMIN=`expr $TMIN \* 60` | ||
+ | TSEC=`echo $TIME | cut -d : -f 3` | ||
+ | TIME=`expr $THRS + $TMIN` | ||
+ | TIME=`expr $TIME + $TSEC` | ||
+ | |||
+ | dialog $OPTS --title " | ||
+ | "I will record the TV-Show ' | ||
+ | It starts at $DATE $START and runs $TIME seconds. Is that okay?" 0 0 | ||
+ | if test $? -ne 0 ; then exit; fi | ||
+ | |||
+ | echo " | ||
+ | </ | ||
+ | |||
+ | Note: '' | ||
+ | |||
ding/tvrecording.1212606609.txt.gz · Last modified: 2008/07/15 22:30 (external edit)