xawtv and channels on bt878

A place for discussion of topics that are not specific to ZoneMinder. This could include Linux, Video4Linux, CCTV cameras or any other topic.
yavan
Posts: 11
Joined: Tue Oct 23, 2007 10:49 pm
Location: IL

xawtv and channels on bt878

Post by yavan »

Hi, i have zm up and running the way i want it, but i need to be able to see real time stream from my cameras on the gui desktop.

i was thinking to use xawtv but here is my problem:
xawtv or kdetv scannes all the channels of my bt878 very fast in a loop and i can not get to either
1. make it scan very slow for i.e 30sec each channel, so it like changes between cameras each interval of time
2. have 4 instances of xawtv and make each one of them show only one channel. so i end with 4 open windows of xawtv

user@linux-102:~> xawtv4 -hwconfig
This is xawtv 4.0-pre, running on Linux/i686 (2.6.18.2-34-default)

device configuration "BT878 video (ProVideo PV143)":
bus = PCI:0000:00:0a.0
video = /dev/video0
vbi = /dev/vbi0
dvb = [unset]
sndrec = [unset, using default]
sndplay = [unset, using default]
mixer = [unset, using default]
control = [unset]

device configuration "xv port: 65 (video4linux)":
bus = [unset]
video = port:65
vbi = [unset]
dvb = [unset]
sndrec = [unset, using default]
sndplay = [unset, using default]
mixer = [unset, using default]
control = [unset]

any tips on how to solve the problem are welcome
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

A bt878 chip can only view one input of it's four at a time, ZM works by scanning the imputs and taking a capture of each image, on each pass. If you affect the way ZM scans the card, you affect your recorded images as well.

Use shmlib which is a third party app to view cameras in ZM on the same machine.

{EDIT] Link Fix
Last edited by cordel on Sun Oct 28, 2007 3:57 am, edited 1 time in total.
yavan
Posts: 11
Joined: Tue Oct 23, 2007 10:49 pm
Location: IL

Post by yavan »

thanks for the explanation, i have downloaded it but can not find any INSTALL document on how to install it
do i have to compile it with configure > make > make install ?
what are my dependencies GCC ver, x11 etc ?
yavan
Posts: 11
Joined: Tue Oct 23, 2007 10:49 pm
Location: IL

Post by yavan »

this is what i get when i am trying to run xlib_shm:
linux-102:/home/user/Documents/xlib_shm-0.6.3 # ./xlib_shm
./xlib_shm: error while loading shared libraries: libmysqlclient.so.12: cannot open shared object file: No such file o

and this is what i have installed:
linux-102:/home/user/Documents/xlib_shm-0.6.3 # locate mysqlclient
/usr/lib/libmysqlclient_r.so.15
/usr/lib/libmysqlclient_r.so.15.0.0
/usr/lib/libmysqlclient.so.15
/usr/lib/libmysqlclient.so.15.0.0
/usr/lib/mysql/libmysqlclient_r.so.15
/usr/lib/mysql/libmysqlclient_r.so.15.0.0
/usr/lib/mysql/libmysqlclient.so.15
/usr/lib/mysql/libmysqlclient.so.15.0.0

any idea what do i have to do in order to be able to run the xlib_shm ?
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Post by Lee Sharp »

The compiled version on his website is old, and compiled against an old mysql client. I was able to get it working on Edgy by installing libmysqlclient.so.12 but by Feisty that would no longer work. You will need to compile it yourself against your system if that is the case for you.
yavan
Posts: 11
Joined: Tue Oct 23, 2007 10:49 pm
Location: IL

Post by yavan »

ok i have recompile xlib_shm on my open suse 10.2 i586 box
and this is what i get:

linux-102:/home/user/Documents/xlib_shm-0.6.3 # make clean
rm -f *.o *.core xlib_shm
linux-102:/home/user/Documents/xlib_shm-0.6.3 # make
gcc -c xlib_shm.c -I/usr/X11R6/include
gcc xlib_shm.o -L/usr/X11R6/lib -lXv -lXext -lX11 -lmysqlclient -Wl,-rpath=/usr/X11R6/lib -o xlib_shm
linux-102:/home/user/Documents/xlib_shm-0.6.3 # ./xlib_shm -m 1
xlib_shm viewer for zm 1.22.3 version 0.6.3
Can't open /usr/local/etc/zm.confSegmentation fault

whats wrong ?
yavan
Posts: 11
Joined: Tue Oct 23, 2007 10:49 pm
Location: IL

Post by yavan »

ok i kind of resolved the problem
i did not have /usr/local/etc/zm.conf
so i try creating ln -s zm.conf /usr/local/etc/zm.conf
but it did not work for me :(
so i just cp zm.conf /usr/local/etc/

and it works :)

but now i see it B/W with lines and the stream is at the same speed as the mozilla montage feature

how to progress from here ?
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Post by Lee Sharp »

