简体   繁体   中英

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

This will allow audiosink to play sound while videosink is waiting.

Its a one kind of bug of decodebin2

see i have tested some pipelines and get to know following things

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

but when you give codec extencion file then it create problem which you have said

i have tested it with .h264 file

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

all has same problem they are unable to preloading ahaead and unable to showing error of invalid pad connection

if you try only single valid pad connection then they works fine

pipeline4:

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

pipeline5:

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

pipeline 4 and 5 works fine

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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