Author Topic: Analog Capture Card Driver  (Read 6057 times)

bherbie

  • Veteran
  • ***
  • Posts: 54
    • View Profile
Analog Capture Card Driver
« on: June 27, 2013, 04:17:31 am »
I have recently come into possession of several PC based Security Camera DVRs and can't help but think they would make excellent cores for my next LMCE install.  I installed 1004 on one and everything works fine except the camera capture card (which works fine under windows).  It is an IDIS 16 channel audio/video card with a single BT878 chip and dmesg says it is a generic 4 port bttv card.  I have tried everything I could think of to make it work and have not found the solution so I am offering one of the DVB Cards with 16 port BNC back plane to anyone who thinks they might be able to write the driver for this piece of hardware or alter the current Linux bbtv drivers.

I can provide any information you need as well as access to a box one of the cards is currently running on...

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Analog Capture Card Driver
« Reply #1 on: June 27, 2013, 07:43:45 am »
Basically,

1. There needs to be a kernel module that can expose all 16 video ports to the system as /dev/videoX. If this can't be done, game over. Stop. Do Not Pass Go. Do not collect $200.

2. either the devices need to be funneled through Motion Wrapper, or a new driver needs to be written that can grab frames from these video devices. I do not like Motion, and I prefer entirely to have separate PIR motion sensors, which are much more accurate.

If there is to be a seperate driver, it needs to be able to respond to the Get Video Frame (DCE) command, This command is sent to any video camera, and it expects to receive a single JPEG image, which Orbiter will display in a given spot on the screen. You can see lots of examples of how this happens, and LMCE doesn't care where the image comes from, so long as it gets funneled back when asked.

There would be essentially two device templates, an Interface, and a video camera for each port. The video camera templates would be not much more than just placeholders for some port/channel information that the Interface would read and use to map the hardware ports.

The Interface's ReceivedCommandForChild() method would catch the Get Video Frame command, look at the message and see which camera device it was for, then grab that camera device's Device Data, which would tell it which port, etc..., grab the frame, and send it back in the reply.

-Thom

bherbie

  • Veteran
  • ***
  • Posts: 54
    • View Profile
Re: Analog Capture Card Driver
« Reply #2 on: June 27, 2013, 04:30:44 pm »
Thanks, Thom, I added the information I could find about the card into bttv-cards.c and recompiled the module and I can get each channel to show the blue overlay, which should mean that I am on the right track but just can't seem to get any video.  I agree with using PIR motion sensors so using motion isn't my overall goal.

Writing a separate driver might be the way to go... I just have never done that before...