Run multiple pipelines in parallel into same process question
Nicolas Dufresne
nicolas at ndufresne.ca
Mon Nov 4 15:20:20 UTC 2019
Le lun. 4 nov. 2019 11 h 55, jles <jlesquer at gmail.com> a écrit :
> Hello,
>
> First of all saying that I'm relatively new with gstreamer, apologise if
> this question is too obvious and/or is already answered which in that case
> I'd appreciate the link to the answer.
>
> I've got a simple working pipeline using an appsrc element as source which
> it's got the next form:
>
> appsrc -> queue -> omxh264enc -> queue -> h264parse -> filesink
>
> The data is pushed into appsrc running a "need-data" callback function and
> a
> Gmain loop, the snippet code:
>
> loop = g_main_loop_new (NULL, FALSE);
>
> /*SETUP PIPELINE*/
>
> g_signal_connect (appsrc, "need-data", G_CALLBACK (cb_need_data),pipeline);
>
> /* play */
> gst_element_set_state (pipeline, GST_STATE_PAUSE);
> g_main_loop_run (loop);
>
>
> The pushed frames into appsrc are coming from a live camera. Now I need to
> run multiple pipelines as the described above to be able to record
> simultaneously different cameras.
>
> The first think I thought is to 'copy' the pipeline in a difference
> instances using a structure and run several main loops (g_main_loop_run )
> but the gmain loop is blocking so it only be recorded one camera as the
> rest
> won't have the chance to start once the g_main_loop_run is called.
>
> My questions are:
>
> Would it be possible to run multiple pipelines (as described above) in
> 'parallel'?
>
Yes, you can set multiple pipelines into playing state before entering your
mainloop. You can also create more later within a main loop message
(callback). Note that a mainloop is optional in GStreamer.
> What would it be the best way to do this?
>
> Thanks in advance.
>
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> 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/20191104/f017ab18/attachment.html>
More information about the gstreamer-devel
mailing list