Zoneminder and multichannel cards

Achilleas Mantzios achill at
Fri Oct 5 07:02:35 PDT 2007

Στις Παρασκευή 05 Οκτώβριος 2007 16:07, ο/η Mark Tinguely έγραψε:
> 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=20
> >  (LMLBT44), i can see that there are only 4
> >  instances of it (zmc) running=20
> >  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)=20 channels of a multiplexer board like LMLBT4M which utilizes only
> > one 878 ch= ip=20
> >  and supports 4 multiplexed channels i.e. 4 cameras?
> >
> >  If your answer is yes, then i should keep on trying with=20
> >  =46reeBSD/ZoneMinder/zmc, etc...
> >  Else i should buy 3 additional bt 878 cards, or switch to linux which i
> > wan= t=20
> >  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.

From what i see in the linux version of the zoneminder, in 

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) 
where c is
seems to work (as you had suggested some time ago).

When i tried to be sneaky and replaced the above 
ioctl(m_videohandle, TVTUNER_SETCHNL, &tmpchannel)
ioctl(m_videohandle, METEORSINPUT, &c) 

it didnt complain as a ioctl, but i got a strange (but rather expected effect)
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, 
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 choose
> 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.

Achilleas Mantzios

More information about the freebsd-multimedia mailing list