简体   繁体   English

QtGstreamer:AppSink&tee

[英]QtGstreamer: AppSink & tee

i've written a custom QtGStreamer appsink which is working fine. 我写了一个定制的QtGStreamer appsink,工作正常。 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. 我很难尝试使用tee管道来处理流的记录,因为管道开始预卷但从不进入播放状态。

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? 为什么我的AppSink独自工作?

Too big for comment.. 评论太大了......

How do you process appsink buffers? 你如何处理appsink缓冲区? 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): 检查一下我的意思(appsink章节):

https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-data-spoof.html 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).. 我怀疑(我可能是错的)应用程序被阻止,因为它被许多缓冲区淹没..发球台是非常棘手的元素..如果一个分支在发球台后想要预先输入例如100个缓冲区然后它导致100个缓冲区去另一个分支也可以阻止例如在你等待播放状态时阻止整个管道的appink(或者我不知道你在app逻辑中做了什么)。

You may try few things to get this sorted out: 您可以尝试一些事情来解决这个问题:

  1. add drop=true to the appsink drop=true添加到appsink
  2. try adding queue parameter leaky=2 to test if it helps (very similar to 1, just different technique) 尝试添加队列参数leaky=2来测试它是否有帮助(非常类似于1,只是不同的技术)
  3. Analyze debug logs as of which queue is first blocked. 分析首先阻止哪个队列的调试日志。 Use this env variable upon running your stuff GST_DEBUG=3,queue_dataflow:5 (I think it was 5 and I hope I remember the debug category for this correctly) 运行你的东西时使用这个env变量GST_DEBUG=3,queue_dataflow:5 (我认为它是5,我希望我能正确记住调试类别)
  4. Try changing splitmuxsink for fakesink which should never block - just to test who is the culprit.. if it helps it can also mean that the splitmuxsink is the one that is requesting so many buffers. 尝试更改splitmuxsink for fakesink,它永远不会阻止 - 只是为了测试谁是罪魁祸首..如果它有帮助它也意味着splitmuxsink是请求这么多缓冲区的那个。
  5. In any case if I am all wrong you can debug with GST_DEBUG and setting levels 3,4,5 untill you find something interesting.. 在任何情况下如果我都错了你可以使用GST_DEBUG进行调试并设置3,4,5级,直到你找到一些有趣的东西..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM