Queue prevents pipeline to preroll

Tim-Philipp Müller t.i.m at zen.co.uk
Mon Dec 12 12:00:39 UTC 2022


On Mon, 2022-12-05 at 12:16 -0300, Rodrigo Santos via gstreamer-devel
wrote:

Hi Rodrigo,

> I have this pipeline that works without issues:
> 
> gst-launch-1.0.exe filesrc location="$LOCATION" ! decodebin
> name=decoder ! audioresample ! audioconvert ! autoaudiosink decoder.
> ! autovideosink
> 
> We are developing our own plugin with a custom buffering strategy. To
> better understand how buffering works in pipelines I'm using a queue
> after filesrc, the idea is to later add our custom element before the
> queue. However, I noticed that for some files this pipeline never
> prerolls:
> 
> gst-launch-1.0.exe filesrc location="$LOCATION" ! queue ! decodebin
> name=decoder ! audioresample ! audioconvert ! autoaudiosink decoder.
> ! autovideosink
> 
> PS: same behavior happens if I use queue2 or multiqueue. Here's the
> output:
> 
> gst-launch-1.0.exe filesrc location="$LOCATION" ! queue ! decodebin
> name=decoder ! audioresample ! audioconvert ! autoaudiosink decoder.
> ! autovideosink 
> 
> (snip output)
> 
> It shows the first video frame and gets stuck. The weird thing is
> that if I link ONLY video or ONLY audio-related elements to the
> decode bin the pipeline executes without problem. That is, the
> following pipelines work:
> 
> without video:
>       gst-launch-1.0.exe filesrc location="$LOCATION" ! queue !
> decodebin name=decoder ! audioresample ! audioconvert !
> autoaudiosink 
> 
> without audio:
>       gst-launch-1.0.exe filesrc location="$LOCATION" ! queue !
> decodebin name=decoder ! autovideosink
> 
> Could someone help me understand what is going on? It seems the issue
> only happens with some files. The issue I just reported is happening
> when $LOCATION is set to this
> file: CRAZYCAR_HD_422_23p98_STEREO_MiniClip_20211021_2.mov - Google
> Drive

In addition to Edward's comment: If you put a queue element after
filesrc this will force a demuxer in a suboptimal mode of reading the
file, disabling random access. This might not be a problem for
streaming formats, but in an mp4 file the actual audio/video data can
be anywhere in the file. I didn't look at your particular file though
to see if that's an issue there.

What do you actually mean by "buffering" here? What is it you're trying
to solve/achieve?

Cheers
 Tim


More information about the gstreamer-devel mailing list