Comments
Back to newsThursday 01, January 01:33
CGI programming
Just a quick update to say that things are moving albeit slowly
I am having difficulty finding time to develop at the moment, but I have passed couple of small milestones.
1) I have successfully run a test CGI binary on my host's server. This is good because I was getting the dreaded "premature end of script headers" for ages. This turned out to be due to compiling as C++ for some reason. When I changed to raw C, all was fine. Not quite sure why, and haven't the time or inclination to work it out either. If C works, then C it is :-). If anyone has any ideas then I'm all ears
2) I have got to the point of successfully opening a socket to my home camera server from my CGI proggy running on my host's server. I was concerned that they would have restricted then opening of sockets willy nilly so that is great! The more I find out about CGI, the more I am impressed with just how much you can do. :-)
As an aside, I am now running the camera server box at init-3, so have had to brave the vlc command line. Luckily this is all working fine too, and the extra control I have had via the command line has enabled me to fine tune the stream. I did a few experiments and I have found that my PIII 500 is able to encode one 320x240 @ 30FPS stream using about 45% of processor. I can drop this to 15FPS which is a barely noticable difference, and I get a drop to 30% usage. If I then up the resolution to 480x320, the usage jumps to 50%, which is a bit too near the line for my liking, so I will probably run two streams at 320x240@15FPS to start with at least.
So, work continues on the CGI stuff. I have the basic boilerplate stuff in place for both programs, and am connecting to the stream as I say above. I am now working on the guts of sharing the stream data across processes (using a shared memory segment), and working out the tricky details of reference counting on the stream server, and being able to restrict the number of clients. I will update as soon as I have any more news.