Slow Memory Access in AppSink

Kazanian knoelker at onexip.com
Tue Sep 1 07:44:08 UTC 2020


Hi,

I'm working with an  NXP i.MX8M and I have built a GStreamer-pipeline where
I decode a H264-stream and put the data in an appsink. In the
appsink-callback-function, I do some resorting of all pixels to get it in a
different format. The pipeline looks like this:
H264-file -> h264parse -> vpudec -> appsink -> resorting algorithm

It works so far, but to get memory access to the frame buffer in the
callback-function, I use the function gst_buffer_map with the flag
GST_MAP_WRITE and it takes too much time. For a 1920x1080 video frame, it
takes 34 ms and then the resorting algorithm takes 5 ms.  If I use
GST_MAP_READ instead, the map function is fast (0.02 ms), but then the
resorting algorithm takes much longer. Probably because the data has to be
fetched from some other memory.
What exactly is the reason for this? What can I do to make the mapping
faster?

My idea to solve this was to allocate a few buffers before starting the
pipeline and call gst_buffer_map with flag GST_MAP_WRITE on these buffers
beforehand and let the gstreamer use these pre-allocated buffers. But I have
not found a way to tell gstreamer to write the decoded data into these
buffers? Is there a way to do this?

Thanks for any advice!



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list