2011-12-15 84 views
5

時的狀態。如果我有一個管道,如:的Gstreamer管道堵在預軋只給音頻視頻管線

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 ... 

回答

7

您可以只設置autovideosink的async-handling屬性爲true:

... ! autovideosink async-handling=true 

這將使audiosink,同時videosink等待播放聲音。

+2

由於某些奇怪的原因,這會將CPU使用率提高40%。爲什麼會這樣,我該怎麼辦才能解決這個問題? – 2011-12-16 21:42:34

1

它是一種一種錯誤decodebin2

看到我已經測試了一些管道的瞭解以下事項

pipeline1:

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

這個pipeline1適用於所有容器格式,如.mkv,.mp4,ogg

但是當你給編解碼器extencion文件,那麼它創造的問題,你說

我有.h264文件

pipeline2測試它:

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

pipeline3:

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

都有着同樣的問題,他們無法ahaead預加載,無法顯示,如果你只嘗試單個有效墊連接無效墊連接

的錯誤,那麼他們工作得很好

pipeline4:

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

pipeline5:

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

管道4和5優良工程

即使

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

這也將工作得很好....

我們瞭解這個bug越來越修復它,我們需要學習和變革decodebin2源代碼.........> !!!!