trying to get tee working

Marianna Smidth Buschle msb at qtec.com
Fri Sep 17 08:54:26 UTC 2021


Hi Marc,

strsink has a property called "wait-for-connection" (Block the stream 
until a client connects) which is by default true.

   wait-for-connection : Block the stream until a client connects
                         flags: læselig, som kan skrives
                         Boolean. Default: true

So when you have a tee before strsink it gets full (because srtsink is 
not consuming any buffers).

Setting it to leaky makes it drop buffers. leaky=1 means drop new 
buffers, leaky=2 means drop old buffers.

In my pipelines I normally use leaky=2 because then I have a change to 
"catch up".


However, in the tests I have done with srtsink I didn't get much good 
behavior when having a leaky queue before (while having 
"wait-for-connection=true").

No idea why, somebody that understands SRT might be able to answer...


Now I can't test with VLC only with gstreamer:

This works for me as long as I connect both clients (because if you only 
have one of the clients the 2nd tee branch is blocking):

gst-launch-1.0 -vv srtsrc uri=srt://10.10.150.36:55555?mode=listener ! tee name=t \
     t. ! queue ! srtsink uri=srt://:33333 \
     t. ! queue ! srtsink uri=srt://:33334
gst-launch-1.0 -vv srtsrc uri=srt://10.10.150.36:33333 ! decodebin ! queue ! videoconvert ! autovideosink sync=0
gst-launch-1.0 -vv srtsrc uri=srt://10.10.150.36:33334 ! decodebin ! queue ! videoconvert ! autovideosink sync=0

And if I add wait-for-connection=false for all srtsinks it works with a 
single client (though it still takes something like ~9secs).


Now when I add your demux branch I can see it doesn't work, it seems 
stalled (clock doesn't run, event though it should since 
wait-for-connection=false).

Making the queues leaky or not didn't make any difference for me.

And I could see that if I had a tee with a single branch it worked 
(clock runs). But as soon as I add a second branch (even if it is only a 
fakesink) it stalls.


I played around with settings and found out that making srtsink async=0 
got it to work (No idea why...):

gst-launch-1.0 -vv srtsrc uri=srt://10.10.150.36:5555 ! tee name=t ! queue \

! tsdemux ! h264parse ! mpegtsmux name=mux ! tsparse ! srtsink 
uri=srt://:33334 wait-for-connection=false async=0 \

t. ! queue ! srtsink uri=srt://:33333 wait-for-connection=false async=0 
--gst-debug=*:3


And if I look at the debug messages from this pipeline I get about 8 
seconds of this:

0:00:08.359881732 25752 0x55c43fab5d20 WARN h264parse 
gsth264parse.c:1490:gst_h264_parse_handle_frame:<h264parse0> 
broken/invalid nal Type: 1 Slice, Size: 6139 will be dropped

Which explains why it takes ~9seconds for the images to show.

Why this is happening I don't know...


Marianna


On 16.09.2021 14.00, gstreamer-devel-request at lists.freedesktop.org wrote:
> I have problems understanding tee and getting a simple solution to work, splitting a live stream and using one stream for some processing or so. I am using this command to generate a test stream[1]
> Why do I have to add the leaky=1 to get this to work? (Just grabbed this from some example, but most tee examples do not have this). And why does this then not work when I add some processing to the 2nd stream? Th
>
>
>
> working (as in plays with a vlc client)
> =======
> gst-launch-1.0 -vv srtsrc uri=srt://:55555?mode=listener ! tee name=t \
>      t. ! queue leaky=1 ! srtsink uri=srt://:33333 \
>      t. ! queue leaky=1 ! srtsink uri=srt://:33334
> (although it takes 9s before the video appears)
>
>
>
> not working
> ===========
> gst-launch-1.0 -vv srtsrc uri=srt://:55555?mode=listener ! tee name=t \
>      t. ! queue ! srtsink uri=srt://:33333 \
>      t. ! queue ! srtsink uri=srt://:33334
>
> gst-launch-1.0 -vv srtsrc uri=srt://:55555?mode=listener ! tee name=t \
>      t. ! queue leaky=1 ! srtsink uri=srt://:33333 \
>      t. ! queue leaky=1 ! tsdemux ! video/x-h264 ! h264parse ! mpegtsmux name=mux ! tsparse ! srtsink uri=srt://:33334
>
> gst-launch-1.0 -vv srtsrc uri=srt://:55555?mode=listener ! tee name=t \
>      t. ! queue leaky=1 ! srtsink uri=srt://:33333 sync=false \
>      t. ! queue leaky=1 ! tsdemux ! video/x-h264 ! h264parse ! mpegtsmux name=mux ! tsparse ! srtsink uri=srt://:33334 sync=false
>
>
> [1]
> gst-launch-1.0 videotestsrc !  x264enc ! mpegtsmux name=mux ! srtsink uri=srt://192.168.10.22:55555?mode=caller \
>    audiotestsrc wave=pink-noise ! avenc_ac3 ! mux.

-- 
Best regards / Med venlig hilsen
“Marianna Smidth Buschle”



More information about the gstreamer-devel mailing list