Motion - Feature Request 2005x 05x 13x 132716

Feature Request: mirroring of saved images (not only rotation)

Description

I know that there is the 'rotate' option.

It would be nice to have also a 'mirror' option (horizontal and/or vertical ?). This option should work similarly to the 'rotate': only saved images and movies are affected.

I'm asking this mainly because I use PCVC730K cameras with the PWC driver and all my images are mirrored.

Many thanks!

-- MarcoRogantini - 13 May 2005

Follow up

Comments


The request as such is not accepted. I will not spend energy and CPU power on a mirror feature which is needed only because of a bug in a camera or camera driver.

However Motion 4.0 will have a plugin interface and here it will be possible to also add a mirror feature. In fact the Gstreamer plugin which is one of the ideas will most likely be able to do it.

So watch out for the development of next generation Motion with plugin interface.

-- KennethLavrsen - 29 Aug 2005

Alas, this is not really user friendly frown, sad smile

Luc states in http://www.saillard.org/linux/pwc/BUGS, some webcam, image is flip in x axis. ===> needed to be in usermode. The windows driver use libopencv to change the result.

Kenneth spoke: I will not spend energy and CPU power on a mirror feature which is needed only because of a bug in a camera or camera driver.

Nice deadlock, nothing won. While I share Kenneth' point of view that a mirrored image knowingly produced by a fraction of the PWC-driven cams, is to be considered a bug which one expects the driver works around (Luc: please reconsider this), SOMEWHERE it has to be done. Since Kenneth and Luc do co-operate at least on the documentation level, I urge both to talk about this and one of 'em to change his opinion ...

Since I was burning away LOTS of CPU cycles flipping the image of my currently 730K-type cams, I know what I'm talking about ... Before hacking motion to support flipping the image horizontally, I was forced to use camsource to flip the image for me, delivering into vloopback, from where motion got it's images of the 730K-type cam (actually an 830K):

top - 00:56:54 up 4 days, 15:38, 14 users,  load average: 3.08, 2.99, 2.82
Tasks: 165 total,   1 running, 162 sleeping,   0 stopped,   2 zombie
Cpu(s): 44.5% us, 23.9% sy,  0.0% ni, 31.2% id,  0.0% wa,  0.3% hi,  0.0% si
Mem:    515388k total,   507248k used,     8140k free,    19748k buffers
Swap:  1052248k total,    87356k used,   964892k free,   120656k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 8008 wusel     20   0     0    0    0 Z 49.6  0.0   1255:32 camsource <defunct>
 8014 wusel     19   0     0    0    0 Z 11.3  0.0 298:36.01 camsource <defunct>
11445 wusel     16   0 63732  20m 1168 S  6.7  4.1   1:19.41 motion

After haking motion:

top - 01:01:52 up 4 days, 15:43, 14 users,  load average: 1.41, 2.25, 2.56
Tasks: 165 total,  15 running, 149 sleeping,   0 stopped,   1 zombie
Cpu(s): 14.9% us,  7.4% sy,  0.0% ni, 77.2% id,  0.5% wa,  0.0% hi,  0.0% si
Mem:    515388k total,   503036k used,    12352k free,    21272k buffers
Swap:  1052248k total,    87176k used,   965072k free,   120400k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
11938 wusel     19   0     0    0    0 Z 12.0  0.0   0:09.49 camsource <defunct>
11943 wusel     16   0 60128  15m 1044 S  9.0  3.1   0:05.75 motion

(The remaining camsource is needed since the cam used only delivers 464 pixels -- the need to be rescaled to 640 to avoid distortions; I accomplish this with the remaining camsource instance. I will get rid of that cam now, in favor of the second, mirroring, PWC.)

PID 11943 is a motion 3.2.3w1 with differs from standard 3.2.3 as described in http://death.uu.org/~wusel/motion-3.2.3w1.diff -- instead of relaying that task to camsource, THIS motion just horizontally flips the YUV image when instructed to rotate 179 degrees ... It's a HACK but at least for me, it works. Quite well, looking at CPU figures, I might add ...

Thus, energy (of myself and Phil Hernon -- as well of my CPU for roughly a month ...) has already been spend, and CPU-cycle-wise, it's far less expensive that any other means.

Yes, that patch isn't of production quality -- it's intended for those who need to use those awesome PWC-cams NOW (I tried LOADS of cams -- besides those PWCs, there aren't much cams around that can be used for outdoor surveilance) and don't have 1.5 GHz to spend for mirroring images ...

Hope this helps, -kai

-- WikieDwusel - 30 Oct 2005

OK. Since Luc cannot fix the problem let us do it.

I will need a production quality patch raised as a MotionPatches topic.

The new option should be called mirror and be default off. Make sure the config option gets a proper help text added like all the other options have. The mirror option should come right after rotate.

The feature must not add any CPU load when off except for a few IF statements.

Make sure to get familiar with the MotionCodingStandard to minimize the integration effort. Use a daily snap release when you make the patch and remember to write which one.

-- KennethLavrsen - 30 Oct 2005

I am using motion with a camera which is directed to a convex mirror to view a wider area. For me it would also be interesting to have a "mirror"-option.

-- OlafJoensson - 02 Feb 2008

I've added a proof of concept patch against trunk svn 310

-- AngelCarpintero - 04 Feb 2008

Look at my patch http://www.lavrsen.dk/foswiki/bin/view/Motion/MirrorPatch

-- OlegM - 05 Nov 2011

FeatureRequestForm edit

TopicTitle mirroring of saved images (not only rotation)
FeatureRequestStatus Accepted
SubmittedBy MarcoRogantini
Topic attachments
I Attachment Action Size Date Who Comment
mirror-image.patchpatch mirror-image.patch manage 3 K 04 Feb 2008 - 09:17 AngelCarpintero Mirror patch against trunk svn 310
Topic revision: r7 - 05 Nov 2011, OlegM
Copyright © 1999-2017 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.