GStreamer管道在播放带有非默认通道掩码的多声道音频时未能进行协商
下述流水线本应生成带有0xc0f通道掩码的音频,但它在协商caps时失败:
$ gst-launch-1.0 audiotestsrc ! "audio/x-raw,rate=44100,channels=6,channel-mask=0xc0f" ! fakesink sync=TRUE
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0: Internal data stream error.
Additional debug info:
../gstreamer1/libs/gst/base/gstbasesrc.c(3134): gst_base_src_loop (): /GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
然而,它对于2 通道0x3的音频工作正常:
$ gst-launch-1.0 audiotestsrc num-buffers=3 ! "audio/x-raw,rate=44100,channels=2,channel-mask=0x3" ! fakesink sync=TRUE
第一条流水线有什么问题?
解决方案
问题在于这条有问题的流水线没有指明 channel-mask 属性的类型是位掩码。
下面的流水线可以工作:
gst-launch-1.0 audiotestsrc num-buffers=3 ! "audio/x-raw,rate=44100,channels=6,channel-mask=(bitmask)0xc0f" ! fakesink sync=TRUE
在对 channel-mask 进行赋值时,请注意 (bitmask)。在有问题的流水线中它缺失。
站内所有文章版权归属LeftHeroAI导航站,无授权禁止任何主体转载、抄袭、复制内容,亦不得私自架设镜像站点。一经侵权,本站将通过法律途径追责。