Reputation: 9606
The function query_position(gst.FORMAT_BYTES, None)[0]
returns me the no. of bytes in the pipeline after gstreamer has decoded the video/audio. I want to know the no. of bytes of the source file that were consumed to decode till this point of time. Is there a function in gstreamer API to do this?
Upvotes: 4
Views: 1983
Reputation: 1323
I have received the download data size in souphttpsrc source using onGotChunk event. This onGotChunk is MPEGDASH specific patch for souphttpsrc element.
In general
gboolean gst_element_query_duration (GstElement *element, GstFormat format, gint64 *duration);
this API can be used. Pass source element as a 1st argument to this function and check.
Upvotes: 0
Reputation: 2283
Please read the seeking chapter from pygst docs. You can replace pos_int = self.player.query_position(gst.FORMAT_TIME, None)[0]
with your version to get the bytes in real time. They are using thread
object.
You can also add the timeout method. In Python its gobject.timeout_add(interval, callback, ...)
Upvotes: 1