简体   繁体   English

当仅向视频管道提供音频时,Gstreamer管道处于预卷状态

[英]Gstreamer pipeline stuck in prerolling state when giving only audio to video pipeline

If I have a pipeline like: 如果我有一个像这样的管道:

gst-launch filesrc location="/home/dk/Music/Vangelis - Alpha.mp3" !
decodebin2 name=dec !
queue ! ffmpegcolorspace ! autovideosink dec. !
queue ! audioconvert ! audioresample ! autoaudiosink

How to I get it to play when there is no video in the input source, but play video if there is? 当输入源中没有视频时如何让它播放,但如果有视频则播放视频? All I get is: 我得到的只是:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...

You can just set autovideosink's async-handling property to true: 您可以将autovideosink的async-handling属性设置为true:

... ! autovideosink async-handling=true

This will allow audiosink to play sound while videosink is waiting. 这将允许audiosink在视频链接等待时播放声音。

Its a one kind of bug of decodebin2 它是decodebin2的一种bug

see i have tested some pipelines and get to know following things 看到我测试了一些管道,并了解了以下事项

pipeline1: pipeline1:

gst-launch filesrc location="filename" !
decodebin2 name=dec !
queue ! ffmpegcolorspace ! autovideosink dec. !
queue ! audioconvert ! audioresample ! autoaudiosink

this pipeline1 works fine with all container formats like .mkv,.mp4,ogg 此管道1适用于所有容器格式,如.mkv,.mp4,ogg

but when you give codec extencion file then it create problem which you have said 但是当你给codec extencion文件然后它会产生你所说的问题

i have tested it with .h264 file 我用.h264文件测试过它

pipeline2: pipeline2:

 gst-launch filesrc location="smal.h264" ! decodebin2 name=dec ! queue !
 autovideosink dec. ! queue ! autoaudiosink

pipeline3: pipeline3:

 gst-launch filesrc location="smal.aac" ! decodebin2 name=dec ! queue !
 autovideosink dec. ! queue ! autoaudiosink

all has same problem they are unable to preloading ahaead and unable to showing error of invalid pad connection 所有都有同样的问题他们无法预加载ahaead并且无法显示无效的pad连接错误

if you try only single valid pad connection then they works fine 如果你只尝试单个有效的pad连接,那么它们工作正常

pipeline4: pipeline4:

 gst-launch filesrc location="smal.h264" ! decodebin2 ! autovideosink 

pipeline5: pipeline5:

 gst-launch filesrc location="smal.aac" ! decodebin2 ! autoaudiosink

pipeline 4 and 5 works fine 管道4和5工作正常

even 甚至

gst-launch filesrc location="/home/dk/Music/Vangelis - Alpha.mp3" !
decodebin2 ! audioconvert ! audioresample ! autoaudiosink

this will also works fine.... 这也行得正常....

Now to understand this bug more and fixing it we need to study and change decodebin2 source code.........>!!!! 现在更多地了解这个bug并修复它我们需要研究和更改decodebin2源代码.........> !!!!

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

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