Motion - Bug Report 2005x 02x 01x 071546

BUG: Netcam code in 3.1.18 is not stable

When you start Motion and have a netcam - even with single jpegs - Motion often stops right away.

Test case

I have used your URL and I can for sure say that it is not the URL or your camera which is the problem.

Something is rotten in the new Motion netcam code.

I can reproduce your error. I can even reproduce it when I connect to a jpg file on my own webserver.

I have made some tools to get better control of the experiments.

I have a C program that I use to connect to the Netcam and save the raw data that it returns in a file.

And I have made a small perl program which can send data via my Apache server (nph- prefixed to control all headers).

They are all packed here: http://www.lavrsen.dk/twiki/bin/view/Motion/MjpegSniffer

The result is that Motion will fail often but not all the time with a jpg from the Toshiba cam. It works better with a jpeg from my own Motion server but even this fails.

When Motion fails it fails within the first few seconds. Once it runs - it runs stable for many minutes until I kill it.

Running with daemon off here are two scenarios.

First success

[root@merlin mjprox]# motion
Processing thread 0 - config file /usr/local/etc/motion.conf
Processing thread 1 - config file /usr/local/etc/thread1.conf
Processing thread 2 - config file /usr/local/etc/thread2.conf
Processing thread 3 - config file /usr/local/etc/thread3.conf
Processing thread 4 - config file /usr/local/etc/thread4.conf
Processing thread 5 - config file /usr/local/etc/thread5.conf
Processing thread 6 - config file /usr/local/etc/thread7.conf
Processing thread 7 - config file /usr/local/etc/thread8.conf
Processing thread 8 - config file /usr/local/etc/thread9.conf
Webcam port for thread 1 is 8081
Webcam port for thread 2 is 8082
Webcam port for thread 3 is 8083
Webcam port for thread 4 is 8084
Webcam port for thread 5 is 8085
Webcam port for thread 6 is 8087
Webcam port for thread 7 is 8088
Webcam port for thread 8 is 8089
Thread1 device: http://www.lavrsen.dk/cgi-bin/nph-rawparse.pl input: -1
Thread2 device: /dev/video0 input: 1
Thread3 device: /dev/video1 input: 1
Thread4 device: /dev/video4 input: 8
Thread5 device: /dev/video3 input: 8
Netcam: thread 1: starting...
Thread6 device: /dev/video7 input: 8
Thread7 device: /dev/video2 input: 8
Thread8 device: /dev/video6 input: 8
[HTTP/1.0 200 OK]
Netcam: jpeg file
Netcam: thread 1: thread PID: 11626
0 0 0

And now failure.

[root@merlin mjprox]# motion
Processing thread 0 - config file /usr/local/etc/motion.conf
Processing thread 1 - config file /usr/local/etc/thread1.conf
Processing thread 2 - config file /usr/local/etc/thread2.conf
Processing thread 3 - config file /usr/local/etc/thread3.conf
Processing thread 4 - config file /usr/local/etc/thread4.conf
Processing thread 5 - config file /usr/local/etc/thread5.conf
Processing thread 6 - config file /usr/local/etc/thread7.conf
Processing thread 7 - config file /usr/local/etc/thread8.conf
Processing thread 8 - config file /usr/local/etc/thread9.conf
Webcam port for thread 1 is 8081
Webcam port for thread 2 is 8082
Webcam port for thread 3 is 8083
Webcam port for thread 4 is 8084
Webcam port for thread 5 is 8085
Webcam port for thread 6 is 8087
Webcam port for thread 7 is 8088
Webcam port for thread 8 is 8089
Thread1 device: http://www.lavrsen.dk/cgi-bin/nph-rawparse.pl input: -1
Thread2 device: /dev/video0 input: 1
Thread3 device: /dev/video1 input: 1
Thread4 device: /dev/video4 input: 8
Thread5 device: /dev/video3 input: 8
Thread6 device: /dev/video7 input: 8
Thread7 device: /dev/video2 input: 8
Thread8 device: /dev/video6 input: 8
Netcam: thread 1: starting...
[HTTP/1.0 200 OK]
Netcam: jpeg file
Netcam : Image size 0

So there is something timing wise that often goes wrong when the new netcam code creates the netcam thread.

Environment

Motion version: 3.1.18
ffmpeg version: rpm 0.4.9-2004110
Shared libraries: xmlrpc, ffmpeg, mysql, postgresql
Server OS: FC2 with custom 2.6.10

-- KennethLavrsen - 01 Feb 2005

Follow up

I've a patch to fix this bug , i'll release as soon as i verify that there's not race condictions with any camera.

-- AngelCarpintero - 06 Feb 2005

Fix record

Fixed with post-3 patch , reopen if errors remains.

-- AngelCarpintero - 08 Feb 2005


Status changed to Released. The fix is in 3.1.19 (and 3.2.1_snaps)
Topic revision: r5 - 10 Mar 2005, KennethLavrsen
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.