duration calculation in baseparse requires 1.5 seconds of audio buffer.
Nicolas Dufresne
nicolas at ndufresne.ca
Mon Aug 6 13:04:26 UTC 2018
Le 6 août 2018 04:30, "Darshan b" <darshandak7347 at gmail.com> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180806/bd9c7236/attachment.html>
More information about the gstreamer-devel
mailing list