#71 mjpeg / http clients


hi guys, i´m using camserver, motion, and some cameras that output jpeg over http
could be nice use zbarcam direct with this 'http' camera
today i´m running a php script that get jpeg image and execute zbarimg to get barcode information
since http is easy to share in many computers and is easy to configure camera (since i can do it in a server and zbar don´t need to know about v4l drivers and others toosl), could be very nice to have it in zbarcam
i see today 4 king of ip cameras
the jpeg snapshot cameras (1 image per http request)
the mjpeg video cameras (many jpeg files throw a http request)
the mpeg video cameras (a mpeg stream via http or another protocol)
the ftp cameras that save files in a ftp folder
i can help coding i don´t know here could i help, and what language could help...
thanks a lot guys!


  • rspadim

    here is some example in PHP (second code)

    for jpeg http (only one image) the file starts after first \n\r\n\r (end of http header)
    and go to end of socket

    for mjpeg http (many images) the file starts after header (\n\r\n\r) and ends at the boundary string give inside of http header... (Content-Type: multipart/mixed; boundary=gc0p4Jq0M2Yt08jU534c0p)

    since it´s a jpeg image or mjpeg... i don´t know if \n\r is allowed inside a single jpeg image (i think not...) in this case... image start after \n\r\n\r, and ends at the next \n\r, or if it´s a only jpeg (not mjpeg) it starts at end of file

    this help alot to start development of image download using http...
    we need only one url
    we need extract the host, port, user and password from url
    send the get http header to server, and wait response....

    i think that´s all, i don´w know if libcurl could help since it make http and ftp really easier.... but for mjpeg i never used libcurl (i don´t know if it allow multipart - mjpeg files)