What kind of hardware are you on?
yavan
Posts: 11
Joined: Tue Oct 23, 2007 10:49 pm
Location: IL

Post by yavan »

Code: Select all

linux-102:/home/user/Documents/xlib_shm-0.6.3 # lspci
00:00.0 Host bridge: VIA Technologies, Inc. VT8753 [P4X266 AGP] (rev 01)
00:01.0 PCI bridge: VIA Technologies, Inc. VT8633 [Apollo Pro266 AGP]
00:0a.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
00:0a.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
00:0c.0 Ethernet controller: Intel Corporation 82557/8/9 [Ethernet Pro 100] (rev 08)
00:11.0 ISA bridge: VIA Technologies, Inc. VT8233 PCI to ISA Bridge
00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)
00:11.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 1b)
00:11.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 1b)
00:11.4 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 1b)
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 30)
01:00.0 VGA compatible controller: nVidia Corporation NV5M64 [RIVA TNT2 Model 64/Model 64 Pro] (rev 15)
linux-102:/home/user/Documents/xlib_shm-0.6.3 # free
             total       used       free     shared    buffers     cached
Mem:        516220     494552      21668          0      42224     108736
-/+ buffers/cache:     343592     172628
Swap:      1052216     103128     949088
linux-102:/home/user/Documents/xlib_shm-0.6.3 # uname -a
Linux linux-102 2.6.18.2-34-default #1 SMP Mon Nov 27 11:46:27 UTC 2006 i686 i686 i386 GNU/Linux
Last edited by yavan on Fri Oct 26, 2007 11:00 am, edited 1 time in total.
yavan
Posts: 11
Joined: Tue Oct 23, 2007 10:49 pm
Location: IL

Post by yavan »

Code: Select all

linux-102:/home/user/Documents/xlib_shm-0.6.3 # xvinfo
X-Video Extension version 2.2
screen #0
  Adaptor #0: "video4linux"
    number of ports: 1
    port base: 65
    operations supported: PutVideo
    supported visuals:
      depth 24, visualID 0x23
      depth 24, visualID 0x24
      depth 24, visualID 0x25
      depth 24, visualID 0x26
    number of attributes: 7
      "XV_ENCODING" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_BRIGHTNESS" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_CONTRAST" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_SATURATION" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_HUE" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_MUTE" (range 0 to 1)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_FREQ" (range 0 to 16000)
              client settable attribute
              client gettable attribute (current value is 0)
    number of encodings: 28
      encoding ID #0: "PAL-composite0"
        size: 768 x 576
        rate: 0.020000
      encoding ID #1: "NTSC-composite0"
        size: 640 x 480
        rate: 0.016683
      encoding ID #2: "SECAM-composite0"
        size: 768 x 576
        rate: 0.020000
      encoding ID #3: "PAL-Nc-composite0"
        size: 640 x 576
        rate: 0.020000
      encoding ID #4: "PAL-M-composite0"
        size: 640 x 576
        rate: 0.020000
      encoding ID #5: "PAL-N-composite0"
        size: 768 x 576
        rate: 0.020000
      encoding ID #6: "NTSC-JP-composite0"
        size: 640 x 480
        rate: 0.016683
      encoding ID #7: "PAL-composite1"
        size: 768 x 576
        rate: 0.020000
      encoding ID #8: "NTSC-composite1"
        size: 640 x 480
        rate: 0.016683
      encoding ID #9: "SECAM-composite1"
        size: 768 x 576
        rate: 0.020000
      encoding ID #10: "PAL-Nc-composite1"
        size: 640 x 576
        rate: 0.020000
      encoding ID #11: "PAL-M-composite1"
        size: 640 x 576
        rate: 0.020000
      encoding ID #12: "PAL-N-composite1"
        size: 768 x 576
        rate: 0.020000
      encoding ID #13: "NTSC-JP-composite1"
        size: 640 x 480
        rate: 0.016683
      encoding ID #14: "PAL-composite2"
        size: 768 x 576
        rate: 0.020000
      encoding ID #15: "NTSC-composite2"
        size: 640 x 480
        rate: 0.016683
      encoding ID #16: "SECAM-composite2"
        size: 768 x 576
        rate: 0.020000
      encoding ID #17: "PAL-Nc-composite2"
        size: 640 x 576
        rate: 0.020000
      encoding ID #18: "PAL-M-composite2"
        size: 640 x 576
        rate: 0.020000
      encoding ID #19: "PAL-N-composite2"
        size: 768 x 576
        rate: 0.020000
      encoding ID #20: "NTSC-JP-composite2"
        size: 640 x 480
        rate: 0.016683
      encoding ID #21: "PAL-composite3"
        size: 768 x 576
        rate: 0.020000
      encoding ID #22: "NTSC-composite3"
        size: 640 x 480
        rate: 0.016683
      encoding ID #23: "SECAM-composite3"
        size: 768 x 576
        rate: 0.020000
      encoding ID #24: "PAL-Nc-composite3"
        size: 640 x 576
        rate: 0.020000
      encoding ID #25: "PAL-M-composite3"
        size: 640 x 576
        rate: 0.020000
      encoding ID #26: "PAL-N-composite3"
        size: 768 x 576
        rate: 0.020000
      encoding ID #27: "NTSC-JP-composite3"
        size: 640 x 480
        rate: 0.016683
  Adaptor #1: "NV Video Blitter"
    number of ports: 32
    port base: 66
    operations supported: PutImage
    supported visuals:
      depth 24, visualID 0x23
      depth 24, visualID 0x24
      depth 24, visualID 0x25
      depth 24, visualID 0x26
      depth 24, visualID 0x27
      depth 24, visualID 0x28
      depth 24, visualID 0x29
      depth 24, visualID 0x2a
    no port attributes defined
    maximum XvImage size: 2046 x 2046
    Number of image formats: 5
      id: 0x32595559 (YUY2)
        guid: 59555932-0000-0010-8000-00aa00389b71
        bits per pixel: 16
        number of planes: 1
        type: YUV (packed)
      id: 0x32315659 (YV12)
        guid: 59563132-0000-0010-8000-00aa00389b71
        bits per pixel: 12
        number of planes: 3
        type: YUV (planar)
      id: 0x59565955 (UYVY)
        guid: 55595659-0000-0010-8000-00aa00389b71
        bits per pixel: 16
        number of planes: 1
        type: YUV (packed)
      id: 0x30323449 (I420)
        guid: 49343230-0000-0010-8000-00aa00389b71
        bits per pixel: 12
        number of planes: 3
        type: YUV (planar)
      id: 0x3
        guid: 03000000-0000-0010-8000-00aa00389b71
        bits per pixel: 32
        number of planes: 1
        type: RGB (packed)
        depth: 24
        red, green, blue masks: 0xff0000, 0xff00, 0xff
