【问题标题】:Gstreamer pipeline stuck in prerolling state when giving only audio to video pipeline仅向视频管道提供音频时,Gstreamer 管道卡在预滚动状态
【发布时间】:2011-12-15 22:50:29
【问题描述】:

如果我有这样的管道:

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

如何在输入源中没有视频时播放它,但如果有视频则播放?我得到的只是:

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

【问题讨论】:

    标签: c audio video gstreamer


    【解决方案1】:

    您只需将 autovideosink 的 async-handling 属性设置为 true:

    ... ! autovideosink async-handling=true
    

    这将允许 audiosink 在videosink 等待时播放声音。

    【讨论】:

    • 出于某种奇怪的原因,这将 CPU 使用率提高了 40%。为什么会这样,我应该怎么做才能解决这个问题?
    • @DK,不知道,但我会尝试调查为什么会这样
    • 我遇到了 glimagesink 的问题,它非常滞后并导致 audiosink 饿死,我不想使用 T 恤。这成功了!谢谢!
    【解决方案2】:

    它是一种decodebin2的bug

    看到我已经测试了一些管道并了解以下内容

    管道1:

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

    此管道1 适用于所有容器格式,如 .mkv、.mp4、ogg

    但是当您提供编解码器扩展文件时,它会产生您所说的问题

    我已经用 .h264 文件对其进行了测试

    管道2:

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

    管道3:

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

    都有同样的问题,无法提前预加载,也无法显示无效焊盘连接错误

    如果您只尝试单个有效的焊盘连接,那么它们可以正常工作

    管道4:

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

    管道5:

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

    管道 4 和 5 工作正常

    甚至

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

    这也可以正常工作....

    现在要更多地了解这个错误并修复它,我们需要研究和更改 decodebin2 源代码......>!!!!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-09-27
      • 2017-06-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-20
      • 2014-02-09
      相关资源
      最近更新 更多