Ralfs
Video for Linux

About making DVD here.

VDR (Video Disk Recorder)

Setup on Fedora Core 6

Plugins:

Plugin installation

Decompress the archive in $SOURCEDIR/vdr/PLUGINS/src

Finally, a symbolic link to the plugin name without the version number is to be created
ln -s $PLUGIN_NAME- $PLUGIN_NAME
Change to the VDR root directory and compile the plugins
cd ../..
make plugins

After everything has been compiled without errors, copy the plugins to their target directory

And last but not least you have to add the plugin to the vdr start command

vdr ....... -P$PLUGIN_NAME ....
Analog Video capture

Tests based on:

PixelView PlayTV Pro
TV-Tuner BT878 FM
PV-BT878P+ (REV.4C)
Important is to set right driver:
modprobe bttv card=70
Or in /etc/modprobe.conf
options bttv card=70
For card=n parameters: Bt8x8 Cards by Number

ALSA support for the Bt878a

how to
Looks like no more drivers btaudio, tvaudio.
I use snd-bt87x

The installer has detected the Primary sound card but the Bt878a don't.
### /etc/modprobe.conf
...
alias snd-card-1 snd-bt87x
alias sound-slot-1 snd-bt87x
options snd-bt87x index=1 load_all
modprobe snd-bt87x
cat /proc/asound/pcm
Check:
$ ll /dev/snd/
total 0
crw-------  1 root root 116,  0 Aug  7 20:17 controlC0
crw-------  1 root root 116, 32 Aug  7 20:17 controlC1
crw-------  1 root root 116,  8 Aug  7 20:17 midiC0D0
crw-------  1 root root 116, 24 Aug  7 20:17 pcmC0D0c
crw-------  1 root root 116, 16 Aug  7 20:17 pcmC0D0p
crw-------  1 root root 116, 17 Aug  7 20:17 pcmC0D1p
crw-------  1 root root 116, 56 Aug  7 20:17 pcmC1D0c
crw-------  1 root root 116, 57 Aug  7 20:17 pcmC1D1c
crw-------  1 root root 116,  1 Aug  7 20:17 seq
crw-------  1 root root 116, 33 Aug  7 20:17 timer
pcmC1D0c belongs to the Bt878 digital audio input and pcmC1D1c to the analog input. Kpsavilkums, modules:
i2c-core
i2c_algo_bit

bttv
bt878
btcx_risc
tvaudio
tuner

tveeprom
snd_bt87x
v4l1_compat
v4l2_common
ir_common

videodev
video_buf
compat_ioctl32

Test/Set tools

# all info
v4l-info

# command line tool to set video4linux parameters
# (tune in some channel, set TV norm, ...)
v4lctl list

xawtv -hwscan
xawtv -device /dev/video0
streamer -p 4 -t 1:00 -r 24 -q -o test.avi -j 90 -f mjpeg -F mono16

v4l-conf

# Nothing usable:
# install:
yum -y install xawtv v4l2-tool
# usage
v4l2-tool

Your recording can be managed either using your primary soundcard, or the Bt8x8 card itself using the snd_bt87x module. Recording Video and Sound with Bttv

First, identify the individual cards on your system (requires /proc filesystem):
$ cat /proc/asound/pcm
00-00: Intel ICH : NVidia CK8S : playback 1 : capture 1
00-01: Intel ICH - MIC ADC : NVidia CK8S - MIC ADC : capture 1
00-02: Intel ICH - IEC958 : NVidia CK8S - IEC958 : playback 1
01-00: Bt87x Digital : Bt87x Digital : capture 1
01-01: Bt87x Analog : Bt87x Analog : capture 1

The first column indicates the system numbering of your available sound devices, i.e., card 0 is the soundcard and card 01, or 1, is the Bt8x8.

Next, identify the mixer controls for the Bt8x8 card.
$ amixer -c 1 controls
numid=3,iface=MIXER,name='Capture Source'
numid=2,iface=MIXER,name='Capture Boost'
numid=1,iface=MIXER,name='Capture Volume'

Then identify the item settings of each:

