using filesink to store a single frame from mjpeg stream

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

using filesink to store a single frame from mjpeg stream

prkhr4u
I want to take a single snapshot from mjpeg stream and I am trying to save it to bmp file like this:

gst-launch-0.10 souphttpsrc location="http://192.168.1.12/video2.mjpg" ! jpegdec ! ffmpegcolorspace ! ffenc_bmp ! filesink location="abc.bmp"

But what is happening is that it is storing the full stream in a single file and the size keeps on increasing.

I want to use something like this:

gst-launch v4l2src num-buffers=1 ! jpegenc ! filesink location=capture1.jpeg

But unfortunately, the option 'num-buffers' is not available for souphttpsrc.
How to take only 1 frame/snapshot from mjpeg stream??