Jump to content

GStreamer Support-Snapshot

From RidgeRun Developer Wiki

Follow us on: YouTube Twitter LinkedIn Email Share this page

Share This Page






Problems running the pipelines shown on this page? Please see our GStreamer Debugging guide for help .


Snapshot

The following pipelines show how to take a snapshot from videotestsrc and from a camera source using v4l2src.

Snapshot from videotestsrc

JPEG

  • Using Software encoder:
gst-launch-1.0 -e \
  videotestsrc num-buffers=1 pattern=smpte ! \
  video/x-raw,width=1280,height=720,framerate=30/1 ! \
  imxvideoconvert_g2d ! \
  jpegenc ! \
  filesink location=snapshot_videotestsrc.jpg
  • Using Hardware encoder:
gst-launch-1.0 -e \
  videotestsrc num-buffers=1 pattern=smpte ! \
  video/x-raw,width=1280,height=720,framerate=30/1 ! \
  imxvideoconvert_g2d ! \
  v4l2jpegenc ! \
  filesink location=snapshot_videotestsrc.jpg

PNG

gst-launch-1.0 -e \
  videotestsrc num-buffers=1 pattern=smpte ! \
  video/x-raw,width=1280,height=720,framerate=30/1 ! \
  imxvideoconvert_g2d ! \
  pngenc ! \
  filesink location=snapshot_videotestsrc.png

Snapshot from v4l2src

Using the respective device for capture, use the following pipelines as reference.

JPEG

  • Using Software encoder:
gst-launch-1.0 -e   v4l2src device=/dev/videoX num-buffers=1 !   video/x-raw,width=1920,height=1080,framerate=30/1 !   imxvideoconvert_g2d !   jpegenc !   filesink location=snapshot_camera.jpg
  • Using Hardware encoder
gst-launch-1.0 -e   v4l2src device=/dev/videoX num-buffers=1 !   video/x-raw,width=1920,height=1080,framerate=30/1 !   imxvideoconvert_g2d !   v4l2jpegenc !   filesink location=snapshot_camera.jpg

PNG

gst-launch-1.0 -v   v4l2src device=/dev/videoX num-buffers=1 !   video/x-raw,width=1920,height=1080,framerate=30/1,format=NV12 ! imxvideoconvert_g2d ! pngenc !   filesink location=snapshot_camera.png











Cookies help us deliver our services. By using our services, you agree to our use of cookies.