Appsink Vs. Last-Sample
Nirbheek Chauhan
nirbheek.chauhan at gmail.com
Thu Mar 16 16:12:18 UTC 2017
On Thu, Mar 16, 2017 at 8:49 AM, Brendan Lockhart <somedude114 at gmail.com> wrote:
> I am using Gstreamer to render live video with Unity3D. Currently, I append
> a fakesink to my pipeline, and at every frame of the Unity application the
> fakesink's last-sample is queried and used to update a texture.
>
> This works, but I feel that the performance of the plugin is a bit lacking.
> I'm considering rewriting the plugin to instead use an appsink.
>
> My question is: does querying appsink samples have any different performance
> characteristics relative to querying a fakesink's last-sample?
>
Are you connecting to the last-sample signal and running a callback?
If so, there is a noticeable difference between using a gobject signal
for running a callback vs using a function call in libgstapp. You can
try using gst_app_sink_pull_sample() and friends.
However, I think you should do some performance measurements first. I
suspect that since you're doing GL rendering, most of your overhead is
in copying video buffers around and the function call vs. signal
callback overhead is minor in comparison. In that case, you should be
using glimagesink to write directly to a GL texture. Here's some
examples that do this with SDL2:
https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/tests/examples/gl/sdl
Cheers,
Nirbheek
More information about the gstreamer-devel
mailing list