What does a queue item do in a Gstreamer pipeline

I have this pipeline:

gst-launch -v filesrc location=video.mkv ! matroskademux name=d \
d. ! queue ! ffdec_h264 ! subtitleoverlay name=overlay ! ffmpegcolorspace ! x264enc ! mux. \
d. ! queue ! aacparse ! mux. \
filesrc location=fr.srt ! subparse ! overlay. \
matroskamux name=mux ! filesink location=vid.mkv

      

I am trying to record subtitles on video. I succeeded to read the subtitle file, but the above pipeline got stuck and I have this message:

queue_dataflow gstqueue.c:1243:gst_queue_loop:<queue0> queue is empty

      

What's wrong with my conveyor? What does a queue item do? I didn't quite understand what he said at the dock.

+3


source to share


2 answers


The queue item adds a stream boundary to the pipeline and supports buffering. The input side places buffers on a queue, which is then freed on the output side from another thread. Through the properties on the queue item, you can set the queue size and some other things.

I don't see anything specific in your pipeline, but the message there tells you that at some point one of the queues is empty. What could be a problem or not. This may become more complete later on.



You will need to check the GStreamer debug logs to see if there is anything that suggests the actual problem. My best guess here would be that the audio queue works entirely due to the x264enc encoding latency. Try making the audio queue larger or set tune = zerolatency to x264enc.

Also I can see that you are using GStreamer 0.10. It is no longer supported since more than two years, and for new applications you should really consider upgrading to 1.x.

+6


source


A queue is a stream boundary element through which you can enforce streams. It does this using the classic supplier / consumer model, which is learned in streaming classes at universities around the world. By doing this, it acts as a means to provide data throughput between threads that are thread safe, and can also act as a buffer. Queues have several GObject properties to customize for specific purposes. For example, you can set the lower and upper thresholds for an element. If there is less data than the lower threshold (default: disabled), it blocks the output. If there is more data than the high threshold, it blocks input or (if configured to do so) deletes data.



To use a queue (and therefore force two separate threads in a pipeline), you can simply create a queue item and place it as part of the pipeline. GStreamer will take care of all the granularity.

0


source







All Articles