Assigning Buffer Timestamps

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

Assigning Buffer Timestamps

johnwesting
This post was updated on .
Hi, I really need some help understanding how timestamps are used in GStreamer. I've been working with GStreamer for about 6 months and have had several problems with timestamps and cooperation with elements like alsasink and liveadder. I've made several attempts to set the buffer timestamps correctly, but every change seems to make things worse, i.e. elements like alsasink no longer play the audio. At the moment I am giving up on setting the timestamp in my decoder, and just setting it to GST_CLOCK_TIME_NONE because I always get the best results with alsasink. I want to to do it right, but I don't know what right is.

The algorithm I was using in my decoder was: if the first buffer does not have a timestamp then start the outgoing timestamps at 0, else start them at the time of the first buffer. After that I increment the timestamp by the duration of the PCM buffer I pass along. I thought this was the correct solution, but using this algorithm alsasink will not play audio when it is the next element past my decoder, even with sync=false set in alsasink, and regardless of if the first buffer has a valid timestamp.

How should I be assigning the buffer timestamps?
Reply | Threaded
Open this post in threaded view
|

Re: Assigning Buffer Timestamps

Edward Hervey
Hi,

  While I could explain the various concepts of timing, synchronization
and so forth here (which is better suited for a blog/presentation)...
you could also just base your decoder on the base decoder classes and
not care about timing (it will properly propagate them from the upstream
element/demuxer/....).

  What kind of decoder is it ?

    Edward

On Tue, 2013-05-28 at 12:42 -0700, johnwesting wrote:

> Hi, I really need some help understanding how timestamps are used in
> GStreamer. I've been working with GStreamer for approximately 6 months and
> have encountered so many problems with timestamps and cooperation with
> elements like alsasink and liveadder. I've made several attempts to set the
> timestamps correctly, but every change seems to make things worse, i.e.
> elements like alsasink no longer play the audio. At the moment I am giving
> up on setting the timestamp in my decoder, and just set to
> GST_CLOCK_TIME_NONE because I always get the best results with alsasink. I
> want to to do it right, but I don't know what right is.
>
> The algorithm I was using in my decoder was: if the first buffer does not
> have a timestamp then start the outgoing timestamps at 0, else start them at
> the time of the first buffer. After that I increment the timestamp by the
> duration of the PCM buffer I pass along. I thought this was the correct
> solution, but using this algorithm alsasink will not play audio when it is
> the next element past my decoder, even with sync=false set in alsasink, and
> regardless of if the first buffer has a valid timestamp.
>
> How should I be assigning the buffer timestamps?
>
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Assigning-Buffer-Timestamps-tp4660123.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