Motion - Support Question 2006x 04x 10x 163136

Mask image being ignored

Question

I have an Axis network camera monitoring a small street. However, there is a small piece of a busy street visible, which I want to mask out.

I made a mask file in The Gimp. First, I saved it directly as a .pgm binary file, placed it into motion's directory, edited the configuration file, and restarted motion. This didn't work. So I saved the .pgm file as a .jpg, and converted it using djpeg (djpeg -grayscale -pnm [inputfile] > mask.pgm). I placed it into motion's directory and restarted motion; this still didn't work. The mask file is simply being ignored.

So I thought, maybe it's a permissions problem. Motions runs as user motion, and the mask file is located in /home/motion. The mask file has permissions motion:motion -rwxrwxrwx (777). So that can't be the problem.

The mask file is the same resolution as the camera input:

Image: 18-46-29_53-03-891-19.jpg

Mask PGM: http://rik.rikva.nl/fotos/Linux/mask.pgm

Mask JPG: mask.jpg

Any clues?

Motion config:
# PGM file to use as a sensitivity mask.
# Full path name to. (Default: not defined)
mask_file /home/motion/mask.pgm

# Dynamically create a mask file during operation (default: 0)
# Adjust speed of mask changes from 0 (off) to 10 (fast)
smart_mask_speed 0

Environment

Motion version: 3.2.6
ffmpeg version: none
Libraries: none
Server OS: Debian Sarge, kernel 2.4.27

-- TWikiGuest - 10 Apr 2006

Answer

I have tested your mask file with a netcam running 640 x 480.

It is perfectly accepted by Motion.

Can you post in this topic the error messages you get. Both in your syslog and in the console when you start Motion with motion -s please?

-- KennethLavrsen - 11 Apr 2006

Thank you for your reply.

Motion log, running with daemon mode off:
[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Unknown config option "ffmpeg_filename"
[0] Thread is from /etc/motion/motion.conf
[1] Thread started
[0] motion-httpd/3.2.6 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[1] Started stream webcam server in port 8081
[1] File of type 1 saved to: /home/motion//pics/motion_captures/Jaar_2006/Maand_04/Dag_11/14-45-53_01-01-1038-20.jpg
[1] File of type 1 saved to: /home/motion//pics/motion_captures/Jaar_2006/Maand_04/Dag_11/14-45-53_01-02-1623-20.jpg
[1] File of type 1 saved to: /home/motion//pics/motion_captures/Jaar_2006/Maand_04/Dag_11/14-45-53_01-03-1591-20.jpg
(etc)

Syslog grepped:
Apr 11 14:45:35 domovoi motion: [0] Processing thread 0 - config file /etc/motion/motion.conf
Apr 11 14:45:35 domovoi motion: [0] Unknown config option "ffmpeg_filename"
Apr 11 14:45:35 domovoi motion: [0] Thread is from /etc/motion/motion.conf
Apr 11 14:45:35 domovoi motion: [1] Thread started
Apr 11 14:45:35 domovoi motion: [0] motion-httpd/3.2.6 running, accepting connections
Apr 11 14:45:35 domovoi motion: [0] motion-httpd: waiting for data on port TCP 8080
Apr 11 14:45:35 domovoi motion: [1] Started stream webcam server in port 8081
Apr 11 15:29:47 domovoi motion: [0] httpd Closing
Apr 11 15:29:47 domovoi motion: [1] netcam camera handler: finish set, exiting
Apr 11 15:29:47 domovoi motion: [0] Motion terminating

Running motion -s:
[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Unknown config option "ffmpeg_filename"
[0] Motion running in setup mode.
[0] Thread device: http://10.0.0.100/axis-cgi/mjpg/video.cgi?showlength=1 input -1
[0] Thread is from /etc/motion/motion.conf
[1] Thread started
[1] Camera thread starting...
[0] motion-httpd/3.2.6 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[0] Waiting for threads to finish, pid: 28991
[1] Received first header
[1] Received first header
[1] Received first header
[1] Streaming camera
[1] Boundary string [--myboundary]
[1] Maskfile "/home/motion/mask.pgm" loaded.
[1] Camera handler thread [2]  started
[1] Started stream webcam server in port 8081
[1] Raw changes:     0 - changes after 'EedDl':     0 - labels:   0 - noise level: 22 - threshold: 500
[1] Lightswitch detected
[1] Raw changes:     0 - changes after 'EedDl':     0 - labels:   0 - noise level: 22 - threshold: 500
[1] Raw changes:  3126 - changes after 'EedDl':     0 - labels:   0 - noise level: 22 - threshold: 500

(snip)

[1] Raw changes:  4028 - changes after 'EedDl':     0 - labels:   0 - noise level: 21 - threshold: 500
[1] Raw changes:  3888 - changes after 'EedDl':     0 - labels:   0 - noise level: 21 - threshold: 500
[0] httpd - Finishing: Interrupted system call
[0] httpd Closing
[1] End of event 2
[1] Raw changes:  3800 - changes after 'EedDl':     0 - labels:   1 - noise level: 22 - threshold: 500
[1] netcam camera handler: finish set, exiting
[1] Thread exiting
[1] Closing webcam listen socket
[1] Closing active webcam sockets: Operation now in progress
[0] Threads finished
[0] Motion terminating

-- TWikiGuest - 11 Apr 2006

As far as I can tell your mask file is loaded and accepted.

What makes you say it fails?

-- KennethLavrsen - 11 Apr 2006

Hmm, it indeed seems to work. This is since I made a new mask file (my camera accidentilly fell and I had to replace it another way) and reset the permissions. I'll wait a few hours for some more traffic on the road smile

Edit: It works. Thanks for your help and sorry for the trouble!

-- TWikiGuest - 12 Apr 2006
Topic revision: r7 - 17 Apr 2006, AngelCarpintero
Copyright © 1999-2024 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.