gst_element_query_duration

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

gst_element_query_duration

badea_ion
Hello all,

I'm using a pipeline in the form
appsrc ! volume ! audioconvert ! audioresample !alsasink

I force the caps of appsrc and use some other properties like:

caps = gst_caps_new_simple ("audio/x-raw-int",
                               "endianness", G_TYPE_INT, DEFAULT_ENDIANESS,
                               "channels", G_TYPE_INT, DEFAULT_CHANNELS,
                               "width", G_TYPE_INT, DEFAULT_BITS_PER_SAMPLE,
                               "depth", G_TYPE_INT , DEFAULT_BITS_PER_SAMPLE,
                               "signed", G_TYPE_BOOLEAN, TRUE,
                               "rate", G_TYPE_INT , DEFAULT_SAMPLE_RATE,
                               NULL);

    g_object_set (source, "caps", caps, NULL);
    g_object_set (source, "max-bytes", (guint64) 8192, NULL);
    g_object_set (source, "is-live", FALSE, NULL);
    g_object_set (source, "block", TRUE, NULL);
    g_object_set (sink, "sync", FALSE, NULL);


From time to time I interogate the pipeline to get the current position using

GstFormat fmt = GST_FORMAT_TIME;
gint64 elapsed;

gst_element_query_position(pipeline, &fmt, &elapsed);


However this doesn't work, It used to work fine on Gstreamer 0.10.28, but now I'm using 0.10.36 and it doesn't work.

Any help?
Thanks


 

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst_element_query_duration

Brendan Long
On 06/27/2013 05:46 AM, [hidden email] wrote:
However this doesn't work, It used to work fine on Gstreamer 0.10.28, but now I'm using 0.10.36 and it doesn't work.

What doesn't work about? Do you get some sort of error or warning, or does it just not do what you expect?

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst_element_query_duration

amartin
Check this sample code:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-queryevents.html

It works. You could test your pipeline with a "gst_parse_launch"
enabling "do-timestamp" for the appsrc.

2013/6/27 Brendan Long <[hidden email]>:

> On 06/27/2013 05:46 AM, [hidden email] wrote:
>
> However this doesn't work, It used to work fine on Gstreamer 0.10.28, but
> now I'm using 0.10.36 and it doesn't work.
>
>
> What doesn't work about? Do you get some sort of error or warning, or does
> it just not do what you expect?
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst_element_query_duration

badea_ion
In reply to this post by badea_ion
Hello,

The gst_element_query_position returns TRUE however the elapsed variable seems to be filled with some random values: 804329364,

1475392, 1127216, 1127216, 1127216 ...

 

I tried with and without setting the "do-timestamp" property to TRUE.

 

Thank you,

Dan

 

----- Original Message -----

From: Angel Martin

Sent: 06/27/13 06:29 PM

To: Discussion of the development of and with GStreamer

Subject: Re: gst_element_query_duration

 
Check this sample code: 
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-queryevents.html 

It works. You could test your pipeline with a "gst_parse_launch" 
enabling "do-timestamp" for the appsrc. 

2013/6/27 Brendan Long <[hidden email]>: 
> On 06/27/2013 05:46 AM, [hidden email] wrote: 
> 
> However this doesn't work, It used to work fine on Gstreamer 0.10.28, but 
> now I'm using 0.10.36 and it doesn't work. 
> 
> 
> What doesn't work about? Do you get some sort of error or warning, or does 
> it just not do what you expect? 
> 
> _______________________________________________ 
> gstreamer-devel mailing list 
> [hidden email] 
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel 
> 
_______________________________________________ 
gstreamer-devel mailing list 
[hidden email] 
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

 


 

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst_element_query_duration

Brendan Long
In reply to this post by badea_ion
On 06/27/2013 05:46 AM, [hidden email] wrote:

gst_element_query_position(pipeline, &fmt, &elapsed);
In GStreamer 1.0, this should be:

gst_element_query_position(pipeline, fmt, &elapsed);

The format isn't a pointer anymore.

Your compiler should have warned you about that though..

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst_element_query_duration

Florin Curelaru
In reply to this post by badea_ion
  Hi,

 From what I have seen in your code, I'm afraid I didn't understand what exactly worked in 0.10.28 (/and now it doesn't work in 10.36).

 You inject a stream in appsrc, but nobody in the pipeline knows the length/size of the stream.

 As long as the size of the stream is not known, the duration of the stream can't be estimated correctly. In order to estimate properly the duration, a conversion from total bytes to duration is usually needed somewhere in the pipeline.

 There appsrc has a "size" property you can use it.

 Did I understand correctly the issue you had encountered?
Reply | Threaded
Open this post in threaded view
|

Re: gst_element_query_duration

Florin Curelaru
   Hi again,

 Actually, I think there is a confusion in this post as the subject/title of the post is gst_element_query_duration, but in the sample code it appears gst_element_query_position (they are totally different) and no gst_element_query_duration call.


 If you are interested in gst_element_query_position, then please tell me whether the audioresample element is active or not. In other words, when you remove audioresample, is the issue still present (assuming a common sampling rate - DEFAULT_SAMPLE_RATE in your code - like 44100)?
Reply | Threaded
Open this post in threaded view
|

Re: gst_element_query_duration

badea_ion
In reply to this post by badea_ion
Hello,

Indeed, yes, I wrongly set up the title of this post 'gst_element_query_duration' instead of 'gst_element_query_position', so the position is what matters for me.
Probably in GStreamer 1.0 there's a different sintax regarding pointers vs. references, but here I'm concerned about 0.10.28 vs. 0.10.36 versions of GStreamer because this what they use in the project I work on.

Thank you,
Dan
 

 

----- Original Message -----

From: Florin Curelaru

Sent: 06/28/13 08:25 PM

To: [hidden email]

Subject: Re: gst_element_query_duration

 
Hi again, 

 Actually, I think there is a confusion in this post as the subject/title of 
the post is gst_element_query_duration, but in the sample code it appears 
gst_element_query_position (they are totally different) and no 
gst_element_query_duration call. 


 If you are interested in gst_element_query_position, then please tell me 
whether the audioresample element is active or not. In other words, when you 
remove audioresample, is the issue still present (assuming a common sampling 
rate - DEFAULT_SAMPLE_RATE in your code - like 44100)? 




-- 
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/gst-element-query-duration-tp4660766p4660811.html 
Sent from the GStreamer-devel mailing list archive at Nabble.com. 
_______________________________________________ 
gstreamer-devel mailing list 
[hidden email] 
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

 


 

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel