Reputation: 5508
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?
Upvotes: 4
Views: 4235
Reputation: 2734
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.
Upvotes: 2
Reputation: 3450
For that you need to write a (mini) a http server. You can look at e.g. rygel (the upnp server on gnome).
Upvotes: 1