Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ...
like image 480
D K Avatar asked Dec 15 '11 22:12

D K


2 Answers

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.

like image 50
max taldykin Avatar answered Sep 27 '22 18:09

max taldykin


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

like image 40
Jeegar Patel Avatar answered Sep 27 '22 18:09

Jeegar Patel