i've written a custom QtGStreamer appsink which is working fine. I'm in trouble trying to split with a tee the pipeline to process recording of the stream because the pipeline starts to preroll but never goes in playback state.
My pipeline:
souphttpsrc location="%1" ! queue ! tee name=tp tp.! queue ! tsdemux ! h264parse ! splitmuxsink muxer=mpegtsmux location=/tmp/rec/video%02d.mov max-size-time=60000000000 max-size-bytes=100000000 tp.! queue ! appsink name="mysink"
If i comment any of the two tee branches anything works as expected.
This is also working:
souphttpsrc location="%1" ! queue ! tee name=tp tp.! queue ! tsdemux ! h264parse ! splitmuxsink muxer=mpegtsmux location=/tmp/rec/video%02d.mov max-size-time=60000000000 max-size-bytes=100000000 tp.! queue ! decodebin ! autovideosink
Why is my AppSink working just alone?
Too big for comment..
How do you process appsink buffers? Its in main thread and you are getting the buffers by blocking calls or are you waiting on new-sample/new-preroll signals (which are non blocking - sort of push style)?
Check this for what I mean(the appsink chapter):
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-data-spoof.html
Is your application blocked?
I suspect(I may be wrong) that the appsink is blocked because it is flooded by many buffers.. the tee is very tricky element.. if one branch after tee wants to preroll for example 100 buffers then it causes the 100 buffers go to the other branch as well which may block for example appsink which blocks whole pipeline as you are waiting for playing state (or I dont know what you are doing in your app logic)..
You may try few things to get this sorted out:
drop=trueto the appsinkleaky=2to test if it helps (very similar to 1, just different technique)GST_DEBUG=3,queue_dataflow:5(I think it was 5 and I hope I remember the debug category for this correctly)