how to set gstreamer finish time while jpeg image capture?

561 views Asked by At

I used below gstreamer command for capturing total 10 images every 1 second.

But the command finished before 10 images...

gst-launch-1.0 -e v4l2src device=/dev/video0 num-buffers=10 ! queue ! videorate ! image/jpeg,framerate=1/1 ! multifilesink index=0 location=frame%04d.jpg sync=true async=false

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
EOS received - stopping pipeline...
Execution ended after 0:00:08.000811937
Setting pipeline to NULL ...
Freeing pipeline ...

$ ls -al
total 19436
drwxr-xr-x  2 pi pi    4096 Mar 31 14:37 .
drwxr-xr-x 16 pi pi    4096 Mar 31 12:28 ..
-rw-r--r--  1 pi pi 1757274 Mar 31 14:37 frame0000.jpg
-rw-r--r--  1 pi pi 1688725 Mar 31 14:37 frame0001.jpg
-rw-r--r--  1 pi pi 2737480 Mar 31 14:37 frame0002.jpg
-rw-r--r--  1 pi pi 2736670 Mar 31 14:37 frame0003.jpg
-rw-r--r--  1 pi pi 2736670 Mar 31 14:37 frame0004.jpg
-rw-r--r--  1 pi pi 2737234 Mar 31 14:37 frame0005.jpg
-rw-r--r--  1 pi pi 2737572 Mar 31 14:37 frame0006.jpg
-rw-r--r--  1 pi pi 2736832 Mar 31 14:37 frame0007.jpg

how can i set running time or finishing time??

1

There are 1 answers

0
SeB On

It depends on your camera framerate. For example, if your camera runs at 10 fps, as you set v4l2src to stop after 10 frames, it will run for one second.

You would set num-buffers to framerate * duration, so 100 frames for 10 seconds at 10 fps.