Motion - Support Question 2005x 02x 20x 154829

Multiple Camaras

Question

I am looking at using Motion. I was very excited when I first learned of the multiple camara (round robin) option. Unfortunately it won't work for me now.

I have a 4 input IR controlled Camara video switcher. It would be nice to be able to have Motion provide an option for a command to be executed to switch the video input (for round robin mode). I could then use some open source scripts for IR control that would switch the camara input for Motion.

Any possibility for support of this in the future?

Environment

Motion version: 3.1.18
ffmpeg version:  
Libraries: curl, xmlrpc, ffmpeg, mysql, postgresql
Server OS:  

-- RickHill - 20 Feb 2005

Answer

I think this is a bit too special to enter the Motion code but maybe we can do something else.

How fast can it change?

Maybe it could be done by using a small helper program. If done by perl or PHP in Apache a small script can switch channel and grap a picture frame. The URL defines which cam to switch to.

-- KennethLavrsen - 21 Feb 2005

Followup

I don't see this as very specialized, frankly. Using a script to switch video inputs allows many different video switching technologies to be used with Motion. It is useless to have a motion controlled survailance system that can't support multiple switching inputs (ok it does, but horribly inflexable at that). I mean, really, doesn't it make sense to watch more than one camara? If I can only detect motion the front of my house, the rear of my house is completely wide open to intruders. Not very effective method for intruder detection, now is it?

Somewhere else on this website I had seen a request for support for a serial port controlled video switcher. Here a script could run that. The key point in all of this is not letting motion detect the switching between camaras as motion. I don't see how this can be done without integral control of the Motion program.

Maybe it makes more sense to have four instances of motion running concurrently? Then each gets assigned a "URL" or other location for which the video frame would be captured from. Then if motion is detected by a particular input a semaphore could be raised to block the other instances of Motion while the instance that detected motion can do it's capture function?

This really should be easy to do. You already have round robin support. Just do a system call at the point where you would call the video card driver to switch it's input.

Well anyway, I asked. Maybe I'll just hack the Motion code myself. It is probably easier than the amount of time I spent writing this.

Thanks anyway.

-- RickHill - 26 Feb 2005
What I found specialized was the IR control of Motion. And I actually asked the question "How fast can it change?" keeping an open door to further dialogue about this feature.

What I see beeing a technical issue is - how will an IR remote controlled system ever be able to change the video input up to (30 or 25 divided by number of inputs ) times per second? I doubt this is technically possible but I could be wrong.

The round robin feature using a video capture card assumes that you can change input channel almost instantly. If your cameras are syncronized you can maybe run 4 inputs at a frame rate of 5 in practical. There are different extra feature for the round robin feature that enables you to skib a few frames after each input change and to collect a few frames at a time between shifts.

If Motion triggered some external event through a script, how fast will the input actually change? Especially using an IR remote. And how do we get Motion to not pick up video frames from the previous camera while waiting for the external video box to change channel?

It may be possible but not trivial. I do not own any such video multiplexing device. Not even the kind controlled from a serial port. So it is a bit difficult even imagining how to implement this feature so ot actually works.

  • When will Motion trigger the external script? When changing camera is not the complete answer. What if I have 2 USB camera and one capture cards connected to an external multiplexer with 16 inputs. How should this be implemented?
  • How do we ensure that we can run cameras connected without multiplexing at a high speed multiplexed by a video capture input which is not a round robin but the same video input and some external program that controls a video multiplexer?

Motion can do so many things today and new feature introduced should interact with the existing and not just work in one specific combination of option values. Otherwise the currently active developers are going to spend 2-3 hours every day trying on support. Believe me when I say that currently I spend 1 hour per day on support!

You are very welcome to start a new patch topic on this TWiki. Just put it in status PlannedPatch and start a description of how you think this feature should work in plain words.

And how it should interact with the existing features. And how we ensure that a newbie user can still figure out how to use Motion with a single cheap USB camera, and an advanced user like you can get the most out of Motion.

Motion is an open source project and also an open minded project. But also a project run by people that do it as a hobby with the time that is left when job and SWMBO has taken their share of the day.

Note - SWMBO = She Who Must Be Obeyed

-- KennethLavrsen - 26 Feb 2005

Topic revision: r5 - 10 Mar 2005, KennethLavrsen
Copyright © 1999-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.