if more info regarding my hardware is required please let me know
again my problem now is that i see the stream form the cameras (2) in B/W and with lines across the picture
this is how it looks:
[img]
http://picasaweb.google.com/yavan22/Zon ... 2516048018
[/img]
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Post by Lee Sharp »

During this time you can see clear streams from a browser on another system, correct? In other words, yous ZM install is functioning? If so, you are out of my realm of knowledge. I just played with xlib-shm. Never got to know it that well.
yavan
Posts: 11
Joined: Tue Oct 23, 2007 10:49 pm
Location: IL

Post by yavan »

how do i check i have support for vga adapter in xvideo rgb 32 ?
muzyk10
Posts: 6
Joined: Mon Apr 10, 2006 2:46 pm
Location: Poland

Post by muzyk10 »

are U using autodetect modprobe for bt878 or maybe it is 77 setting?
If autodetect try this 77 (shuld be /etc/modprobe.conf or similar, dont know Suse)
yavan
Posts: 11
Joined: Tue Oct 23, 2007 10:49 pm
Location: IL

Post by yavan »

the card was autodetected by SuSe so i asume it is autodetected i will try to change the setting manually
and check it out, you are correct regarding the path.
just for my knowledge what is the difference ?

one more question do i have to see a line in my xorg.conf file regarding xvideo enabled and rgb32 ?
because i do not see one
yavan
Posts: 11
Joined: Tue Oct 23, 2007 10:49 pm
Location: IL

Post by yavan »

this is what i have found within modpobe.conf regarding bttv:
# options bttv pll=1 radio=0 card=0
# options tuner type=0
# options msp3400 once=1 simple=1

# install bttv /sbin/modprobe --ignore-install bttv && { /sbin/modprobe -k tuner; /sbin/modprobe -k msp3400; }
#

what do i have to change here ?

also this is my dmesg | grep bttv
linux-102:/etc # dmesg | grep bttv
bttv: driver version 0.9.16 loaded
bttv: using 8 buffers with 2080k (520 pages) each for capture
bttv: Bt8xx card found (0).
bttv0: Bt878 (rev 17) at 0000:00:0a.0, irq: 5, latency: 32, mmio: 0xe9101000
bttv0: detected: Provideo PV143A [card=105], PCI subsystem ID is aa00:1430
bttv0: using: ProVideo PV143 [card=105,autodetected]
bttv0: gpio: en=00000000, out=00000000 in=00ffffff [init]
bttv0: using tuner=-1
bttv0: i2c: checking for TDA9875 @ 0xb0... not found
bttv0: i2c: checking for TDA7432 @ 0x8a... not found
bttv0: i2c: checking for TDA9887 @ 0x86... not found
bttv0: registered device video0
bttv0: registered device vbi0
bttv0: PLL: 28636363 => 35468950 .<6>usbcore: registered new driver usbfs

are this settings correct ?
Post Reply