4

I'm trying to mimic IP camera that use MJPEG. At this moment to receive the stream in command line I'm using:

gst-launch -v souphttpsrc location=http://IP:PORT/video.mjpg is-live=true user-id=USER user-pw=PASSWD ! multipartdemux ! jpegdec ! ffmpegcolorspace ! ximagesink

But I have no idea how to revert the process

gst-launch -v videotestsrc ! ??? ! ...

There is not such think like souphttpsink so how to do it?

Fuxi
  • 5,298
  • 3
  • 25
  • 35

2 Answers2

2

Write a CGI script (Perl, C/C++) and place in a web-server cgi-bin/cgi_bin directory of servers like Apache or Lighttpd by giving the cgi executable permissions and setting the right web-server configuration. Look at this example to view a jpeg image in Perl http://www.perlmonks.org/?node_id=18565 . Since mjpeg stream is nothing more than a series of jpegs, instead of viewing an image frame from the disk all you need to do is get the image from the memory (This could be a jpeg frame you received from webcam or disk. You may compress an uncompressed frame using libjpeg) and place the code in the while loop for series of images. This becomes your mjpeg stream. MIME type obviously images/jpeg.

enthusiasticgeek
  • 2,640
  • 46
  • 53
2

For that you need to write a (mini) a http server. You can look at e.g. rygel (the upnp server on gnome).

ensonic
  • 3,304
  • 20
  • 31
  • 1
    I need stream video source with test data so I can work on image processing from ip camera. – Fuxi Feb 26 '12 at 16:59
  • Can you please add more detail about your environment? For some test you should be able to just run a simple httpd (just search for python mini httpd server) from a directory that contains a sample video. – ensonic Feb 26 '12 at 20:26