VCR HOWTO Using Your GNU/Linux Computer As A VCR
VCR HOWTO Using Your GNU/Linux Computer As A VCR
Table of Contents
VCR−HOWTO − Using your GNU/Linux computer as a VCR.....................................................................1
Brian Hayward, twivel@slothmud.org....................................................................................................1
1. Introduction..........................................................................................................................................1
2. Technologies........................................................................................................................................1
3. Implementation....................................................................................................................................1
4. Alternate Recorder − Creating VCD's for playback on DVD/VCD Players.......................................1
5. Further Information..............................................................................................................................2
6. Getting Help.........................................................................................................................................2
7. Concluding Remarks............................................................................................................................2
8. Questions and Answers........................................................................................................................2
1. Introduction..........................................................................................................................................2
1.1 Copyright...........................................................................................................................................2
1.2 Disclaimer..........................................................................................................................................2
1.3 News..................................................................................................................................................3
1.4 Credits................................................................................................................................................3
1.5 Translations........................................................................................................................................3
2. Technologies........................................................................................................................................3
2.1 Tuner or Capture Card.......................................................................................................................3
2.2 Kernel video4linux driver..................................................................................................................4
2.3 Frame Capture Software....................................................................................................................4
3. Implementation....................................................................................................................................4
3.1 Install and Configure Tuner Card......................................................................................................4
3.2 Configure xawtv to function properly................................................................................................4
Sample .xawtv configuration file................................................................................................4
3.3 Install the avifile library.....................................................................................................................9
Compiling and installing avifile−0.53−5....................................................................................9
3.4 Installing the VCR frame−grabber program......................................................................................9
Compiling and installing vcr−1.07.............................................................................................9
Sample .vcrrc configuration file...............................................................................................10
3.5 Using cron to record your favorite program....................................................................................14
Sample cron shell script............................................................................................................14
Calling the script from cron......................................................................................................14
Calling the script from at..........................................................................................................15
4. Alternate Recorder − Creating VCD's for playback on DVD/VCD Players.....................................15
4.1 Introduction to VCD Creation.........................................................................................................15
4.2 Required Hardware for VCD Creation and Playing........................................................................15
4.3 Required Software for VCD Creation..............................................................................................15
4.4 Procedure for creating a VCD..........................................................................................................16
5. Further Information............................................................................................................................16
5.1 MyVCR Wrapper Program proposal...............................................................................................16
5.2 Alternate Recorders.........................................................................................................................16
5.3 Recording Results............................................................................................................................16
5.4 Other Suggested Ideas......................................................................................................................17
6. Getting Help.......................................................................................................................................17
7. Concluding Remarks..........................................................................................................................17
8. Questions and Answers......................................................................................................................17
i
VCR−HOWTO − Using your GNU/Linux computer
as a VCR
Brian Hayward, [email protected]
0.04, 2001−07−30
This is a guide to setting up your GNU/Linux workstation as a digital VCR using the video4linux driver and a
supported tuner card. A section has been added for creating VCD's that can be played in any DVD/VCD
player as well.
1. Introduction
• 1.1 Copyright
• 1.2 Disclaimer
• 1.3 News
• 1.4 Credits
• 1.5 Translations
2. Technologies
• 2.1 Tuner or Capture Card
• 2.2 Kernel video4linux driver
• 2.3 Frame Capture Software
3. Implementation
• 3.1 Install and Configure Tuner Card
• 3.2 Configure xawtv to function properly.
• 3.3 Install the avifile library
• 3.4 Installing the VCR frame−grabber program
• 3.5 Using cron to record your favorite program.
5. Further Information
• 5.1 MyVCR Wrapper Program proposal
• 5.2 Alternate Recorders
• 5.3 Recording Results
• 5.4 Other Suggested Ideas
6. Getting Help
7. Concluding Remarks
8. Questions and Answers
1. Introduction
This is a guide to setting up your GNU/Linux computer as a VCR. Setting up my VCR took a little research,
but it didn't turn out to be as difficult as I thought. I decided to publish my results so others may benefit from
what I've done. This is by no means the only method to achieve the same results as there are several
applications out there that may perform similar tasks. Hopefully any unique procedures for configuring other
software or devices may be incorporated into this document.
1.1 Copyright
Copyright (c) 2001 by Brian Hayward (Twivel)
Please freely copy and distribute (sell or give away) this document in any format. It's requested that
corrections and/or comments be forwarded to the document maintainer. You may create a derivative work
and distribute it provided that you:
• Send your derivative work (in the most suitable format such as sgml) to the LDP (Linux
Documentation Project) or the like for posting on the Internet. If not the LDP, then let the LDP know
where it is available.
• License the derivative work with this same license or use GPL. Include a copyright notice and at least
a pointer to the license used.
• Give due credit to previous authors and major contributors.
If you're considering making a derived work other than a translation, it's requested that you discuss your plans
with the current maintainer.
1.2 Disclaimer
Use the information in this document at your own risk. I disavow any potential liability for the contents of
this document. Use of the concepts, examples, and/or other content of this document is entirely at your own
risk.
5. Further Information 2
VCR−HOWTO − Using your GNU/Linux computer as a VCR
All copyrights are owned by their owners, unless specifically noted otherwise. Use of a term in this document
should not be regarded as affecting the validity of any trademark or service mark.
You are strongly recommended to take a backup of your system before major installation and backups at
regular intervals.
1.3 News
This is the first release. No news yet.
1.4 Credits
The following individuals either helped me directly or indirectly during the process of developing this
HOWTO. Several tips that were suggested by these people have not been added to this document yet, don't
worry − all in good time.
1.5 Translations
Marcio Montenegro was kind enough to translate this document to Portuguese. His translation is available at
this site. Feel free to translate this document to other languages. If you send me a link, I will credit you and
include it in this document. Please note that for it to be included in the Linux Documentation Project, you
will have to provide it in sgml format.
2. Technologies
This section describes the different technologies used to build your own Linux VCR.
1.3 News 3
VCR−HOWTO − Using your GNU/Linux computer as a VCR
3. Implementation
Now lets go through the steps of actually configuring your computer as a VCR.
These parameters will vary depending on the model of your card, see the documentation found in the linux
source (linux/Documentation/video4linux) to figure out exactly how to configure your card. I added these
modules to /etc/modules so they would automatically load on bootup. You can also manually load them with
'modprobe modulename' as root. I'm currently using the 2.4.2 kernel, but I have had success with this card
with all of the 2.2.x kernels as well. Hint: the user may need to have ownership of the /dev/video /dev/video0
files (and maybe other devices as well) before the tuner card will function. As always, I suggest not running
any apps as root.
same as actual channel numbers. The following configuration file was designed for US−cable, your mileage
may vary.
[global]
freqtab = us−cable
pixsize = 128 x 96
pixcols = 1
jpeg−quality = 75
mjpeg−quality = 75
toggle−mouse = 0
keypad−ntsc = no
osd = yes
# [Station name]
# capture = overlay | grabdisplay | on | off
# input = Television | Composite1 | S−Video | ...
# norm = PAL | NTSC | SECAM | ...
# channel = #
# fine = # (−128..+127)
# key = keysym | modifier+keysym
# color = #
# bright = #
# hue = #
# contrast = #
[defaults]
norm = NTSC
capture = over
input = Television
[CH0 0]
channel = 0
fine = 0
[CH1 1]
channel = 1
fine = 0
[CH2 2]
channel = 2
fine = 0
[CH3 3]
channel = 3
fine = 0
[CH4 4]
channel = 4
fine = 0
[CH5 5]
channel = 5
fine = 0
[CH6 6]
channel = 6
fine = 0
[CH7 7]
channel = 7
fine = 0
[CH8 8]
channel = 8
fine = 0
[CH9 9]
channel = 9
fine = 0
[CH10 10]
channel = 10
fine = 0
[CH11 11]
channel = 11
fine = 0
[CH12 12]
channel = 12
fine = 0
[CH13 13]
channel = 13
fine = 0
[CH14 14]
channel = 14
fine = 0
[CH15 15]
channel = 15
fine = 0
[CH16 16]
channel = 16
fine = 0
[CH17 17]
channel = 17
fine = 0
[CH18 18]
channel = 18
fine = 0
[CH19 19]
channel = 19
fine = 0
[CH20 20]
channel = 20
fine = 0
[CH21 21]
channel = 21
fine = 0
[CH22 22]
channel = 22
fine = 0
[CH23 23]
channel = 23
fine = 0
[CH24 24]
channel = 24
fine = 0
[CH25 25]
channel = 25
fine = 0
[CH26 26]
channel = 26
fine = 0
[CH27 27]
channel = 27
fine = 0
[CH28 28]
channel = 28
fine = 0
[CH29 29]
channel = 29
fine = 0
[CH30 30]
channel = 30
fine = 0
[CH31 31]
channel = 31
fine = 0
[CH32 32]
channel = 32
fine = 0
[CH33 33]
channel = 33
fine = 0
[CH34 34]
channel = 34
fine = 0
[CH35 35]
channel = 35
fine = 0
[CH36 36]
channel = 36
fine = 0
[CH37 37]
channel = 37
fine = 0
[CH38 38]
channel = 38
fine = 0
[CH39 39]
channel = 39
fine = 0
[CH40 40]
channel = 40
fine = 0
[CH41 41]
channel = 41
fine = 0
[CH42 42]
channel = 42
fine = 0
[CH43 43]
channel = 43
fine = 0
[CH44 44]
channel = 44
fine = 0
[CH45 45]
channel = 45
fine = 0
[CH46 46]
channel = 46
fine = 0
[CH47 47]
channel = 47
fine = 0
[CH48 48]
channel = 48
fine = 0
[CH49 49]
channel = 49
fine = 0
[CH50 50]
channel = 50
fine = 0
[CH51 51]
channel = 51
fine = 0
[CH52 52]
channel = 52
fine = 0
[CH53 53]
channel = 53
fine = 0
[CH54 54]
channel = 54
fine = 0
[CH55 55]
channel = 55
fine = 0
[CH56 56]
channel = 56
fine = 0
[CH57 57]
channel = 57
fine = 0
[CH58 58]
channel = 58
fine = 0
[CH59 59]
channel = 59
fine = 0
You will need to be root for the make install step to work. If you receive any errors, they were probably due
to a missing dependency during the configure step. Resolve any dependencies and try again. This should
work smoothly on any recent distribution that was installed with 'development' tools.
# ./configure
# make
# make install
[defaults]
quality = 95
keyframes = 15
codec = DivX ;−) low−motion
attributes = BitRate=1600
source = Television
norm = ntsc
verbose = 1
freqtab = us−cable
audiofrequency=44
audiobitrate=64
resolution=384
framerate = 29.97
grabdevice=/dev/video0
[CH0 0]
channel = 0
fine = 0
[CH1 1]
channel = 1
fine = 0
[CH2 2]
channel = 2
fine = 0
[CH3 3]
channel = 3
fine = 0
[CH4 4]
channel = 4
fine = 0
[CH5 5]
channel = 5
fine = 0
[CH6 6]
channel = 6
fine = 0
[CH7 7]
channel = 7
fine = 0
[CH8 8]
channel = 8
fine = 0
[CH9 9]
channel = 9
fine = 0
[CH10 10]
channel = 10
fine = 0
[CH11 11]
channel = 11
fine = 0
[CH12 12]
channel = 12
fine = 0
[CH13 13]
channel = 13
fine = 0
[CH14 14]
channel = 14
fine = 0
[CH15 15]
channel = 15
fine = 0
[CH16 16]
channel = 16
fine = 0
[CH17 17]
channel = 17
fine = 0
[CH18 18]
channel = 18
fine = 0
[CH19 19]
channel = 19
fine = 0
[CH20 20]
channel = 20
fine = 0
[CH21 21]
channel = 21
fine = 0
[CH22 22]
channel = 22
fine = 0
[CH23 23]
channel = 23
fine = 0
[CH24 24]
channel = 24
fine = 0
[CH25 25]
channel = 25
fine = 0
[CH26 26]
channel = 26
fine = 0
[CH27 27]
channel = 27
fine = 0
[CH28 28]
channel = 28
fine = 0
[CH29 29]
channel = 29
fine = 0
[CH30 30]
channel = 30
fine = 0
[CH31 31]
channel = 31
fine = 0
[CH32 32]
channel = 32
fine = 0
[CH33 33]
channel = 33
fine = 0
[CH34 34]
channel = 34
fine = 0
[CH35 35]
channel = 35
fine = 0
[CH36 36]
channel = 36
fine = 0
[CH37 37]
channel = 37
fine = 0
[CH38 38]
channel = 38
fine = 0
[CH39 39]
channel = 39
fine = 0
[CH40 40]
channel = 40
fine = 0
[CH41 41]
channel = 41
fine = 0
[CH42 42]
channel = 42
fine = 0
[CH43 43]
channel = 43
fine = 0
[CH44 44]
channel = 44
fine = 0
[CH45 45]
channel = 45
fine = 0
[CH46 46]
channel = 46
fine = 0
[CH47 47]
channel = 47
fine = 0
[CH48 48]
channel = 48
fine = 0
[CH49 49]
channel = 49
fine = 0
[CH50 50]
channel = 50
fine = 0
[CH51 51]
channel = 51
fine = 0
[CH52 52]
channel = 52
fine = 0
[CH53 53]
channel = 53
fine = 0
[CH54 54]
channel = 54
fine = 0
[CH55 55]
channel = 55
fine = 0
[CH56 56]
channel = 56
fine = 0
[CH57 57]
channel = 57
fine = 0
[CH58 58]
channel = 58
fine = 0
[CH59 59]
channel = 59
fine = 0
#!/bin/sh
LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH
PATH=/usr/local/bin:$PATH
export PATH
DATE=`date +%m%d%y`
FILENAME=/path/to/myshow−6pm−$DATE.avi
v4lctl setstation 3
vcr −t 60m $FILENAME
00 18 * * 1−5 /home/username/bin/recordshow6pm.sh
at −f /home/username/bin/recordshow6pm.sh 18:00
After recording shows on my computer for a while, I realized it was much nicer to watch the shows on my
full−sized television set than to watch them on my computer monitor. There are two options for doing this: 1)
Purchase a video card with TV−OUT and run a cable to my television. or 2) Create a VCD and play it in my
DVD Player. Since CD−R and CD−RW media is really cheap I decided to go this route.
This section could theoretically be done in a different HOWTO because it uses a different method for
recording/converting than the other sections of the VCR−HOWTO use. This is primarily because I haven't
figured out how to create VCD compatible mpeg's using vcr. If your goal is to create VCD's, use this section
of the HOWTO. If you don't care about VCD's, completely ignore this section of the howto because these
procedures require MUCH MORE disk space than using vcr to record for playing under linux.
5. Further Information
In this section, you'll find more information on additional utilities or ideas for making a VCR work under
Linux.
6. Getting Help
Feel free to contact me if you have any questions. For product specific questions, you may also make use of
resources for the specific application. As always, read the documentation for each product before contacting
someone. I may be contacted at [email protected].
7. Concluding Remarks
I hope this document has been helpful. If you have any ideas or improvements to this document, please feel
free to contact me.
A: This could be due to several things. In order for audio recording to work, you must have the tuner
card send output to the 'line−in' on your sound card. You must also use the mixer to enable the
line−in on the sound card (if you hear sound while recording the show, it is probably enabled). I used
to have my tuner card sound sent to my stereo receiver instead of the sound card, which was why I
didn't get sound. Finally, it may be that the sound was record properly, but your sound device is in
use by another program (esd, licq, xmms, etc).
A: This may be due to a slow CPU. I currently haven't determined the exact requirements for
recording with this method, I'm hoping user feedback will help me figure out what CPU is indeed
required. I have a Duron 700 that seems to work fine, but I've heard that people with a 200−500mhz
processor are unable to get smooth video.
A: This may be due to an incorrect FPS setting for your video type. For NTSC you will want to use
29.97. For PAL you will want to use 25. I still don't get perfect audio/video synchronization − but I
can live with it. Hopefully this will improve over time.