使用阀门停止和恢复 splitmuxsink - Gstreamer

问题描述

我有一个完美运行的三分支管道。在一个分支中,我记录了一个带有间隔的 splitmuxsink 的文件在这个分支中,队列元素之后有一个阀门来停止和恢复与我的逻辑有关的分支。但是,当我将阀门的值设置为 True 时,分支似乎停止了,但我假设 max-size-time(splitmuxsink) 仍在计数,因为打开阀门时会产生垃圾文件,并且不会继续写入在我停止时未完成的文件。在垃圾文件中,只显示暂停记录的最后一帧,持续时间等于停止和恢复操作之间经过的时间。在垃圾文件之后,splitmuxsink 以预期的方式运行并生成正常文件,直到我再次使用阀元件点击恢复

我使用 python Gst 绑定进行开发,splitmuxsink 分支代码是:

 tee = Gst.ElementFactory.make('tee','tee')
 fileQueue = Gst.ElementFactory.make('queue','file_queue')
 self.fileValve = Gst.ElementFactory.make('valve','file_valve')
 self.fileValve.set_property("drop",not self.writedisk)
 omxencode = Gst.ElementFactory.make('omxh264enc','omxencode')
 h264Parser = Gst.ElementFactory.make('h264parse','h264parser')
 muxer = Gst.ElementFactory.make('matroskamux','file_muxer')
 muxer.set_property("offset-to-zero",True)
 infileSink = Gst.ElementFactory.make('filesink','infile_sink')
 infileSink.set_property("async",True)
 fileSink = Gst.ElementFactory.make('splitmuxsink','file_sink')
 fileSink.set_property('async-handling',True)
 fileSink.set_property("max-size-time",1000000000 * 60 * 1)
 fileSink.set_property("muxer",muxer)
 fileSink.set_property("sink",infileSink)
 fileSink.connect("format-location",self.__format_location_callback)

如何使用 splitmuxsink 和阀门管理正确的停止和恢复操作,或者是否有其他适当的解决方案? 谢谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)