From: Antonio Ospite Date: Mon, 28 Oct 2013 15:57:26 +0000 (+0100) Subject: Add a gst-am7xxx-play.sh test script X-Git-Url: https://git.ao2.it/gst-am7xxxsink.git/commitdiff_plain/5e1b86064b60c9851dca62bce3310115e8096d81?ds=inline Add a gst-am7xxx-play.sh test script --- diff --git a/src/gst-am7xxx-play.sh b/src/gst-am7xxx-play.sh new file mode 100755 index 0000000..9e2ff95 --- /dev/null +++ b/src/gst-am7xxx-play.sh @@ -0,0 +1,67 @@ +#!/bin/sh + +set -e + +SRC="$1" +URI="${2:-http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_640x360.m4v}" + +usage() { + echo "usage: $(basename $0) [test|ximage|uri [URI]|v4l2|help]" +} + +case "$SRC" in + test) + INPUT="videotestsrc ! video/x-raw,width=1920,height=1080" + ;; + + ximage) + # without use-damage=0 ximagesrc is very slow, see: + # https://bugzilla.gnome.org/show_bug.cgi?id=693037 + INPUT="ximagesrc use-damage=0 show-pointer=1 ! video/x-raw,framerate=30/1" + ;; + + uri) + DECODER="dec" + INPUT="uridecodebin uri=$URI name=$DECODER ${DECODER}." + ;; + + v4l2) + INPUT="v4l2src always-copy=FALSE ! video/x-raw,width=640,height=480" + ;; + + help|-h|--help) + usage + exit 0 + ;; + + *) + usage 1>&2 + exit 1 + ;; +esac + +JPEG_FORMAT=1 + +if [ $JPEG_FORMAT -eq 1 ]; +then + # am7xxx devices doesn't like jpegs with subsampling other than 420 + ENCODER="! video/x-raw,format=I420 ! jpegenc" +fi + +VIDEOCONVERT="videorate ! videoscale add-borders=1 ! videoconvert $ENCODER" + +VIDEOSINK="am7xxxsink" +#VIDEOSINK="autovideosink" +#VIDEOSINK="fpsdisplaysink text-overlay=false video-sink=$VIDEOSINK" + +VIDEO_OUT="$VIDEOCONVERT ! $VIDEOSINK" + +if [ "x$DECODER" != "x" ]; +then + AUDIO_OUT="${DECODER}. ! audioconvert ! autoaudiosink" +fi + +LANG=C \ +GST_DEBUG=am7xxxsink:6 \ +GST_PLUGIN_PATH=$(pwd) \ +gst-launch-1.0 $INPUT ! $VIDEO_OUT $AUDIO_OUT