From: Antonio Ospite Date: Tue, 28 Aug 2018 14:52:26 +0000 (+0200) Subject: Add gst-v4l2-capture.sh X-Git-Url: https://git.ao2.it/experiments/gstreamer.git/commitdiff_plain/3c69b367408ef24f3411a64748886203ce5755ac Add gst-v4l2-capture.sh Add a trivial example of how to capture from a webcam. --- diff --git a/shell/gst-v4l2-capture.sh b/shell/gst-v4l2-capture.sh new file mode 100755 index 0000000..ba49867 --- /dev/null +++ b/shell/gst-v4l2-capture.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +[ "x$1" = "x" ] && { echo "usage $(basename "$0") " 1>&2; exit 1; } + +FILENAME="$1" + +VIDEO_CODEC="video/x-raw,format=I420 ! jpegenc quality=90" + +gst-launch-1.0 -e \ + matroskamux name=mux ! filesink location="$FILENAME" \ + v4l2src ! queue ! videoconvert ! videorate ! $VIDEO_CODEC ! queue ! mux. \ + pulsesrc ! queue ! audioconvert ! vorbisenc ! queue ! mux.