gstreamer pipeline with VADER element stalls on PAUSE when used with a tee

限于喜欢 提交于 2019-12-12 00:28:30

问题


I have this pipeline that uses pocketsphinx's VAD element :

            Gst.parse_launch(
              "pulsesrc device=\"alsa_input.usb-046d_08c9_674634A4-02-U0x46d0x8c9.analog-mono\" " +
              "! vader name=vad auto-threshold=true " +
              "! level name=wavelevel interval=100000000 " + // level interval is in nanoseconds 
              "! wavenc " +
              "! filesink location=audioz.wav"
            );

It works fine except that the streaming stops when there is no voice comming in the source.

I want to recording to continue independently of the VAD, so I tried this pipeline with a tee :

            Gst.parse_launch(
              "pulsesrc device=\"alsa_input.usb-046d_08c9_674634A4-02-U0x46d0x8c9.analog-mono\" " +
              "! tee name=t " +
              "! queue " +
              "! vader name=vad auto-threshold=true " +
              "! fakesink t. sync=false" +
              "! queue " +
              "! level name=wavelevel interval=100000000 " + // level interval is in nanoseconds 
              "! wavenc " +
              "! filesink location=audioz.wav"
            );

And this one is always stalling, state going from NULL -> READY -> PAUSE, and stalling forever on PAUSE.

The goal of the "independent VAD" is simply to record the begining and end time of voice segments (detected by the VAD).

Update :

commenting the line : "! fakesink t. sync=false" solves the problem, so the following pipeline does what I need :

            this.pipeline = Gst.parse_launch(
              "pulsesrc device=\"alsa_input.usb-046d_08c9_674634A4-02-U0x46d0x8c9.analog-mono\" " +
              " ! tee name=t" +
              " t. ! queue " +
              " ! vader name=vad auto-threshold=true " +              
              " t. ! queue " +
              " ! level name=wavelevel interval=1000000000 " + // level interval is in nanoseconds 
              " ! wavenc " +
              " ! filesink location=audioz.wav"
            );

The remaining question is if it's OK to have a queue without a sink...


回答1:


The easiest solution is to set async=0 on both sinks. (fakesink and filesink)



来源:https://stackoverflow.com/questions/19504257/gstreamer-pipeline-with-vader-element-stalls-on-pause-when-used-with-a-tee

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!