From owner-freebsd-multimedia@FreeBSD.ORG Fri Oct 5 14:02:35 2007 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A494416A417 for ; Fri, 5 Oct 2007 14:02:35 +0000 (UTC) (envelope-from achill@matrix.gatewaynet.com) Received: from smadev.internal.net (host3.dynacom.ondsl.gr [62.103.35.211]) by mx1.freebsd.org (Postfix) with ESMTP id EB63513C465 for ; Fri, 5 Oct 2007 14:02:34 +0000 (UTC) (envelope-from achill@matrix.gatewaynet.com) Received: from smadev.internal.net (localhost [127.0.0.1]) by smadev.internal.net (8.13.6/8.13.6) with ESMTP id l95E2LPK013611; Fri, 5 Oct 2007 17:02:21 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) Received: from localhost (localhost [[UNIX: localhost]]) by smadev.internal.net (8.13.6/8.13.6/Submit) id l95E2J1S013610; Fri, 5 Oct 2007 17:02:19 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) From: Achilleas Mantzios Organization: Dynacom Tankers Mgmt To: Mark Tinguely Date: Fri, 5 Oct 2007 17:02:19 +0300 User-Agent: KMail/1.9.3 References: <200710051307.l95D7leR059696@casselton.net> In-Reply-To: <200710051307.l95D7leR059696@casselton.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200710051702.19372.achill@matrix.gatewaynet.com> Cc: freebsd-multimedia@freebsd.org Subject: Re: Zoneminder and multichannel cards X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Oct 2007 14:02:35 -0000 =CE=A3=CF=84=CE=B9=CF=82 =CE=A0=CE=B1=CF=81=CE=B1=CF=83=CE=BA=CE=B5=CF=85= =CE=AE 05 =CE=9F=CE=BA=CF=84=CF=8E=CE=B2=CF=81=CE=B9=CE=BF=CF=82 2007 16:07= , =CE=BF/=CE=B7 Mark Tinguely =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > Achilleas Mantzios asks: > > I dont know if you are familiar with zoneminder, > > it has a capture daemon (zmc) which is used to grab the video. > > There are several clone simular to that card. > > > In the installation we have at work under linux, using a 4-chip board= =3D20 > > (LMLBT44), i can see that there are only 4 > > instances of it (zmc) running=3D20 > > on /dev/video0,/dev/video1,/dev/video2,/dev/video3 > > to capture all 8 cameras. > > This board supports 4 full rate inputs, or 8 multiplexed inputs. > > > > So for each one of the 4 chips, the corresponding zmc daemon is used > > to simultaneously capture both channels (cameras) of the same chip. > > > > Theoritically is that possible with FreeBSD's bktr driver? > > Could we have an app like lets say xawtv to display all (4 in my > > case)=3D20 channels of a multiplexer board like LMLBT4M which utilizes = only > > one 878 ch=3D ip=3D20 > > and supports 4 multiplexed channels i.e. 4 cameras? > > > > If your answer is yes, then i should keep on trying with=3D20 > > =3D46reeBSD/ZoneMinder/zmc, etc... > > Else i should buy 3 additional bt 878 cards, or switch to linux which i > > wan=3D t=3D20 > > to avoid! > > No matter the OS, a BT878 can capture from one video input AT ONE TIME. > > The LMLBT4M has only one BT878 video capture chip. A person can write > a program to capture images from up to 4 inputs using time division > multiplexing. I booted with linux and ZM works perfectly with multiplexed inputs. =46rom what i see in the linux version of the zoneminder, in=20 zm_local_camera.cpp:579 it does: if ( ioctl( m_videohandle, VIDIOCSCHAN, &vid_src ) < 0 ) { Error(( "Failed to set camera source %d: %s", channel, strerror(errno) )); return( -1 ); } I suppose the above is a service of the linux bttv driver, right? I.e. the bttv driver does the time division demultiplexing? I tried smth for the FreeBSD version (zm_fbsd_camera.cpp) if (ioctl(m_videohandle, TVTUNER_SETCHNL, &tmpchannel) < 0) { Error(( "Failed to set camera source %d: %s", tmpchannel, strerror(errno) = )); return( -1 ); } but i got "Inappropriate ioctl for device". However for single cameras (and testing with their input number) ioctl(m_videohandle, METEORSINPUT, &c)=20 where c is METEOR_DEV0, METEOR_DEV1, METEOR_DEV2, METEOR_DEV3 seems to work (as you had suggested some time ago). When i tried to be sneaky and replaced the above=20 ioctl(m_videohandle, TVTUNER_SETCHNL, &tmpchannel) with=20 ioctl(m_videohandle, METEORSINPUT, &c)=20 it didnt complain as a ioctl, but i got a strange (but rather expected effe= ct) of the video of one camera, inside the video of the 2nd camera. (i tested with only 2 cameras). So what i cant understand is: 1) How bktr understands about METEOR_DEV0, METEOR_DEV1, METEOR_DEV2,=20 METEOR_DEV3, how does it distinguish the 4 channels in LMLBT4M? 2) How could i arrange smth similar, provided its not very time consuming? ( i am trying to do all this at home hours, and they are extremely limited). If you could have an idea on how to (easily) programmatically demux the inputs, i'd be grateful. > > As you said there are cards with multiple BT878 that are either dedicated > to one input or allow multiple inputs. For example, the Kodicom 4400 (and > clones) have 4 BT878 capture chips and a crossbar that lets a person choo= se > from 16 inputs (on at a time per capture chip). I have a patch (see last > week's archive for thread) that sets up the crossbar on the Kodicom 4400. > There is also a Kodicom 8800 (and clones) with 8 BT878 capture chips which > I have not used. > > --Mark Tinguely. =2D-=20 Achilleas Mantzios