$ amixer -c 1 cget name='Capture Source'
   numid=3,iface=MIXER,name='Capture Source'
   ; type=ENUMERATED,access=rw---,values=1,items=3
   ; Item #0 'TV Tuner'
   ; Item #1 'FM'
   ; Item #2 'Mic/Line'
   : values=1

   $ amixer -c 1 cget name='Capture Boost'
   numid=2,iface=MIXER,name='Capture Boost'
   ; type=BOOLEAN,access=rw---,values=1
   values=on

   $ amixer -c 1 cget name='Capture Volume'
   numid=1,iface=MIXER,name='Capture Volume'
   ; type=INTEGER,access=rw---,values=1,min=0,max=15,step=0
   : values=0

Use cset for the capture source:

$ amixer -c 1 cset name='Capture Source' 0
...and to set the volume:
$ amixer -c 1 cset name="Capture Volume' 15
...and you should be ready.

Now try to record something:

# quiet, 4 threads: -q -p 4
# video source:     -c /dev/video0 -i 1 -n pal
# quality 90:       -j 90
# fps, resol.:      -r 25 -s 720x576
# video format:     -f mjpeg
# Audio src:        -C /dev/dsp
# audio format:     -F stereo
$ streamer -q -p 4 -c /dev/video0 -i 1 -n pal \
   -j 90 -r 25 -f mjpeg -C /dev/dsp -F stereo -t 1:00 -o test.avi

# OTHER:
# build mpeg movies using mjpegtools + compressed avi file:
    streamer -t 0:30 -s 352x240 -r 24 -o movie.avi -f mjpeg -F stereo
    lav2wav +p movie.avi | mp2enc -o audio.mp2
    lav2yuv +p movie.avi | mpeg2enc -o video.m1v
    mplex audio.mp2 video.m1v -o movie.mpg
# build mpeg movies using mjpegtools + raw, uncompressed video:
    streamer -t 0:30 -s 352x240 -r 24 -o video.yuv -O audio.wav -F stereo
    mp2enc -o audio.mp2 < audio.wav
    mpeg2enc -o video.m1v < video.yuv
    mplex audio.mp2 video.m1v -o movie.mpg

...and you should be recording a sound-enabled avi file. Press [Ctrl]-C to cancel early.

To get a list of your alsa capture devices, issue

arecord -l

Format Constraints

PAL DVD: 720x576, 704x576 / MPEG-2 / 9800 kbps / 48000 Hz / MP2,AC-3,PCM / A. Bitrate: 1536 kbps (max) / 25 fps / 4:3, 16:9 (only for 720x576)
HDTV: 1080 horizontal lines x 1920 vertical lines (1920x1080)
PAL/SECAM: 4x3 frame, (x625 theoretical total), 25 frames/sec, 50Hz, 50 half frames/sec interlaced.

transcode

Looks best of all others

So far transcode is the only solution that delivers on all counts: good audio/video synchronization, small file size, efficient encoding (full size and high quality without dropped frames), and a resulting file that streams with VLC.

Good link: TV Recording

More info about filters -J (filter1[,filter2[,...]]):

You can specify more than one -J argument.

The order of filter arguments specify in which order the filters are applied. Note also, for transcode internally it makes no difference whether you do "-J filter1 -J filter2" or "-J filter1,filter2"

# To see what filters are available at your installation of  transcode, execute:
ls -1 `tcmodinfo -p`/filter*.so

# Use ’tcmodinfo -i NAME’ to get more information about the filter_NAME.
# Name is specified without the prefix filter_ and without the suffix .so
tcmodinfo -i denoise3d
# Litle bit description:
#
# -x vmod[,amod]
#        video[,audio]  import modules [auto,auto].
# -M mode: 0 Pass-through; 1 PTS only (default);; ...
# -F codec_string
# list  of  valid codecs:
#        transcode -y ffmpeg -F list
# -u m[,n]
#        use m framebuffer[,n threads] for AV processing [10,1].
# -w b[,k[,c]]
#        encoder bitrate[,keyframes[,crispness]] [(6000 for MPEG 1/2, 1800 for
#        others),250,100].
# -b b[,v,[q,[m]]]
#        audio encoder bitrate kBits/s[,vbr[,quality[,mode]]] [128,0,5,0]
#        The mode parameter specifies which modus lame should use  for  encoding.
#        Available modes are:
#               0   Joint Stereo (default)
#               1   Full stereo
#               2   Mono
# -Q n[,m]
#        encoding[,decoding] quality (0=fastest-5=best) [5,5].
# -e r[,b[,c]]
#        PCM  audio  stream  parameter.  Sample rate [Hz], bits per sample and
#        number of channels [48000,16,2]. Normally this is autodetected.
# --lame_preset name[,fast]
#        built-in presets

