Using GStreamer AppSink from Python

So I decided to play a bit with how to get raw audio samples from gstreamer pipelines. This is normally done (in C or whatever) with an `appsink` element in your gstreamer pipeline. You hook up the pipeline, watch for the buffer, and then you can map it into a Numpy buffer (or whatever you like really). I haven't actually got a use-case for this right now; when I sat down I was toying with the idea of running neural nets on the samples to try to detect phonemes, but that will be some other day.

For today, consider this spike test sample code for how to use an appsink in python-gstreamer.

Still to figure out; whether you can get a nice ring-buffer or similar setup where you pre-map the Gstreamer appsink's buffers onto N numpy arrays such that gstreamer is filling out the arrays and your new-buffer callbacks just update the current ring-buffer indices.


  1. i love jesus charm

    i love jesus charm on 09/12/2014 4:32 p.m. #

    Hello there, just became alert to your blog through Google, and found that it is really informative.
    I'm going to watch out for brussels. I will appreciate if you continue thius in future.
    Many people will be benefited from your writing.


Pingbacks are closed.

Post your comment