duration calculation in baseparse requires 1.5 seconds of audio buffer.

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

duration calculation in baseparse requires 1.5 seconds of audio buffer.

Darshan b
This post was updated on .
Hi,

I have an AC3 file which is a valid file(Do not have any corrupted data but
a VBR file). I have constructed the pipeline for this file using ac3parser.
The playback works fine. The problem here is I am not setting the pipeline to
play state. The pipeline has prerolled and is in pause state. If I now
request the duration using gst_element_query_duration, The duration query
fails. I have gone through the baseparse and I have found out that the base
parse uses the below formula to determine the number of frames required to
calculate the duration.

update_interval = (fps_num/fps_den)*1.5.

The comment for the formula says that it is estimated after receiving 1.5
seconds of data which is about 50 buffers.

My questions are
1. What are the side effects of reducing this number? The duration will not
be accurate and anything apart from that?
2. Is there any particular reason to set the number as 1.5?




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: duration calculation in baseparse requires 1.5 seconds of audio buffer.

Nicolas Dufresne-5


Le 6 août 2018 04:30, "Darshan b" <[hidden email]> a écrit :
Hi,

I have an AC3 file which is a valid file(Do not have any corrupted data but
a VBR file). I have constructed the pipeline for this file using ac3parser.
The playback works fine. The problem here is I am setting the pipeline to
play state. The pipeline has prerolled and is in pause state. If I now
request the duration using gst_element_query_duration, The duration query
fails. I have gone through the baseparse and I have found out that the base
parse uses the below formula to determine the number of frames required to
calculate the duration.

update_interval = (fps_num/fps_den)*1.5.

The comment for the formula says that it is estimated after receiving 1.5
seconds of data which is about 50 buffers.

My questions are
1. What are the side effects of reducing this number? The duration will not
be accurate and anything apart from that?

The duration is estimated from the file size and an estimate of the bitrate. A lot of files have a relatively large period of silence at the start, so lower value will indeed lead to less precise estimates (likely duration will be longer then the reality).

2. Is there any particular reason to set the number as 1.5?

I don't know any reason, it was probably left to the contributor discretion. Hopefully it is a value that performs well.



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