# -F h264   Bad picture
# -F mpeg2  Separate audio and video (tran001.avi.m2v)

# Set v4l2 parameters (station, bright, volume, etc.) using your
# favourite tv viewing program or something like v4lctl.
v4lctl setinput Composite1

transcode -x v4l2=resync_margin=1:resync_interval=250,v4l2 -M 1 \
 -i /dev/video0 -p /dev/dsp -y ffmpeg -F h264 -c 00:00:10 -g 640x480 -f 25 \
 -u 1024,2 -w 800 -b 196 -Q 5 -e 48000,16,2 --lame_preset standard -o tran001.avi

Xawtv

Labs info: http://tldp.org/HOWTO/BTTV/

Un par Audio: http://tldp.org/HOWTO/BTTV/recording.html

# First, identify the individual cards
cat /proc/asound/pcm
# Next, identify the mixer controls
amixer -c 1 controls
# ...
# ----- Te būtiski no kurienes jems skaņu -----
# Use cset for the capture source:
amixer -c 1 cset name='Capture Source' 0
# ...and to set the volume:
amixer -c 1 cset name='Capture Volume' 15
#
# Now try to record something:
streamer -p 4 -t 1:00 -r 24 -q -o test.avi -j 90 -f mjpeg -F mono16

Mplayer / Mencoder

MPlayer Doc and Basic usage of MEncoder

# Play
mplayer -tv driver=v4l2:device=/dev/video0:input=1:width=768:height=576 -vo xv tv://
# Save
mencoder -tv driver=v4l2:device=/dev/video0:input=1:width=768:height=576 tv:// \
         -o test001.avi -oac lavc -ovc lavc
# Advanced
mencoder -tv driver=v4l2:device=/dev/video0:input=1:width=768:height=576 tv:// \
         -o test001.avi -oac lavc \
         -lavcopts acodec=ac3:abitrate=192 -srate 48000 -af lavcresample=48000 \
         -of mpeg -ovc lavc \
         -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:\
         keyint=15:dc=10:vstrict=0 -vf scale=720:576,harddup -ofps 25

# Getting sound from first soundcard:
# Important :amode=1
src=":device=/dev/video0:input=1:alsa:adevice=hw.0,0:amode=1:volume=100"
resol=":width=720:height=576"
oa="-oac lavc -lavcopts acodec=ac3:abitrate=192 \
 -srate 48000 -af lavcresample=48000"
ov="-of mpeg -ovc lavc \
 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:keyint=15:dc=10:vstrict=0 \
 -vf scale=720:576,harddup \
 -ofps 25"
mencoder -tv driver=v4l2$src$resol tv:// -o test001.avi $o_a $o_v

VLC

VideoLAN Doc
# Play
# Sound from Audio card :v4l-adev=/dev/dsp
vlc v4l:// :v4l-vdev=/dev/video0 :v4l-channel=1 :v4l-norm=PAL :v4l-adev=/dev/dsp \
    :v4l-width=768 :v4l-height=576
# Save
vlc v4l:// :v4l-vdev=/dev/video0 :v4l-channel=1 :v4l-norm=PAL :v4l-adev=/dev/dsp \
    :v4l-width=768 :v4l-height=576 \
    --sout file/ps:stream.xyz
Save a stream with VLC - add to the command line the following argument:
--sout file/muxer:stream.xyz
    where:
    * muxer is one of the formats supported by VLC's stream output, i.e. :
          o ogg for OGG format,
          o ps MPEG2-PS format,
          o ts for MPEG2-PS format. 
    * and stream.xyz is the name of the file you want to save the stream to, with the right extension. 
Links
Detailed technical info: