Linux Webcam Monitoring BTTV & Philips Webcam: differenze tra le versioni
(→Introduzione) |
(→BTTV con GNU/LINUX) |
||
| Riga 14: | Riga 14: | ||
= BTTV con GNU/LINUX = |
= BTTV con GNU/LINUX = |
||
| + | Dal punto di vista del sistema sono necessari alcuni moduli per il coretto supporto della scheda e della webcam, |
||
| + | sono: |
||
| + | |||
| + | #sotto character device |
||
| + | i2c.o |
||
| + | i2c-algo-bit |
||
| + | i2c-core |
||
| + | |||
| + | #sotto multimedia |
||
| + | videodev.o |
||
| + | bttv.o |
||
| + | tuner.o |
||
| + | |||
== Configurazione dl kernel == |
== Configurazione dl kernel == |
||
| + | # |
||
| + | #multimedia devices |
||
| + | # |
||
| + | CONFIG_VIDEO_DEV=m |
||
| + | # |
||
| + | #video for linux |
||
| + | # |
||
| + | CONFIG_VIDEO_BT848=m |
||
| + | |||
| + | # |
||
| + | i2C support |
||
| + | # |
||
| + | CONFIG_I2C=m |
||
| + | CONFIG_I2C_ALGOBIT=m |
||
| + | CONFIG_I2C_ALGOPCF=m |
||
| + | CONFIG_I2C_PROC=m |
||
| + | |||
| + | Aggiungere nel file rc.modules |
||
| + | |||
| + | #per webcam |
||
| + | modprobe i2c |
||
| + | modprobe i2c-algo-bit |
||
| + | modprobe i2c-core |
||
| + | modprobe tuner |
||
| + | modprobe bttv |
||
| + | |||
| + | una volta ricompilato il kernel e riavviato il sistema, dovremmo avere una situazione di questo tipo |
||
| + | |||
| + | #lsmod |
||
| + | Module Size Used by Not tainted |
||
| + | tuner 10272 0 (unused) |
||
| + | bttv 98720 1 |
||
| + | i2c-algo-bit 6984 1 [bttv] |
||
| + | i2c-core 12900 0 [tuner bttv i2c-algobit] |
||
| + | soundcore 3332 0 [bttv] |
||
| + | videodev 6080 4 [usbvideo bttv] |
||
| + | |||
| + | In realtà il mio test si è svolto utilizzando una Slackware 9.1, che di default riconosce la scheda e non |
||
| + | richiede ricompilazioni di alcun tipo. basta un ''dmesg'' per verificarlo: |
||
| + | |||
| + | bttv: driver version 0.7.107 loaded |
||
| + | bttv: using 4 buffers with 2080k (8320k total) for capture |
||
| + | bttv: Host bridge is Silicon Integrated Systems [SiS] 650 Host |
||
| + | bttv: Bt8xx card found (0) |
||
| + | PCI: Found IRQ 3 for device 00:10.0 |
||
| + | bttv0: Bt848 (rev 18) at 00:10.0, irq 3, latency: 32, mmio: 0xef000000 |
||
| + | bttv: using: BT848(*** UNKNOWN/GENERIC **) [card=0,autodetected] |
||
| + | i2c-core.0: adapter bt848 #0 registered as adapter 0 |
||
| + | bttv0: registered device video0 |
||
| + | bttv0: registered device vbi0 |
||
| + | |||
== Il comando dov4l == |
== Il comando dov4l == |
||
| + | per poter affettuare un test (dump) più approfondito del nostro dispositivo si può utilizzare ''dov4l'' |
||
| + | |||
| + | ./dov4l -h<nowiki> |
||
| + | dov4l v0.5, (c) 2003 by folkert@vanheusden.com |
||
| + | d device device to use (default is /dev/video0) |
||
| + | q query capabilities |
||
| + | i channel set input-channel |
||
| + | t tuner set tuner (most of the time 0) |
||
| + | m mode mode (PAL/NTSC/SECAM/AUTO) |
||
| + | f frequency set frequency |
||
| + | b brightness set brightness |
||
| + | u hue set hue |
||
| + | c color set color |
||
| + | n contrast set contrast |
||
| + | w whiteness set whiteness |
||
| + | s width,height set size </nowiki> |
||
| + | |||
| + | |||
| + | Con questo utile programma possiamo anche agire sul setup del device cambiando alcuni parametri, |
||
| + | come quelli mostrati dall'help del comando. |
||
| + | |||
| + | per effettuare una query sul device: |
||
| + | |||
| + | ./dov4l -q -d /dev/video0 |
||
| + | Canonical name for this interface: BT848A( *** UNKNOWN/GENERIC **) |
||
| + | Type of interface: |
||
| + | Can capture to memory |
||
| + | Has a tuner of some form |
||
| + | Can overlay its image onto the frame buffer |
||
| + | Overlay clipping is supported |
||
| + | Overlay overwrites frame buffer memory |
||
| + | The hardware supports image scaling |
||
| + | Number of radio/tv channels if appropriate: 4 |
||
| + | Number of audio devices if appropriate: 1 |
||
| + | Maximum capture width in pixels: 768 |
||
| + | Maximum capture height in pixels: 480 |
||
| + | Minimum capture width in pixels: 48 |
||
| + | Minimum capture height in pixels: 32 |
||
| + | Image size (x,y): 640, 480 |
||
| + | The channel number: 0 |
||
| + | The input name: Television |
||
| + | Number of tuners for this input: 1 |
||
| + | Channel has tuners |
||
| + | Channel has audios |
||
| + | The input is a TV input |
||
| + | The norm for this channel: 1 |
||
| + | Number of the tuner: 0 |
||
| + | Canonical name for this tuner: Television |
||
| + | Lowest tunable frequency: 0 |
||
| + | Highest tunable frequency: -1 |
||
| + | Current frequency: 4095MHz |
||
| + | Flags describing the tuner: |
||
| + | PAL tuning is supported |
||
| + | NTSC tuning is supported |
||
| + | SECAM tuning is supported |
||
| + | Frequency is in a higher range (tuning frequencies are in 1/16th MHz) |
||
| + | The video signal mode if relevant: |
||
| + | The tuner is in NTSC mode |
||
| + | The tuner auto switches, or mode does not apply |
||
| + | Signal strength if known: 65535 |
||
| + | The channel number: 1 |
||
| + | The input name: Composite1 |
||
| + | Number of tuners for this input: 0 |
||
| + | Channel has audios |
||
| + | The input is a camera |
||
| + | The norm for this channel: 1 |
||
| + | The channel number: 2 |
||
| + | The input name: S-Video |
||
| + | Number of tuners for this input: 0 |
||
| + | Channel has audios |
||
| + | The input is a camera |
||
| + | The norm for this channel: 1 |
||
| + | The channel number: 3 |
||
| + | The input name: Composite3 |
||
| + | Number of tuners for this input: 0 |
||
| + | Channel has audios |
||
| + | The input is a camera |
||
| + | The norm for this channel: 1 |
||
| + | Brightness: 36890 |
||
| + | Hue: 28222 |
||
| + | Colour: 32512 |
||
| + | Contrast: 31019 |
||
| + | Whiteness: 0 |
||
| + | Depth: 16 |
||
| + | Palette: RGB565 packed into 16 bit words. |
||
| + | |||
== Il comando setv4l == |
== Il comando setv4l == |
||
| + | Un pò più semplice ma più intuitivo per il setup della videocamera setv4l |
||
| + | # ./setv4l /dev/video0 |
||
| + | device: /dev/video0 name: bttv video |
||
| + | capabilities: CAPTURE TUNER OVERLAY CLIPPING FRAMERAM SCALES |
||
| + | min-size: 48x32 max-size: 768x480 channels: 4 audios: 1 |
||
| + | brightness: 32768 hue: 32768 colour: 32512 contrast: 27648 |
||
| + | whiteness: 0 depth: 16 palette: 3 |
||
| + | |||
| + | A questo punto per poter utilizzare la webcam consiglio di puntare su due software che sono |
||
| + | Xawtv (e gli altri programmi a corredo) per la visualizzazione delle immagini e Motion per |
||
| + | effettuare una vera e propria videosorveglianza. |
||
| + | Vediamo in modo sintetico come utilizzare questi software con la nostra webcam, per un |
||
| + | approfondimento rimando alla consultazione dell'HOWTO già pubblicato: |
||
| + | |||
| + | http://www.sistemistiindipendenti.org/modules/news/article.php?storyid=100 |
||
| + | |||
= Installazione e utilizzo di Xawtv = |
= Installazione e utilizzo di Xawtv = |
||
= Installazione e utilizzo di Motion = |
= Installazione e utilizzo di Motion = |
||
Versione delle 22:13, 8 nov 2006
Indice |
Introduzione
Le webcam oggi presenti sul mercato, almeno quelle di livello home user sono tutte USB. Queste facilita l'utilizzo sotto diversi dispositivi ma spesso ne limita le potenzialità. Utilizzare una scheda di aquisizione PCI ed una videocamera collegata con segnale composito rappresenta sicuramente (almeno nel mio caso) una soluzione più affidabile e prestante.
La scheda utilizzata è una brooktree coorporation Bt848 Video Capture (Bt848KPF - CPH02-B) mentre la webcam in dotazione è una webcam philps, collegata con un cavo per il segnale video composito.
#lspci 00:10.0 Multimedia Video controller: Brooktree Coorporation Bt848 Video Capture (rev 12)
BTTV con GNU/LINUX
Dal punto di vista del sistema sono necessari alcuni moduli per il coretto supporto della scheda e della webcam, sono:
#sotto character device i2c.o i2c-algo-bit i2c-core
#sotto multimedia videodev.o bttv.o tuner.o
Configurazione dl kernel
# #multimedia devices # CONFIG_VIDEO_DEV=m # #video for linux # CONFIG_VIDEO_BT848=m
# i2C support # CONFIG_I2C=m CONFIG_I2C_ALGOBIT=m CONFIG_I2C_ALGOPCF=m CONFIG_I2C_PROC=m
Aggiungere nel file rc.modules
#per webcam modprobe i2c modprobe i2c-algo-bit modprobe i2c-core modprobe tuner modprobe bttv
una volta ricompilato il kernel e riavviato il sistema, dovremmo avere una situazione di questo tipo
#lsmod Module Size Used by Not tainted tuner 10272 0 (unused) bttv 98720 1 i2c-algo-bit 6984 1 [bttv] i2c-core 12900 0 [tuner bttv i2c-algobit] soundcore 3332 0 [bttv] videodev 6080 4 [usbvideo bttv]
In realtà il mio test si è svolto utilizzando una Slackware 9.1, che di default riconosce la scheda e non richiede ricompilazioni di alcun tipo. basta un dmesg per verificarlo:
bttv: driver version 0.7.107 loaded bttv: using 4 buffers with 2080k (8320k total) for capture bttv: Host bridge is Silicon Integrated Systems [SiS] 650 Host bttv: Bt8xx card found (0) PCI: Found IRQ 3 for device 00:10.0 bttv0: Bt848 (rev 18) at 00:10.0, irq 3, latency: 32, mmio: 0xef000000 bttv: using: BT848(*** UNKNOWN/GENERIC **) [card=0,autodetected] i2c-core.0: adapter bt848 #0 registered as adapter 0 bttv0: registered device video0 bttv0: registered device vbi0
Il comando dov4l
per poter affettuare un test (dump) più approfondito del nostro dispositivo si può utilizzare dov4l
./dov4l -h dov4l v0.5, (c) 2003 by folkert@vanheusden.com d device device to use (default is /dev/video0) q query capabilities i channel set input-channel t tuner set tuner (most of the time 0) m mode mode (PAL/NTSC/SECAM/AUTO) f frequency set frequency b brightness set brightness u hue set hue c color set color n contrast set contrast w whiteness set whiteness s width,height set size
Con questo utile programma possiamo anche agire sul setup del device cambiando alcuni parametri, come quelli mostrati dall'help del comando.
per effettuare una query sul device:
./dov4l -q -d /dev/video0 Canonical name for this interface: BT848A( *** UNKNOWN/GENERIC **) Type of interface: Can capture to memory Has a tuner of some form Can overlay its image onto the frame buffer Overlay clipping is supported Overlay overwrites frame buffer memory The hardware supports image scaling Number of radio/tv channels if appropriate: 4 Number of audio devices if appropriate: 1 Maximum capture width in pixels: 768 Maximum capture height in pixels: 480 Minimum capture width in pixels: 48 Minimum capture height in pixels: 32 Image size (x,y): 640, 480 The channel number: 0 The input name: Television Number of tuners for this input: 1 Channel has tuners Channel has audios The input is a TV input The norm for this channel: 1 Number of the tuner: 0 Canonical name for this tuner: Television Lowest tunable frequency: 0 Highest tunable frequency: -1 Current frequency: 4095MHz Flags describing the tuner: PAL tuning is supported NTSC tuning is supported SECAM tuning is supported Frequency is in a higher range (tuning frequencies are in 1/16th MHz) The video signal mode if relevant: The tuner is in NTSC mode The tuner auto switches, or mode does not apply Signal strength if known: 65535 The channel number: 1 The input name: Composite1 Number of tuners for this input: 0 Channel has audios The input is a camera The norm for this channel: 1 The channel number: 2 The input name: S-Video Number of tuners for this input: 0 Channel has audios The input is a camera The norm for this channel: 1 The channel number: 3 The input name: Composite3 Number of tuners for this input: 0 Channel has audios The input is a camera The norm for this channel: 1 Brightness: 36890 Hue: 28222 Colour: 32512 Contrast: 31019 Whiteness: 0 Depth: 16 Palette: RGB565 packed into 16 bit words.
Il comando setv4l
Un pò più semplice ma più intuitivo per il setup della videocamera setv4l
# ./setv4l /dev/video0 device: /dev/video0 name: bttv video capabilities: CAPTURE TUNER OVERLAY CLIPPING FRAMERAM SCALES min-size: 48x32 max-size: 768x480 channels: 4 audios: 1 brightness: 32768 hue: 32768 colour: 32512 contrast: 27648 whiteness: 0 depth: 16 palette: 3
A questo punto per poter utilizzare la webcam consiglio di puntare su due software che sono Xawtv (e gli altri programmi a corredo) per la visualizzazione delle immagini e Motion per effettuare una vera e propria videosorveglianza. Vediamo in modo sintetico come utilizzare questi software con la nostra webcam, per un approfondimento rimando alla consultazione dell'HOWTO già pubblicato:
http://www.sistemistiindipendenti.org/modules/news/article.php?storyid=100