Motion Stream Test Program
Introduction
Test the webcam stream from Motion.
Detailed Description
This program connects to the webcam stream of Motion and outputs the raw data to standard out.
Attached Files
http://lavrsen.dk/foswiki/pub/Motion/MotionStreamTestProgram/streamtest.gz
Contains one file. streamtest.c
Installation
First edit the two parameters:
- #define IPADDR "127.0.0.1"
IP address of motion server, 127.0.0.1 = localhost
- #define PORTNUMBER 8081
Set the portnumber
Compile the program with
gcc -Wall -O3 -o streamtest streamtest.c
Users Guide
Run the program with
./streamtest > testfile.txt
Now you can see the data using a text editor.
The file must start with something like this
HTTP/1.1 200 OK
Server: Motion/3.1.18
Connection: close
Max-Age: 0
Expires: 0
Cache-Control: no-cache
Cache-Control: private
Pragma: no-cache
Content-type: multipart/x-mixed-replace;boundary=BoundaryString
(empty line)
--BoundaryString
Content-type: image/jpeg
Content-Length: 5516
(empty line)
Binary stuff JFIF Binary stuff
Binary stuff....
And later in the file you must see this repeating itself
(empty line)
--BoundaryString
Content-type: image/jpeg
Content-Length: 5546
(empty line)