3. GStreamer command samples#

3.1. C1#

3.1.1. Display the output from the camera#

gst-launch-1.0 v4l2src io-mode=0 device=/dev/video0 do-timestamp=true ! 'video/x-raw, width=1920, height=1280, framerate=30/1, format=UYVY' ! videoscale ! xvimagesink sync=false

3.1.2. Record video as mp4#

gst-launch-1.0 -ve v4l2src io-mode=0 device=/dev/video0 do-timestamp=true ! 'video/x-raw, width=1920, height=1280, framerate=30/1, format=UYVY' ! nvvidconv ! nvv4l2h265enc bitrate=3000000 ! h265parse ! qtmux ! filesink location=out.mp4

3.1.3. Display framerate#

gst-launch-1.0 v4l2src io-mode=0 device=/dev/video0 do-timestamp=true '!' 'video/x-raw, width=1920, height=1280, framerate=30/1, format=UYVY' '!' videoscale '!' fpsdisplaysink video-sink=xvimagesink  sync=false -v

3.1.4. Simultaneous image displaying and recording#

gst-launch-1.0 -ve v4l2src io-mode=0 device=/dev/video0 do-timestamp=true ! "video/x-raw, width=1920, height=1280, framerate=30/1, format=UYVY" ! videoconvert ! tee name=para ! queue ! x264enc ! h264parse ! qtmux ! filesink location=out.mp4 async=false para. ! queue ! fpsdisplaysink video-sink=xvimagesink fps-update-interval=5000 text-overlay=false sync=false

3.2. C2#

3.2.1. Display the output from the camera#

gst-launch-1.0 v4l2src io-mode=0 device=/dev/video1 do-timestamp=true '!' 'video/x-raw, width=2880, height=1860, framerate=30/1, format=UYVY' '!' videoscale '!' xvimagesink sync=false -v

3.2.2. Record video as mp4#

gst-launch-1.0 -ve v4l2src io-mode=0 device=/dev/video0 do-timestamp=true ! 'video/x-raw, width=2880, height=1860, framerate=30/1, format=UYVY' ! nvvidconv ! nvv4l2h265enc bitrate=3000000 ! h265parse ! qtmux ! filesink location=out.mp4

3.2.3. Display framerate#

gst-launch-1.0 v4l2src io-mode=0 device=/dev/video0 do-timestamp=true '!' 'video/x-raw, width=2880, height=1860, framerate=30/1, format=UYVY' '!' videoscale '!' fpsdisplaysink video-sink=xvimagesink sync=false -v

3.2.4. Scale down (to 1920x1080)#

gst-launch-1.0 v4l2src io-mode=0 device=/dev/video0 do-timestamp=true ! 'video/x-raw, width=2880, height=1860, framerate=10/1, format=UYVY' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA,width=1920,height=1280' ! nv3dsink sync=false

3.2.5. Crop (to 200x200 from top-left)#

gst-launch-1.0 v4l2src io-mode=0 device=/dev/video0 do-timestamp=true ! 'video/x-raw, width=2880, height=1860, framerate=30/1, format=UYVY' ! nvvidconv top=0 bottom=200 left=0 right=200 ! 'video/x-raw(memory:NVMM), width=200, height=200, framerate=30/1, format=RGBA' ! nv3dsink sync=false