After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703632 - GStreamer: unable to query position of stream
GStreamer: unable to query position of stream
Status: RESOLVED NOTGNOME
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-07-04 20:35 UTC by Antonio Trande
Modified: 2013-11-22 09:06 UTC
See Also:
GNOME target: ---
GNOME version: 3.7/3.8



Description Antonio Trande 2013-07-04 20:35:52 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;
}
Comment 1 Tim-Philipp Müller 2013-07-04 20:50:02 UTC
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?
Comment 2 Antonio Trande 2013-07-04 21:24:07 UTC
(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.
Comment 3 Tim-Philipp Müller 2013-11-22 09:06:08 UTC
> 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.