GNOME Bugzilla – Bug 703632
GStreamer: unable to query position of stream
Last modified: 2013-11-22 09:06:08 UTC
FramePlayer::openSource new video loaded: "/home/sagitter/Videos/big_buck_bunny.ogv" codec name: "" warning: GStreamer: unable to query position of stream (/builddir/build/BUILD/opencv-2.4.5/modules/highgui/src/cap_gstreamer.cpp:660) total frames: 0 This warning appears when I try to load a video file in 'qgifer' software (http://sourceforge.net/projects/qgifer/) in Fedora 19 with opencv-2.4.5 installed. It seems generated by this code: case CV_CAP_PROP_FRAME_COUNT: format = GST_FORMAT_DEFAULT; if(!gst_element_query_duration(pipeline, &format, &value)) { CV_WARN("GStreamer: unable to query position of stream"); return false; }
Why do you think this is a bug in GStreamer and not qgifer? Note that this is using the old 0.10 version of GStreamer which is no longer maintained (I can tell by the function signature of gst_element_query_duration()). Most demuxers will not support querying in GST_FORMAT_DEFAULT, try GST_FORMAT_TIME. I don't know if ogg supports this or not. The warning string is buggy as well, it says 'position' instead of 'duration'. A query like this might also fail if the pipeline is not prerolled yet. Is it prerolled here?
(In reply to comment #1) > Why do you think this is a bug in GStreamer and not qgifer? In fact, I didn't know if it was a problem in QGifer, opencv or GStreamer. :) Please, see http://code.opencv.org/issues/3127 > > Note that this is using the old 0.10 version of GStreamer which is no longer > maintained (I can tell by the function signature of > gst_element_query_duration()). > > Most demuxers will not support querying in GST_FORMAT_DEFAULT, try > GST_FORMAT_TIME. I don't know if ogg supports this or not. > > The warning string is buggy as well, it says 'position' instead of 'duration'. > That code is in opencv. > A query like this might also fail if the pipeline is not prerolled yet. Is it > prerolled here? Sorry, I don't know what's it means.
> That code is in opencv. To me this looks like it's most likely an issue in the opencv code then. That warning is not a warning printed by GStreamer code. > > A query like this might also fail if the pipeline is not prerolled yet. Is it > > prerolled here? > > Sorry, I don't know what's it means. Position and duration queries will usually only work once a pipeline is "prerolled", meaning some data has made it to the sink. It is a common error to do e.g.: set_state (pipeline, PAUSED or PLAYING); query_{position,duration} (pipeline); One would have to wait until the async state change is complete, by waiting for an ASYNC_DONE message on the bus or doing a get_state() with a -1 timeout. Let's close this for now until it's clear it's actually a bug in GStreamer. Let me know if the opencv maintainers need help with figuring this out.