RidgeRun / gst-interpipe

GStreamer plug-in for interpipeline communication
Other
143 stars 64 forks source link

interpipe 1.1.3 not working #81

Open blokfyuh opened 3 years ago

blokfyuh commented 3 years ago

Hello guys,

I decided to give a try to gstinterpipes but I can't make it work on a very simple pipeline. The build process went smoothly without any errors and/or warnings.

But when I try to launch 2 very simple pipelines nothing happen:

First pipeline being: gst-launch-1.0 -ev videotestsrc ! videoconvert ! interpipesink name=src

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, format=(string)I420, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, format=(string)I420, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstInterPipeSink:src.GstPad:sink: caps = video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, format=(string)I420, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, format=(string)I420, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

Second pipeline being gst-launch-1.0 -ev interpipesrc listen-to=src ! xvimagesink

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...

But nothing happen...

Would you have an idea of what is the issue here ? Thanks

PS: I'm on Ubuntu 18.04

rrcarlosrodriguez commented 3 years ago

Hi @blokfyuh,

When using Gstinterpipe, both interpipesrc and interpipesink elements must live under the same process. This means that you must use a single gst-launch or a single C/C++/Python application where all the pipelines live.

In your test, you are using 2 different gst-launch commands, which means that you are starting 2 different processes. This is not possible with Gstinterpipes. In order to test them, you can run the following as example:

gst-launch-1.0 -ev videotestsrc ! videoconvert ! interpipesink name=src interpipesrc listen-to=src ! xvimagesink

You can see more complex examples here

blokfyuh commented 3 years ago

Hi @rrcarlosrodriguez,

Thanks for your response. Silly me to not have thought about that. When I group the 2 pipelines under one process it does work... BUT it brought me to my real issue that I encountered before with a sandbox Python application. And with the gst-launch command now working, I got the same outcome.

It's gonna run for 6-7 seconds and start to make my computer painfully lag and then be killed by a sigkill.

GST_DEBUG=4 gst-launch-1.0 -ev videotestsrc ! videoconvert ! interpipesink name=src interpipesrc listen-to=src ! xvimagesink

The debug logs are not very informativve

0:00:06.540238647 10327 0x559c122665e0 INFO            interpipesrc gstinterpipesrc.c:435:gst_inter_pipe_src_event:<interpipesrc0> Incoming upstream event qos
0:00:06.573556208 10327 0x559c122665e0 INFO            interpipesrc gstinterpipesrc.c:435:gst_inter_pipe_src_event:<interpipesrc0> Incoming upstream event qos
0:00:06.609803024 10327 0x559c122665e0 INFO            interpipesrc gstinterpipesrc.c:435:gst_inter_pipe_src_event:<interpipesrc0> Incoming upstream event qos
0:00:06.645284821 10327 0x559c122665e0 INFO            interpipesrc gstinterpipesrc.c:435:gst_inter_pipe_src_event:<interpipesrc0> Incoming upstream event qos
0:00:06.675055375 10327 0x559c122665e0 INFO            interpipesrc gstinterpipesrc.c:435:gst_inter_pipe_src_event:<interpipesrc0> Incoming upstream event qos
Killed

Do you have an idea ?

rrcarlosrodriguez commented 3 years ago

Oh yes, that's because the videotestsrc is not a live source, and it is generating video as fast as your PC can, which tends to increase CPU and memory consumption considerably. Try this one:

gst-launch-1.0 -ev videotestsrc is-live=true ! videoconvert ! interpipesink name=src interpipesrc listen-to=src ! xvimagesink

blokfyuh commented 3 years ago

Again @rrcarlosrodriguez you're a life saver !

But do you know why I didn't think about making it a livesource ? It's because the same pipeline without the interpipes was working perfectly fine so I didn't even think about it.

Thank again Carlos. Now, I can dive into it ;)