Search code examples
videopnggstreamer

Using GStreamer for encoding single shot png file


I have a problem into encoding some video stream into png file

The command line i typed in is as follows

gst-launch-1.0 --verbose v4l2src num-buffers=1 ! pngenc ! filesink location=qrcode.png

However I have the following error

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../../../../git/libs/gst/base/gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.000189250
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

what is the meaning for internal data stream error? I have tried to encode it in jpeg format by changing the pngenc to jpegenc and the file to *.jpg.. it works perfectly

Regards


Solution

  • Probably the deliverd format from your camera does not satisfy the pngenc element's supported formats. Try to add a videoconvert before pngenc:

    gst-launch-1.0 --verbose v4l2src num-buffers=1 ! videoconvert ! pngenc ! filesink location=qrcode.png