buffer v4l2src for 30 seconds

Antoine Martin antoine at nagafix.co.uk
Mon Dec 5 12:43:48 UTC 2016


Hi,

I want to do something seemingly very simple, but I am unable to find
the correct GStreamer incantation.
All I want is ~30 seconds of delay between the v4l2src capture and the
output (xvimagesink or whatever).

Using the queue element I can buffer up to ~1 seconds:
gst-launch-1.0 -v v4l2src device=/dev/video0 !
video/x-raw,format=YUY2,width=640,height=480,framerate=30/1 ! queue
min-threshold-time=1000000000 max-size-time=10000000000 max-size-bytes=0
max-size-buffers=0 ! xvimagesink

If I reduce the framerate, then I can buffer a little bit more.
But if I increase the min-threshold-time too much, I just get a black
screen. My system has enough memory to buffer minutes of video, so what
is happening here?

I tried using the queue2 element, but this isn't actually buffering
anything at all (what is the equivalent to min-threshold-time here?):
gst-launch-1.0 -v v4l2src device=/dev/video0 !
video/x-raw,format=YUY2,width=640,height=480,framerate=15/1 ! queue2
use-buffering=1 low-watermark=0.5  max-size-time=0 max-size-bytes=0
max-size-buffers=600 ! xvimagesink sync=false

It is such a simple thing to do that I am sure GStreamer can do this,
but how?

Thanks
Antoine


More information about the gstreamer-devel mailing list