Little help with M/Jpeg encoding and streaming

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Little help with M/Jpeg encoding and streaming

Ian Daley
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
method:

gst-launch -v souphttpsrc
location="http://192.168.1.195/videostream.cgi?user=admin&pwd="
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
location="http://192.168.1.195/videostream.cgi?user=admin&pwd="
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,
framerate=(fraction)0/1
ERROR: from element /GstPipeline:pipeline0/GstSoupHTTPSrc:souphttpsrc0:
Internal data flow error.
Additional debug info:
gstbasesrc.c(2574): gst_base_src_loop ():
/GstPipeline:pipeline0/GstSoupHTTPSrc:souphttpsrc0:
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
/GstPipeline:pipeline0/GstMultipartDemux:multipartdemux0.GstPad:src_0:
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

Ian

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Little help with M/Jpeg encoding and streaming

Thiago Santos
On Tue, 2011-11-29 at 02:54 +1000, Ian Daley wrote:

> 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
> method:
>
> gst-launch -v souphttpsrc
> location="http://192.168.1.195/videostream.cgi?user=admin&pwd="
> 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
> location="http://192.168.1.195/videostream.cgi?user=admin&pwd="
> 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,
> framerate=(fraction)0/1
> ERROR: from element /GstPipeline:pipeline0/GstSoupHTTPSrc:souphttpsrc0:
> Internal data flow error.
> Additional debug info:
> gstbasesrc.c(2574): gst_base_src_loop ():
> /GstPipeline:pipeline0/GstSoupHTTPSrc:souphttpsrc0:

> streaming task paused, reason not-negotiated (-4)

Here's your problem, add ffmpegcolorspace converter before theoraenc to
make it convert to a format it can handle. Might be a good idea to add
one before the capsfilter as well, in case the jpegdec outputs something
different than yuv.

> 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
> /GstPipeline:pipeline0/GstMultipartDemux:multipartdemux0.GstPad:src_0:
> 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
>
> Ian

BR,

--
Thiago
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel