Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Use GStreamer to preview webcams
#!/bin/sh
# Show a webcam that delivers video 1920x1080 MJPG on screen
VELEM="v4l2src device=/dev/video0"
VCAPS="image/jpeg, width=1920, height=1080, framerate=30/1"
VSOURCE="$VELEM ! $VCAPS"
VIDEO_SINK="videoconvert ! videoscale ! xvimagesink sync=false"
VIDEO_DECODE="jpegparse ! jpegdec"
# echo is just for debugging purposes
echo gst-launch-1.0 -vvv \
$VSOURCE \
! $VIDEO_DECODE \
! $VIDEO_SINK
gst-launch-1.0 -vvv \
$VSOURCE \
! $VIDEO_DECODE \
! $VIDEO_SINK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.