LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-25-2005, 04:33 AM   #1
Xa!
LQ Newbie
 
Registered: Mar 2004
Location: .ru/moscow
Distribution: Gentoo
Posts: 17

Rep: Reputation: 0
Motion jpeg stream.


Hey.

I have a video stream in special format so it can be shown only with special codec. And I need to make a program that shows live-streaming video in browser. So I need to convert my video stream to motion jpeg stream. I have written a function that creates a single JPEG image. So running:
Code:
...
main () {
    printf("Content-Type: image/jpeg\n\n");
    jpeg_data();
}
...
i write one image to stdout and can see it in browser like http://127.0.0.1/cgi-bin/myprogram

But i cant find a manual that tells how to show these images one by one, to make motion. Something like
Code:
while(1) { jpeg_data(); }
Will be very very gratefull for help!!
 
Old 08-25-2005, 01:37 PM   #2
Dave Kelly
Member
 
Registered: Aug 2004
Location: Todd Mission Texas
Distribution: Linspire
Posts: 215

Rep: Reputation: 31
Is it neccessary that you write this in C? Because html provides 'refresh' command.

I actually maxxed out my CPU the other day reading an upload that was 10 fps.

What is providing you with this jpg image? Is it numbered in sequence or overwriten?
 
Old 08-29-2005, 11:45 AM   #3
Xa!
LQ Newbie
 
Registered: Mar 2004
Location: .ru/moscow
Distribution: Gentoo
Posts: 17

Original Poster
Rep: Reputation: 0
i've found the solution - the output should be followed:

HTTP/1.0 200 OK\r\n
Content-Type: multipart/x-mixed-replace;boundary=myboundary\r\n
\r\n
--myboundary\r\n
Content-Type: image/jpeg\r\n
Content-Length: 15656\r\n
\r\n
<JPEG image data>\r\n
--myboundary\r\n
Content-Type: image/jpeg\r\n
Content-Length: 14978\r\n
\r\n
<JPEG image data>\r\n
--myboundary\r\n
Content-Type: image/jpeg\r\n
Content-Length: 15136\r\n
\r\n
<JPEG image data>\r\n
--myboundary\r\n

(http://www.axis.com/techsup/cam_serv...g_mjpg_request)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vim: motion to , gypsy_rabbi Linux - Software 1 02-22-2005 06:20 PM
mouse motion xlord Linux - Newbie 1 06-14-2004 02:38 PM
In Motion... Or Not.. robhargreaves Linux - Software 1 05-20-2004 04:10 PM
Motion JPEG Encoding gbrad Linux - Software 2 06-15-2003 01:25 PM
mencoder jpeg stream encoding bakuretsu Linux - Software 0 10-10-2002 09:17 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration