Motion - Bug Report 2008x 06x 19x 123218

BUG: netcam green screen

Genius IPCam secure 300R. I connect it using url http://webcam/cgi-bin/getimage I see a green screen in motion web server. When I do "wget http://webcam/cgi-bin/getimage --user=admin --password=1234" every time I obtain a good jpeg frame.

If I use a USB camera and config line "videodevice /dev/video0" everything works fine.

Whats going wrong?
netcam_url http://webcam/cgi-bin/getimage
netcam_userpass admin:1234

Environment

Motion version: 3.2.10.1
ffmpeg version: 0.4.9
Shared libraries: ffmpeg, mysql, postgresql
Server OS: Fedora 8
-- DennisOpanasenko - 19 Jun 2008

Follow up

Hi Dennis,

1-. Get a mjpeg dump using :

http://www.lavrsen.dk/twiki/bin/view/Motion/NetcamMjpegStreamDumps

2-. Post your motion.conf

3-. run motion in no daemon mode and debug enabled

./motion -n -d 7

-- AngelCarpintero - 20 Jun 2008

Follow up

All right, I have attached a config, raw file and debug printout. Could I do anything else to make a issue clear?

Thank you.


Hi Dennis your netcam firmware is doing multipart/jpeg but without boundary strings , i'm pretty sure that these buggy firmwares were handled

already by motion ... but probably there an issue somewhere. Please run with a full debug :

./motion -n -d 10

Thanks

-- AngelCarpintero - 24 Jun 2008

Follow up

I have attached a motion-debug10. It is a printout fo motion -d 10. As far as I can understand it seems that Motion wouldn't recognize a jpeg frame, but such frames obtained via wget looks good. Should I attach one of this?

Also I found a possibility of get a some stream from camera. But this stream wouldn't be recognized by Motion as well. I would be eager to provide all information you ask to resolve this.

Thank you, Angel, for you efforts.

-- DennisOpanasenko - 19 Jun 2008


Hi Dennis ,

I've rechecked and your issue was not solved yet , your last debug gave me the clue .

JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")

My guess is your camera is sending sequential pictures, so it requieres "Progressive JPEG support" this is really weird for stream and motion doesn't support it at the moment.

Could try to get a long capture with wget or even with mjpegdump so i can try to figure out how to add add support to motion.

Anyway try to see if you can change the image mode in your camera ( ask to genius support ).

Did you try to get images using other methods ? like :

image.jpg

Thanks

-- AngelCarpintero - 26 Jun 2008

Follow up

Hi, Angel!

If I don't misunderstood you, I'm pretty sure that when I get url http://webcam/cgi-bin/getimage netcam sends only one picture. All that it produced I've attached as "rawfile-jpeg". No matter what I do: wget or mjpegdump: netcam sends approximately 30kbytes and nothing else. All of my programs shows this file as jpeg image correctly.

Meanwhile I've found a way to obtain some stream from the netcam. But that stream not recognized by Motion too. I attached a stream as "rawfile-stream". Ask me for debug or anything else if it could be useful.

Thank you.

-- DennisOpanasenko - 26 Jun 2008


Hi Dennis ,

I've made a weird patch as a proof of concept , it basically disable all errors from netcam and jpeg process , because i test your stream and image and

with some programs jpeg warnings / errors are raised but others just pass over.

So get 3.2.10 svn branch an apply that patch and let me know if you get a good image.

-- AngelCarpintero - 26 Jun 2008

Follow up

Hi, Angel!

I applied patch on 3.2.10.1, but not on a svn. It was successful, and brings the netcam to life. Now I got a valid webcast from netcam by Motion and valid motion detection. When I use

netcam_url http://webcam/cgi-bin/getimage

everything works almost fine.

When I do in motion.conf

netcam_url http://webcam/cgi-bin/getimage?java=1

to obtain stream I got a gray screen in motion and printout in my /var/log/messages I attached as "messages".

Thank you!

-- DennisOpanasenko - 28 Jun 2008


Good news Dennis , with my previous patch i did a trick for libjpeg library to forget about :

JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")

JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")

This was for static images , so i think that i can create a patch in trunk tree or even for 3.2.x branch to

fix this issue or avoid it.

I've no idea what is the type of stream motion gets from :

netcam_url http://webcam/cgi-bin/getimage?java=1

Could you run motion with -d 10 and post that log ?

Thanks !

-- AngelCarpintero - 28 Jun 2008

Follow up

Hi, Angel!

I attached a motion-debug10-stream which is a motion -n -d 10 stderr printout for a couple seconds.

Thanks! -- DennisOpanasenko - 28 Jun 2008


