Coral from Google - GStreamer - Example Pipelines

From RidgeRun Developer Wiki




Previous: GStreamer Index Next: GstInference/Introduction





Introduction

This section demonstrates how to use GStreamer elements for Coral hardware. Contains example pipelines showing how to capture from the camera, display into the screen, encode, decode, and stream.

Pipelines

Display Output

CAMERA='/dev/video1'
gst-launch-1.0 v4l2src device=$CAMERA ! "video/x-raw, width=1280, height=720" ! videoconvert ! autovideosink

Video Recording Output with H264 Encodification

CAMERA='/dev/video1'
OUTPUT_FILE='my_video.mp4'
gst-launch-1.0 v4l2src device=$CAMERA ! "video/x-raw, width=1280, height=720" ! videoconvert ! \
x264enc tune=zerolatency speed-preset=ultrafast ! h264parse ! qtmux ! filesink location=$OUTPUT_FILE -e

Streaming Output with H264 Encodification

  • Processing side
CAMERA='/dev/video1'
HOST='192.168.0.13'
PORT='5000'
gst-launch-1.0 v4l2src device=$CAMERA ! "video/x-raw, width=1280, height=720" ! videoconvert ! \
x264enc tune=zerolatency speed-preset=ultrafast ! h264parse ! mpegtsmux ! udpsink host=$HOST port=$PORT sync=false
  • Client-side
PORT='5000'
gst-launch-1.0 udpsrc port=$PORT ! queue  ! tsdemux ! h264parse ! avdec_h264 ! queue ! videoconvert ! autovideosink

JPEG Image Output

CAMERA='/dev/video1'
OUTPUT_FILE='my_image.jpg'
gst-launch-1.0 v4l2src device=$CAMERA num-buffers=1 ! "video/x-raw, width=1280, height=720" ! videoconvert ! \
jpegenc ! filesink location=$OUTPUT_FILE


Previous: GStreamer Index Next: GstInference/Introduction