(Not quite) understanding the appsrc

Florian Echtler floe at butterbrot.org
Wed Feb 17 14:06:20 UTC 2016


Hello Sebastian,

On 16.02.2016 09:08, Sebastian Dröge wrote:
> On Mo, 2016-02-08 at 21:31 +0100, Florian Echtler wrote:
>> [...]
>>   /* setup appsrc */
>>   g_object_set (G_OBJECT (appsrc),
>>     "stream-type", 0, // GST_APP_STREAM_TYPE_STREAM
>>     "format", GST_FORMAT_TIME,
>>     "is-live", TRUE,
>>     "min-latency", 0,
>>     "max-latency", gst_util_uint64_scale_int (1, GST_SECOND, 30),
>>     "do-timestamp", TRUE,
>>   NULL);
>>  
>> As mentioned above, this works as intended. However, the whole
>> program leaks memory like crazy (the buffers _are_ freed correctly,
>> but not as fast as new ones are created) and the output starts
>> lagging more and more badly. AFAICT the appsrc can be told to discard
>> old buffers to keep up, but seems to be queueing them instead.
>>
>> Would be grateful for any hints on how to fix this (maybe using
>> min-latency and max-latency?)
> 
> The latency settings you have there don't make much sense and you
> should better keep the defaults :)

OK :-) Is there any additional documentation for these properties
besides the one-liners in the FDO docs? From that documentation alone, I
have obviously misunderstood them completely...

> So the question here is why and where buffers are piling up. appsrc
> only should buffer up to a frame or 200kb (whichever comes first) of
> buffers, so in your case one frame. You can check that with the
> "current-level-bytes" property. However it only does that if "block" is
> set to TRUE (the default is FALSE), otherwise it assumes that you
> listen to the "enough-data" signal and stop pushing data until it
> reports "need-data" again.
> 
> So try setting "block" to TRUE and see if that helps in your case.

Yes, that indeed seems to have done the trick. Thanks for your help!

Best regards, Florian
-- 
SENT FROM MY DEC VT50 TERMINAL

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160217/f88ae215/attachment.sig>


More information about the gstreamer-devel mailing list