1#!/bin/sh 2 3######################################################################## 4# VLC demo command line generator 5# $Id$ 6######################################################################## 7 8#TODO: change on Max OS X 9if test ".`uname -s`" = ".Darwin"; then 10 VLC="./VLC.app/Contents/MacOS/VLC --quiet --color " 11else 12 VLC="./vlc --quiet --color " 13fi 14CMD="" 15 16pyschedelic() 17{ 18 echo -e "\n- Psychedelic demo -\nconfiguration\n" 19 echo -en "Please choose an input. Live camera feeds are best.\ninput? " 20 read input 21 echo -e "\n$VLC --sub-source marq --marq-position 8 --marq-size 30 --marq-color 16776960 --marq-marquee \"VLC - Psychedelic video filter\" --vout-filter distort --distort-mode psychedelic $input" 22} 23 24gradient() 25{ 26 echo -e "\n- Gradient demo -\nconfiguration\n" 27 echo -en "Please choose an input. Live camera feeds are best.\ninput? " 28 read input 29 echo -en "Please choose a logo to display (or multiple logos according to the --logo-file syntax)\nlogo? " 30 read logofile 31 echo "new a broadcast enabled loop 32setup a input $input 33setup a output #duplicate{dst=mosaic-bridge,select=video} 34control a play" > "`pwd`/demo.vlm" 35 echo "VLM batch file saved to `pwd`/demo.vlm" 36 echo -e "\n$VLC --sub-source mosaic:marq:logo --mosaic-width 120 --mosaic-height 90 --mosaic-cols 1 --mosaic-rows 1 --marq-position 8 --marq-size 30 --marq-color 65280 --marq-marquee \"VLC - Gradient video filter\" --logo-file $logofile --vout-filter distort --distort-mode gradient --extraintf telnet --telnet-host localhost --vlm-conf `pwd`/demo.vlm $input" 37} 38 39mosaic() 40{ 41 echo -e "\n- Mosaic demo -\nconfiguration\n" 42 echo -en "Please choose a background input.\nbackground input? " 43 read bg 44 echo -en "Please choose a video to blend.\nvideo? " 45 read vid 46 echo "new a broadcast enabled loop 47setup a input $vid 48setup a output #duplicate{dst=mosaic-bridge,select=video} 49control a play" > "`pwd`/demo.vlm" 50 echo "VLM batch file saved to `pwd`/demo.vlm" 51 echo -e "\n$VLC --sub-source mosaic:marq --marq-marque \"VLC - mosaic\" --marq-position 6 --mosaic-width 120 --mosaic-height 90 --mosaic-rows 1 --mosaic-cols 1 --mosaic-alpha 150 --extraintf telnet --telnet-host localhost --vlm-conf `pwd`/demo.vlm $bg" 52} 53 54wall() 55{ 56 echo -e "\n- Video wall demo -\nconfiguration\n" 57 echo -en "Please choose an input.\ninput? " 58 read input 59 echo -en "Do you want to use rotated laptops/screens ?\n[y/N] " 60 read rot 61 case "$rot" in 62 "y"|"Y"|"yes") 63 echo -e "\nLeft hand side:\n$VLC --vout-filter wall:transform --transform-type 90 --wall-cols 2 --wall-rows 1 --wall-active 0 $input" 64 echo -e "\nRight hand side:\n$VLC --vout-filter wall:transform --transform-type 90 --wall-cols 2 --wall-rows 1 --wall-active 1 --sub-source marq --marq-marquee \"VLC - Video wall\" $input" 65 ;; 66 *) 67 echo -e "\nLeft hand side:\n$VLC --vout-filter wall --wall-cols 2 --wall-rows 1 --wall-active 0 --sub-source marq --marq-marquee \"VLC - Video wall\" $input" 68 echo -e "\nRight hand side:\n$VLC --vout-filter wall --wall-cols 2 --wall-rows 1 --wall-active 1 $input" 69 ;; 70 esac 71} 72 73cat << EOF 74VLC cool demos script 75 1. psychedelic video filter 76 2. gradient video filter 77 3. mosaic 78 4. video wall 79EOF 80 81echo -n "demo number? " 82read choice 83 84case "$choice" in 85 1) pyschedelic;; 86 2) gradient;; 87 3) mosaic;; 88 4) wall;; 89 *) echo "Unrecognized input, please try again"; exit 1;; 90esac 91 92echo -e "\nUse the previous command to run the demo." 93echo "Note: make sure that you reset your preferences before running these demos." 94