Little help with M/Jpeg encoding and streaming

Ian Daley ian at
Mon Nov 28 08:25:55 PST 2011

Hi there,

I am working on developing an app with gstreamer (or hoping to!) that 
will pickup the image from a wireless IP cam and then relay this to a 
web server. I will have multiple cameras, but I guess we'll get to that 
later, because right now, I'm a little stuck (and perhaps a little tired 
being 2 AM) and need a little bit of guidance.

Essentially I have a video source from an IP Camera that is in mjpeg 
format. I currently access this through souphttpsrc via the following 

gst-launch -v souphttpsrc 
do-timestamp=true is_live=true ! multipartdemux ! tcpserversink port=5000

and play it back via:

gst-launch tcpclientsrc port=5000 ! jpegdec ! autovideosink

Which is simple enough... I guess, somewhere to get started. This works, 
but of course, I don't want to stream in mjpeg, I would rather convert 
this to something more browser friendly... this is where the problems begin.

If I try to convert it to theora I get:

gst-launch -v souphttpsrc 
do-timestamp=true is_live=true ! multipartdemux ! jpegdec ! videoscale 
method=1 ! video/x-raw-yuv,width=320,height=240 ! theoraenc bitrate=150 
! tcpserversink port=5000

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstJpegDec:jpegdec0.GstPad:sink: caps = image/jpeg
/GstPipeline:pipeline0/GstJpegDec:jpegdec0.GstPad:src: caps = 
video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, 
ERROR: from element /GstPipeline:pipeline0/GstSoupHTTPSrc:souphttpsrc0: 
Internal data flow error.
Additional debug info:
gstbasesrc.c(2574): gst_base_src_loop (): 
streaming task paused, reason not-negotiated (-4)
Execution ended after 50288828 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
/GstPipeline:pipeline0/GstJpegDec:jpegdec0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstJpegDec:jpegdec0.GstPad:sink: caps = NULL
caps = NULL
Setting pipeline to NULL ...
Freeing pipeline ...

In fact... I pretty much get this with most attempts to convert it to 
something browser friendly.

Anyone got any ideas on what would be the best way to encode this stream 
into something that can be picked up and handled easily in browsers? 
FWIW, even the mjpeg stream doesn't work natively in Firefox, but the 
source does.

Kind Regards


More information about the gstreamer-devel mailing list