Connect two separate pipelines (not at the same time) to same HDMI output?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Connect two separate pipelines (not at the same time) to same HDMI output?

Maurer, Martin

Hello,

 

I have two pipelines:

One to display a live stream on a monitor.

One to decompress a video file and display it on a monitor.

 

At the moment these are two separate programs.

 

Now I want to put them into the same program, displaying the output to the same monitor.

The program shall decide which pipeline to display on the monitor, never both at the same time.

 

I found different possibilities, but what are the differences/advantages/disadvantages?

 

a) Use two valves and a funnel

Can one pipeline be playing while the other is not playing or pipeline not even existing at all?

Or do I need to add a fakesrc to input of valve for each not existing pipeline?

 

b) Use an input selector

Can one pipeline be playing while the other is not playing?

 

c) Use two output selectors (one for each pipeline) and switch between fakesink and real output.

Does the monitor of one pipeline then get free to use for other pipeline or is it still busy?

Can I take away elements from a output selector which are not actively used? Or not so easily possible?

 

d) Stop and disable first pipeline completely to free “monitor element” and (when done) use “monitor element” in second pipeline.

Would it just be enough to pause or stop the first pipeline? Or do I need to unlink the pipeline to get the monitor element free to use in another pipeline?

Or is only one pipeline supported at all per program/executable/message loop?

 

Note: Would be good if same mechanism is working in Windows and Linux.

 

Best regards,

 

Martin

 


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Connect two separate pipelines (not at the same time) to same HDMI output?

Martin Vachovski

I can suggest one more option:

Having 3 pipelines and using intevideosink / intervideosrc communication:


// First pipeline: live stream:

autovideosrc ! ... ! intervideosink channel="live_stream_channel"


// Second pipeline: file playback:

​filesrc ! ... ! intervideosink channel="file_playback_channel"


// Third pipeline: consumer:
intervideosrc name="intervideosrc_element" channel="...." ! .... ! ximagesink


In theory, I think it should be easy just to change the "channel" property

of "intervideosrc_element" to "live_stream_channel" or "file_playback_channel"  while playing, or at most you just need to stop or pause the third pipeline.

Probably care should be taken, the first and the second pipelines to output exactly the same format


About which one is the best- the best one is the easiest to try first :)


Cheers

Martin




From: gstreamer-devel <[hidden email]> on behalf of Maurer, Martin <[hidden email]>
Sent: Monday, August 21, 2017 1:42 PM
To: [hidden email]
Subject: Connect two separate pipelines (not at the same time) to same HDMI output?
 

Hello,

 

I have two pipelines:

One to display a live stream on a monitor.

One to decompress a video file and display it on a monitor.

 

At the moment these are two separate programs.

 

Now I want to put them into the same program, displaying the output to the same monitor.

The program shall decide which pipeline to display on the monitor, never both at the same time.

 

I found different possibilities, but what are the differences/advantages/disadvantages?

 

a) Use two valves and a funnel

Can one pipeline be playing while the other is not playing or pipeline not even existing at all?

Or do I need to add a fakesrc to input of valve for each not existing pipeline?

 

b) Use an input selector

Can one pipeline be playing while the other is not playing?

 

c) Use two output selectors (one for each pipeline) and switch between fakesink and real output.

Does the monitor of one pipeline then get free to use for other pipeline or is it still busy?

Can I take away elements from a output selector which are not actively used? Or not so easily possible?

 

d) Stop and disable first pipeline completely to free “monitor element” and (when done) use “monitor element” in second pipeline.

Would it just be enough to pause or stop the first pipeline? Or do I need to unlink the pipeline to get the monitor element free to use in another pipeline?

Or is only one pipeline supported at all per program/executable/message loop?

 

Note: Would be good if same mechanism is working in Windows and Linux.

 

Best regards,

 

Martin

 


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Connect two separate pipelines (not at the same time) to same HDMI output?

Baby Octopus
Using output-selector would be more apt. That is precisely what it is meant for. You just need to set async=1 appropriately so that unconnected sync wont choke the pipeline to start with
Reply | Threaded
Open this post in threaded view
|

AW: Connect two separate pipelines (not at the same time) to same HDMI output?

Maurer, Martin
Hello Baby Octopus,

first many thanks for your answer!

Can you confirm you meant output-selector? Not input-selector?

I have two outputs which I want to fill into one monitor.
So in my first thought input-selector would be the right one.

But also using two output-selector, one for each pipeline would be an idea.
Switch between HDMI monitor and fakesink.

output-selector
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-output-selector.html
does have the following pads:
active-pad
pad-negotiation-mode
resend-latest

input-selector
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-input-selector.html
does have the following pads:
active-pad
cache-buffers
n-pads
sync-mode
sync-streams

But there is no parameter async in both of them? Do you mean one of sync-mode or sync-streams?

Best regards,

Martin

-----Urspr√ľngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]] Im Auftrag von Baby Octopus
Gesendet: Montag, 21. August 2017 16:23
An: [hidden email]
Betreff: Re: Connect two separate pipelines (not at the same time) to same HDMI output?

Using output-selector would be more apt. That is precisely what it is meant for. You just need to set async=1 appropriately so that unconnected sync wont choke the pipeline to start with



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Connect-two-separate-pipelines-not-at-the-same-time-to-same-HDMI-output-tp4684276p4684278.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: AW: Connect two separate pipelines (not at the same time) to same HDMI output?

Vinod Kesti
You need input-selector in your use case.


Set sync-streams=false if incoming time stamp not to be synchronised.