Correspondence between appsrc input and appsink output buffers

Benjamin Hepp benjamin.hepp at posteo.de
Wed Nov 9 04:04:31 UTC 2016


Hi Sebastian,

thanks for this tip, it works like a charm. I wouldn't have figured out 
that I can use GstMeta for this.

One note for others who might try to do something similar: Depending on 
the pipeline one has to lower the refcount of the destination buffer to 
1 within the meta transformation function. Otherwise the buffer cannot 
be mapped writable and thus the GstMeta fails to be attached to the 
buffer. This seems to be an ok workaround though.

Cheers
Benjamin

On 07.11.2016 01:36, Sebastian Dröge wrote:
> On Sun, 2016-11-06 at 02:35 +0100, benjamin.hepp at posteo.de wrote:
>> Hi everyone,
>>
>> I'm new to gstreamer (it's great!) so I very much appreciate any help.
>>
>> I basically have the following setup:
>> Custom video-source -> appsrc -> encoding -> appsink -> send over
>> network together with other information that corresponds to each frame
>> (e.g. GPS).
>> On the server I receive buffer and associated information -> appsrc ->
>> decoding -> appsink.
>>
>> Now in both cases I push a buffer into an appsrc that has some
>> associated information. Is there any way to link this information again
>> to a buffer coming out of the appsink?
>>
>> I now that theoretically there is no guarantee that one buffer out of
>> the appsink is one frame, but in my case it is. So on the client side I
>> can just assume that no frame is ever dropped (assuming I never hit any
>> buffer limit).
>> However, on the receiving side the decoder sometimes needs to drop some
>> frame until it can start decoding and I don't know how many it drops. So
>> I'm in the situation that I cannot link the information to the buffers
>> coming out of the appsink.
>> Unfortunately I can't use the buffer offset or PTS information because
>> this is just reset by the encoder/decoder.
>>
>> Is there any other way to establish these correspondences?
> You could mark buffers with a GstMeta (make sure to use new enough
> GStreamer, and a GstMeta that has no tags) or use serialized events
> between each buffer as markers (not very efficient).
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20161108/23ca0f34/attachment.html>


More information about the gstreamer-devel mailing list