<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.28.3">
</HEAD>
<BODY>
I'm trying to use GStreamer (0.10.28 and 0.10.35 tested, Linux) to play MJPEG streams delivered over HTTP from an Axis video camera.&nbsp; The network or the camera tend to be somewhat slow.<BR>
<BR>
If I create the following pipeline, everything works great:<BR>
<BR>
gst-launch-0.10 souphttpsrc location=http://ccd1611-403/mjpg/video.mjpg ! multipartdemux ! jpegdec ! autovideosink<BR>
<BR>
However, the final outcome is to use gstreamer inside of Qt's QMultimediaKit, which automatically uses a playbin or playbin2 element, and doesn't offer any capability to manually construct the pipeline.&nbsp; In this situation:<BR>
<BR>
gst-launch-0.10 playbin2 uri=<A HREF="http://ccd1611-403/mjpg/video.mjpg">http://ccd1611-403/mjpg/video.mjpg</A><BR>
<BR>
I'm experiencing two problems:<BR>
<BR>
1)&nbsp; Playback doesn't start for about 35 seconds.&nbsp; During this time, frames are received but I see &quot;Buffering... 0%&quot;.&nbsp; After about 30 seconds, the output window appears and all the frames that piled up during this time are displayed very quickly.&nbsp;&nbsp; <BR>
<BR>
[Some people have suggested elsewhere on this list that the multipartdemux or multiqueue might be waiting to find out if there is an audio stream, and then blocking until the audio stream is up (or confirmed non-existent).<BR>
<BR>
<BR>
2)&nbsp; Once the output window is created and playback starts,&nbsp; playback pauses and buffers for about 3s between each set of frames... making the real-time experience basically unusable.&nbsp;&nbsp; It will pause and buffer for 3s, and then quickly show all the frames received during those 3s, and then pause and buffer again [repeat].<BR>
<BR>
I can get around this by setting playbin2's buffer-duration=10000, and then each frame is displayed as soon as it is received.&nbsp; However, the stream now alternates between playing and paused on every single frame.&nbsp; [Unfortunately, I have no way of specifying the buffer-duration property when using QMultimediaKit's gst backend.]<BR>
<BR>
This makes the camera essentially useless as a real-time video monitor.&nbsp; I've tested the same camera(s) using VLC, and it starts playing immediately and without 3s pauses.<BR>
<BR>
Any suggestions for what could be going on here?&nbsp; Any suggestions for how to work around it?&nbsp; If I could set up the pipeline manually like the first example, all would be well.&nbsp; However, I'm stuck using whatever playbin2 creates because I need to use this inside the multimedia module that comes with Qt/QtMobility.<BR>
<BR>
Thanks a lot!<BR>
-Mark<BR>
<BR>
================<BR>
Mark Boots<BR>
<BR>
Controls Analyst<BR>
Canadian Light Source<BR>
University of Saskatchewan<BR>
<BR>
<A HREF="mailto:Mark.Boots@lightsource.ca">Mark.Boots@lightsource.ca</A><BR>
<BR>
101 Perimeter Rd<BR>
Saskatoon, SK<BR>
S7N 0X4<BR>
================<BR>
<BR>
<BR>
Verbose log:&nbsp; No limit on buffering-duration: (Shows problem 1 and 2)<BR>
<BR>
gst-launch-0.10 -v --gst-plugin-spew playbin2 uri=<A HREF="http://ccd1611-403/mjpg/video.mjpg">http://ccd1611-403/mjpg/video.mjpg</A><BR>
Setting pipeline to PAUSED ...<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: connection-speed = 0<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: download = FALSE<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: uri = &quot;<A HREF="http://ccd1611-403/mjpg/video.mjpg">http://ccd1611-403/mjpg/video.mjpg</A>&quot;<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: use-buffering = FALSE<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: buffer-duration = -1<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: buffer-size = -1<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: source = (GstSoupHTTPSrc) source<BR>
Pipeline is PREROLLING ...<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstTypeFindElement:typefindelement0.GstPad:src: caps = multipart/x-mixed-replace<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstTypeFindElement:typefind: force-caps = multipart/x-mixed-replace<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20: sink-caps = multipart/x-mixed-replace<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstTypeFindElement:typefind.GstPad:src: caps = multipart/x-mixed-replace<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstQueue2:queue20.GstPad:sink: caps = multipart/x-mixed-replace<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstQueue2:queue20.GstPad:src: caps = multipart/x-mixed-replace<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstTypeFindElement:typefind.GstPad:sink: caps = multipart/x-mixed-replace<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20.GstGhostPad:sink: caps = multipart/x-mixed-replace<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20.GstGhostPad:sink.GstProxyPad:proxypad0: caps = multipart/x-mixed-replace<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstMultipartDemux:multipartdemux0.GstPad:sink: caps = multipart/x-mixed-replace<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstMultiQueue:multiqueue0.GstPad:sink0: caps = image/jpeg<BR>
buffering... 0%<BR>
<BR>
#[35 seconds go by right here]<BR>
<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstMultiQueue:multiqueue0: max-size-buffers = 5<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstMultiQueue:multiqueue0: max-size-time = 0<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstMultiQueue:multiqueue0: max-size-bytes = 2097152<BR>
/GstPlayBin2:playbin20/GstPlaybin2InputSelector:playbin2inputselector0.GstPlaybin2SelectorPad:sink0: always-ok = FALSE<BR>
/GstPlayBin2:playbin20/GstPlaybin2InputSelector:playbin2inputselector0: active-pad = (GstPlaybin2SelectorPad) sink0<BR>
/GstPlayBin2:playbin20/GstPlaybin2InputSelector:playbin2inputselector0.GstPlaybin2SelectorPad:sink0: tags = ((GstTagList*) 0xb6500aa8)<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstMultiQueue:multiqueue0.GstPad:src0: caps = image/jpeg<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstJpegDec:jpegdec0.GstPad:sink: caps = image/jpeg<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0.GstGhostPad:src0: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20.GstDecodePad:src0: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstJpegDec:jpegdec0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstPlaybin2InputSelector:playbin2inputselector0.GstPlaybin2SelectorPad:sink0: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0.GstGhostPad:src0.GstProxyPad:proxypad4: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20.GstDecodePad:src0.GstProxyPad:proxypad3: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstPlaybin2InputSelector:playbin2inputselector0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:vbin/GstQueue:vqueue.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:vbin.GstGhostPad:sink: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstPlaySink:playsink0.GstGhostPad:video_raw_sink: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstPlaySink:playsink0.GstGhostPad:video_raw_sink.GstProxyPad:proxypad5: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:vbin.GstGhostPad:sink.GstProxyPad:proxypad7: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:vbin/GstQueue:vqueue.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:vbin/GstFFMpegCsp:vconv.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:vbin/GstFFMpegCsp:vconv.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:vbin/GstVideoScale:vscale.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:vbin/GstVideoScale:vscale.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:vbin/GstAutoVideoSink:videosink/GstXvImageSink:videosink-actual-sink-xvimage.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:vbin/GstAutoVideoSink:videosink.GstGhostPad:sink: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
/GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:vbin/GstAutoVideoSink:videosink.GstGhostPad:sink.GstProxyPad:proxypad6: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)0/1<BR>
Prerolled, waiting for buffering to finish...<BR>
Pipeline is PREROLLED ...<BR>
Setting pipeline to PLAYING ...<BR>
New clock: GstSystemClock<BR>
<BR>
# [Lots of frames... all piled up during those 30 seconds... shown very quickly here]<BR>
<BR>
Buffering, setting pipeline to PAUSED ...<BR>
Prerolled, waiting for buffering to finish...&nbsp; # [3 seconds go by]<BR>
Done buffering, setting pipeline to PLAYING ...&nbsp; # [All frames received during those 3 seconds now shown quickly]<BR>
Buffering, setting pipeline to PAUSED ...<BR>
Prerolled, waiting for buffering to finish... # [3 seconds go by]<BR>
Done buffering, setting pipeline to PLAYING ... #[All frames received during those 3 seconds now shown quickly]<BR>
<BR>
# [and so on:]<BR>
<BR>
Buffering, setting pipeline to PAUSED ...<BR>
Prerolled, waiting for buffering to finish...<BR>
Done buffering, setting pipeline to PLAYING ...<BR>
Buffering, setting pipeline to PAUSED ...<BR>
Prerolled, waiting for buffering to finish...<BR>
Done buffering, setting pipeline to PLAYING ...<BR>
Buffering, setting pipeline to PAUSED ...<BR>
Prerolled, waiting for buffering to finish...<BR>
Done buffering, setting pipeline to PLAYING ...<BR>
# [...]<BR>
<BR>
<BR>
<BR>
<BR>
</BODY>
</HTML>