On Thu, 1 Mar 2018 22:07:35 -0700 (MST)
Nostalgia <[hidden email]> wrote:
> Hi everyone,
> I am interested in using appsrc for pushing data from an application to a
> gstreamer pipeline, and this for my university final project. Till now, they
> don't tell me what application I should use to produce multimedia data
> (probably it is yuv video/file) to be pushed to the pipeline (to processing
> the data and encode it ...). But I should, as first step, to understand the
> concept of gstreamer's pipeline and to make an example using appsrc. But I
> don't succeed to understand very well the concept of appsrc, so I found a
> code (this one is used by many people, and I put it in the end of my
> message) and I try it, but I didn't understand where is the data that we
> should push to the pipeline ?
appsrc is used BY/IN the program which produces the data, to push
the data TO a GStreamer pipeline.
Conversely appsink is used to get data FROM a GStreamer pipeline.
These are mechanisms to integrate GStreamer *inside* the code of a
If you are interfacing with *external* applications on which you have
no control, there could be other mechanisms you could use to pass data
to GStreamer, depending on how the external application "exposes" the
produced data: does it write it to a file? Does it stream it via some
> From where the data will be pushed when executing the code ?
In the example you posted the data is *created* and pushed in
push_buffer() its' just that it's some dummy uninitialized data
because this is a trivial test application.
> What is the meaning of "is-live" property of appsrc ?
It affects how the synchronization with the other GStreamer elements in
the pipeline is performed, in this case it shouldn't really matter
if it's true or false because the sink is a file.
However others may provide better info on this point.
> When executing the code, from where data will be pushed to the appsrc ?
In this case the application is using some trivial data obtained
directly in push_buffer(), but in a real case you would have the data
provided by some other mechanism and then you'd have to wrap it into a
GstBuffer before pushing it.
> Thanks for helping me to understand the concept of using appsrc in general
> and how we can test the following code :
You just compile it and run it, and it will create an audio file with
unspecified content. It may be silence, it may be clicks, depending on
the memory content at the time of allocation.