Menu

Feature Req: Multiple Inputs/external trigger

2003-01-13
2003-01-15
  • Seth Thornberry

    Seth Thornberry - 2003-01-13

    My webcam site is really shaping up. Thanks for all the work you've put into this program.

    My feature request is for multiple input devices. I'd like to be able to define /dev/video0, /dev/video1, /dev/videoX etc.. within a single config file and then access them with the virtual file paths like http://server:9192/cam1 http://server:9192/cam2 etc..
    I'm currently getting around this by running multple instances of camsource with different configuration files on different ports, but it seems with the modular configuration that it might be possible to define video device sources from one instance.

    My other feature request is for some kind of module that will let you execute an external program whenever a connection is opened/closed to the webcam. Currently I have a cgi script that runs when someone goes to the live page, that uses an X10 control program to flash an X10 light that I have hooked up. Just kind of a notification whenever someone is watching the webcam. The problem is that this way doesn't keep track of when they leave, so it only flashes a bit when they hit the webpage, and that is it. Ideally I'd like to be able to call something like 'turn on light' when someone hits the webcam and 'turn off light' when they disconnect. But I can see applications for this for a lot of things.

    Really like the software! Thanks for all your work!

     
    • Richard Fuchs

      Richard Fuchs - 2003-01-13

      As for the multiple inputs, I think that should be possible without too much work (yes I'm lazy). With a little bit of xml magic and some supporting code, it should be possible to start multiple grabbing threads, and then let the module configs specify which device to access in a transparent way. I'll look into that.

      Starting an external program is no problem by itself. However, for your application, you'll run into a problem when two or more people are accessing the device at the same time. You would get two "light on" events, and then two "light off events", meaning the light would go off when the first person disconnects but while the second person is still watching. The part of the code that handles incoming connections and the spawning of the handling threads doesn't know about how many other connections are open, so currently there's no easy way to have a real on-off-on-off event chain. What are your thoughts on this?

       
      • Seth Thornberry

        Seth Thornberry - 2003-01-14

        Multi Inputs: That's great. It would really simplify a lot of the stuff that I'm doing right now. And you obviously aren't lazy, or you wouldn't be so supportive in this forum!

        External trigger: I had thought of the on/off stuff mixing before, I just hadn't figured it would matter too much in my case, as my site very low traffic anyway. I got the idea from looking at the log file -- the way that it reports 'open from this address'/'closed from this address', surely if you could pass the address to the external program, it wouldn't be too hard to write some kind of billboard script to track which connections were currently still open. I'd be willing to create some php/perl code to handle that kind of thing if there was a module that could define the external program to run and pass it some information like ip address, frames etc.

         
        • Richard Fuchs

          Richard Fuchs - 2003-01-14

          Ah yes, passing ip address plus port should do the trick. With that you can match off events to their on events. Good idea, I'll see what I can do.

           
          • Richard Fuchs

            Richard Fuchs - 2003-01-14

            Multiple inputs is done, the other thing I will do tomorrow probably. You can pull the current version from cvs if you want to try it out, or wait till tomorrow when I put a snapshot tarball online.

             
            • Richard Fuchs

              Richard Fuchs - 2003-01-15

              I think I've found a good way to support an external trigger command. It works globally, that is it's not restricted to one single module such as http, and it should get the job done. Let me know what you think of this interface.

              As always, you can pull the current version from cvs, or get a snapshot release from <http://dfx.homeip.net/camsource-0.7.0a.tar.gz>.

               

Log in to post a comment.

MongoDB Logo MongoDB