capturing mjpeg from ip-camera

Hans Maree hans.maree at gmail.com
Mon Oct 17 12:03:04 PDT 2011


Hello,


I'm trying to create a daemon that captures a video stream from an ip
security-camera.

The camera provides an jpeg stream with configurable framerate. I would like
to capture this stream and encode it as x264 or some other popular video
format (doesn't realy matter as long as the encoding process doesn't
generate too much overhead). I also want the captured video to be split in
10 minute long files.

I tried the following pipeline based on 
http://ipcctvsoft.blogspot.com/2010/07/getting-image-from-mjpeg-source-using_15.html
this  blog post:


$ gst-launch-0.10 -evt souphttpsrc
location='http://192.168.0.178/videostream.cgi?rate=1&user=admin&pwd=123456'
do-timestamp=true timeout=5 ! multipartdemux ! jpegdec ! x264enc ! filesink
location=test.x264

Setting pipeline to PAUSED ...

GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will
not be saved or shared with other applications.

Pipeline is PREROLLING ...

/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)320, height=(int)240,
framerate=(fraction)0/1

Floating point exception


Replacing x264enc with mpeg2enc also gives an error message:


$ gst-launch-0.10 -evt souphttpsrc
location='http://192.168.0.178/videostream.cgi?rate=1&user=admin&pwd=123456'
do-timestamp=true timeout=5 ! multipartdemux ! jpegdec ! mpeg2enc ! filesink
location=test.mpg

Setting pipeline to PAUSED ...

GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will
not be saved or shared with other applications.

Pipeline is PREROLLING ...

/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)320, height=(int)240,
framerate=(fraction)0/1

ERROR: from element /GstPipeline:pipeline0/GstSoupHTTPSrc:souphttpsrc0:
Internal data flow error.

Additional debug info:

gstbasesrc.c(2582): gst_base_src_loop ():
/GstPipeline:pipeline0/GstSoupHTTPSrc:souphttpsrc0:
streaming task paused, reason not-negotiated (-4)

ERROR: pipeline doesn't want to preroll.

Setting pipeline to NULL ...

/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

Freeing pipeline ...



I can view the stream using xvimagesink however:


$ gst-launch-0.10 -evt souphttpsrc
location='http://192.168.0.178/videostream.cgi?rate=1&user=admin&pwd=123456'
do-timestamp=true timeout=5 ! multipartdemux ! jpegdec ! xvimagesink


What am I doing wrong here and how can I fix it.

As a second question, what would be the best way to split the stream into 10
minute files, do I simply disconnect the filesink and connect a new one
every ten minutes or is there a better way?

Thanks,
Hans Maree

--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/capturing-mjpeg-from-ip-camera-tp3913047p3913047.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20111017/fe3d8489/attachment.htm>


More information about the gstreamer-devel mailing list