From 3c69b367408ef24f3411a64748886203ce5755ac Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 28 Aug 2018 16:52:26 +0200 Subject: [PATCH] Add gst-v4l2-capture.sh Add a trivial example of how to capture from a webcam. --- shell/gst-v4l2-capture.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 shell/gst-v4l2-capture.sh 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. -- 2.1.4