Motion - Motion Stream Test Program

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

https://www.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)

Comments and Bug Reports


RelatedProjectsForm edit

ProjectSummary Test the Webcam Stream with this small primitive C program
ProjectStatus Stable
ReleaseVersion
ProjectSubmitter KennethLavrsen
I Attachment Action Size Date Who Comment
streamtest.gzgz streamtest.gz manage 1020 bytes 23 Oct 2004 - 21:43 KennethLavrsen  
testfile.txttxt testfile.txt manage 16 K 23 Oct 2004 - 21:47 KennethLavrsen Sample output file
Topic revision: r1 - 23 Oct 2004, 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.