Menu

BTTV Support

Help
2002-11-18
2002-11-22
  • Seth Thornberry

    Seth Thornberry - 2002-11-18

    I've been using camserv for a while, but I thought I would try and switch over to camsource, because I like the modules in it are set up better.
    I can't seem to get it to serve any frames from my BTTV capture card (which does work w/ camserv) .. The log shows the request, and then a few seconds gets a "Closing connection from 192.168.1.1:2480, 0 frame(s) served"

    Any ideas?

    Also, feature request, is there any support for relays? Mainly I would like to relay from several other boxes on my LAN to my server, and serve out from there.

     
    • Richard Fuchs

      Richard Fuchs - 2002-11-18

      Do you know anything about technical requirements (on the application side) for working with the bttv driver? For example, does it need a certain input channel or something? Maybe can you show me the camserv config file you're using, and the output of camsource -c?

      As for relays, that's not directly supported, but it sounds like you can accomplish what you want by using a simple port forwarder, either by an ipchains/iptables entry, or a simple userspace forwarder. Even a combination of inetd and netcat can do that.

       
    • Seth Thornberry

      Seth Thornberry - 2002-11-18

      I don't know much about it -- I believe that the BTTV was the basis for a lot of the V4L code though, if I remember correctly. It does need a certain input channel, but I get the same results no matter what channel I put in. Here is my camserv configuration (very much just the default config w/ the channel altered):
      # video_v4l_bttv:  Example of a common BTTV module for video4linux.
      # port 0 == TV, port 1 = Composite 1, port 2 = Composite 2
      # frequency == is the channel frequency for the TV
      # autobright == 0 turns off autobrightness adjusting, otherwise it adjusts
      #               the brightness of the picture every 'autobright' frames.
      # brightmean == The mean pixel value that is the 'goal' of the autobright.
      #               (0->255)
      # brightx1->y2 == (x1,y1) top left coords, and (x2,y2) bottom right coords
      #                 of a rectangle of which to take the average pixel value.
      #                 this is then used in calculating the mean to adjust the
      #                 brightness of the image.
      # mode == the video norm to use:  0 == PAL, 1 == NTSC, 2 == SECAM, 3 == AUTO
      # color,hue,contrast,brightness,whiteness = 0->60000, representing
      # the value of each component.

      [video_v4l_bttv]
      path            /usr/local/lib/camserv/libvideo_v4l.so.0
      device_path     /dev/video0
      port            1
      mode            3
      #frequency      74.43
      color           30000
      hue             30000
      contrast        30000
      brightness      30000
      whiteness       30000
      autobright      1
      brightmean      128
      brightx1        0
      brighty1        320
      brightx2        0
      brighty2        240

      and here is the camsource -c output:
      Capability info for /dev/video0:
        Name: BT848A( *** UNKNOWN/GENERIC **)
          Can capture to memory
          Has a tuner
          Cannot receive teletext
          Overlay is not chromakeyed
          Overlay clipping is supported
          Overlay overwrites frame buffer mem
          Hardware image scaling supported
          Captures in color
          Can capture the complete image
        Number of channels: 4
        Number of audio devices: 1
        Grabbing frame size:
          Min: 48x32
          Max: 640x576

      Palette information:
        Currenctly active palette: grayscale (8 bpp) with depth 8
        Probing for supported palettes:
          Palette "bgr24" supported: Yes, with depth 24
          Palette "rgb24" supported: No
          Palette "bgr32" supported: Yes, with depth 32
          Palette "rgb32" supported: No
          Palette "yuyv (16 bpp)" supported: Yes, with depth 24
          Palette "yuv422 (16 bpp)" supported: Yes, with depth 24
          Palette "rgb565" supported: Yes, with depth 16
          Palette "rgb555" supported: Yes, with depth 15
          Palette "yuv420 planar (12 bpp)" supported: Yes, with depth 24
          Palette "yuv420 (12 bpp)" supported: Yes, with depth 24
          Palette "grayscale (8 bpp)" supported: Yes, with depth 8

      And I forgot to mention in my initial post (that's what I get for trying to post after a hockey game) that I could only get Camsource to run after commenting out the <fps> setting.

      And the relay feature I'm thinking of, is actually a little different that a port forward. Camserv will allow (I think) a single source stream from the source, and then the relay handles all the 'extra' connections from multiple hosts. Somehow the relay duplicates the stream for multiple connections.

      Thanks for the quick reply!

       
      • Richard Fuchs

        Richard Fuchs - 2002-11-18

        I've looked at the camserv sources some, and I'm thinking it could be one of two things: The first is that camserv uses mmap() while camsource uses read(). I don't think that any driver wouldn't support read() while supporting mmap() (usually it's the other way around), but everything's possible. The second thing is that the channel selection code in camsource could be buggy or not complete (I have no way of testing that). Anyway, I'm gonna make a patch that tries to fix those two issues and send it to you if that's ok with you.

         
        • Richard Fuchs

          Richard Fuchs - 2002-11-19

          Patch mailed to your sourceforge email account. It's also available at http://camsource.sf.net/camsource-mmap.patch

           
    • Seth Thornberry

      Seth Thornberry - 2002-11-22

      Thanks, I think that patch worked. I am getting images now, but they are garbled. I think that it has something to do with the height/width settings, as changing these around seemed to alter the way it garbles(Is that a word?) the image.

      Also, if I change the FPS setting to anything besides default, I get an error and camsource will not start.

       
      • Richard Fuchs

        Richard Fuchs - 2002-11-22

        Check out the output of camsource -c, look for the max width/height settings. It's also possible that something else garbles the images, maybe you can post a screenshot or something if you can't get it to work.

        As for the fps setting, that kinda has to be expected. The fps setting is a non-standard extension to the vid4lin api and not all drivers support it, and those that don't may or may not barf upon receiving one. Maybe I should put this fact into the docs (example config) more clearly.

        And as for the relays, I know about the feature you describe from (I think) camserv. I wasn't aware of the fact that this is what you needed. Currently this is not possible with camsource, but it's definitely something on my todo list.

         
    • Seth Thornberry

      Seth Thornberry - 2002-11-22

      I tried setting it to the max from camsource -c and I also tried setting it to 'min' but I still didn't get much clearer. You can take a look at it at http://chaos.doesntexist.com/~cam/

      As for the relay, I was thinking a little more about it, and I wondered if the grabber portion is also modularized. So maybe one could make a module that grabs from a file, or a url, or stream source. Dunno, just an idea. CamSource is such an improvement to camserv, I really appreciate the work you've put into it. Thanks!

       

Log in to post a comment.

MongoDB Logo MongoDB