Dennis , not good news from your last log , your camera is doing something very weird , it not sending content-type :

[1] Received first header ('HTTP/1.0 200 OK')
[1] Received first header ('width=640,length=25340;')
image content
[1] Received first header ('width=640,length=25356;')

image content 
...
So that will never support by any application there's no way to "guess" what content-type a device is sending and that custom header:

('width=640,length=25340;')

It's really weird ... :-/ why only sending width ?! , it should be Content-lenght: 25340\r\nEXTRAHEADER

So lets try to get what is the stream your camera sends , please do a raw capture of that stream.

Thanks smile

-- AngelCarpintero - 28 Jun 2008

Follow up

Angel, I did it by mjpegdump and attached as rawfile-stream. For such dumb cameras may be a good idea to include an option like "ContentOverride" in motion config file? I'll try to contact Genius support to ask him to add a more reasonable stream output to firmware. They include a software for netcam, but for my mind it's useless at all!

-- DennisOpanasenko - 28 Jun 2008


Sorry Dennis i was not sure if that attachment was a stream. Well anyway some comments you can send to Genius support :

1-. They don't follow the International Telecommunication Union (ITU) as Recommendation T.81

- some examples they do in jpeg images :

FF D8 SOI
FF C0 SOF0
FF DB DQT
FF C4 DHT
FF DA SOS
FF D9 EOI

- without adding JFIF APP0 marker ( i's not considered mandatory lately but it was ... so why break it now and leave a bunch applications broken ? )

- not respecting the order of Start of Frame and DQT .

Recommendation order is :

FF D8 SOI
FF E0 APPO
FF DB DQT
FF C0 SOF0
FF C4 DHT
FF DA SOS
FF D9 EOI

But well we have fix that as i did in my patch.

About Stream that is really weird :

1-. Not Content-Type header

2.- Not Content-lenght header but : width=xxx;lenght=xxxx

3-. Images on stream are using same format of above ( not really recoomended ) ... but ... WTF is EOI ( FF D9 ) no end of file !

So , please if you send a mail don't hesiate to put me in copy.

Thanks

-- AngelCarpintero - 28 Jun 2008

Fix record

Added a better patch adding a new parameter netcam_broken to fix that issues with still images , this broken stream won't be fixed too much weird breaking

http headers so complaint to Genius.

Patch needs some test before be included in 3.2.10 branch and trunk.

-- AngelCarpintero - 28 Jun 2008

Committed to 3.2.10 branch and trunk.

-- AngelCarpintero - 04 Jul 2008

Works fine!

A lot of thanks.

-- DennisOpanasenko - 12 Jul 2008

Do I need do build a special motion to make this secure300R work?

I've got 3.2.12 from linux mint but I still get: [1] Error reading first header - re-trying (4times)
[1] Failed to read first camera header - giving up for now

my motion.conf's got: netcam_url http://cam1/cgi-bin/getimage?java=1 netcam_userpass admin:1234
netcam_broken on
netcam_tolerant_check on

Maybe I need other settings as well in motion.conf?

-- ArnoTixe - 12 Feb 2013

I Attachment Action Size Date Who Comment
allow_netcam_broken.diffdiff allow_netcam_broken.diff manage 7 K 28 Jun 2008 - 23:20 AngelCarpintero patch with a netcam_broken parameter for buggy network camera firmware
d10debug_secure300R.txttxt d10debug_secure300R.txt manage 7 K 12 Feb 2013 - 17:30 UnknownUser d10 debug - Error with first header (motion 3.2.12 on linux mint)
messagesEXT messages manage 1 K 28 Jun 2008 - 02:42 UnknownUser  
motion-debugEXT motion-debug manage 26 K 23 Jun 2008 - 12:44 UnknownUser  
motion-debug10EXT motion-debug10 manage 21 K 25 Jun 2008 - 12:37 UnknownUser  
motion-debug10-streamEXT motion-debug10-stream manage 15 K 28 Jun 2008 - 04:35 UnknownUser Debug printout for streaming camera after the patch applied. Motion build from svn.
motion.confconf motion.conf manage 21 K 23 Jun 2008 - 12:43 UnknownUser  
netcam-no-error-throw.diffdiff netcam-no-error-throw.diff manage 2 K 26 Jun 2008 - 17:22 AngelCarpintero Disable errors raised from netcam and jpeg library
rawfile-jpegEXT rawfile-jpeg manage 29 K 23 Jun 2008 - 12:44 UnknownUser  
rawfile-streamEXT rawfile-stream manage 97 K 26 Jun 2008 - 14:11 UnknownUser  
Topic revision: r19 - 12 Feb 2013, ArnoTixe
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.