1

I'm working for a few days now on a pipeline with the following configuration : - 2 live input streams (RTMP) - going into one compositor - outputing to another RTMP stream

With some converter, queue, etc. in between, it works pretty well.

But my problem is that one of the RTMP input may not be available at start time, so the pipeline can't start, crashing with the followings errors: - error: Failed to read any data from stream - error: Internal data flow error

What would be the proper way to make this work, that is, to start the stream with the first input, even if the second one is not ready yet ?

I tried several ways : dynamically changing the pipeline, playing with pad probes, listening to error message, .. but so far I can't make it work.

Thanks, PL

PLC
  • 11
  • 2

1 Answers1

0

As you didnt post any code I guess you are ok with conceptual answer..

There are few options for rtspsrc with which you can control when it will fail - reagarding timeout exceeded or number of trials exceeded maximum. Those are (not sure if all):

retry - this may be not very useful if it deals only with ports ..
timeout - if you want to try with UDP some longer time you can enlarge this one
tcp-timeout - this is important, try to play with it - make it much larger
connection-speed - maybe it will help to make smaller this one
protocols - I have experience that for bad streams TCP was much better for me

The actual concept (I am not an expert, take it as another view to the problem):

You can create two bins - one for each stream. I would use rtspsrc and decodebin and block the output pads of decodebin untill I have all the pads, then I would connect to the compositor.

When you recieve any error (it should be during the phase of waiting for all pads) then you would put the bin to NULL state (I mean GStreamer state called NULL) and PLAYING/PAUSED again.. Well you have to use the pad probles properly (no idea what that is :D) .. can you post your code regarding this? Maybe try to discard the error message to not disintegrate the pipe..

Also, do you have only video inputs? I guess no, you can use audiomixer for audio.. also the compositor has nice OpenGL version which is much faster its called glvideomixer.. but it may introduce another OpenGL related problems.. if you have intel GPUs then you are probably safe.

nayana
  • 3,787
  • 3
  • 20
  • 51