3 export MLT_PROFILE=dv_pal
6 function show_consumers( )
8 awk -F '\t' '{ printf( "%d. %s\n", ++ i, $1 ); }' < consumers.ini
11 function get_consumer( )
14 [ "$option" != "" ] && [ $option -gt 0 ] && sed 's/\t\+/\t/g' < consumers.ini | cut -f 2 | head -n $option | tail -n -1
19 sed 's/\t\+/\t/g' < demo.ini |
20 awk -F '\t' '{ printf( "%2d. %-30.30s", ++ i, $2 ); if ( i % 2 == 0 ) printf( "\n" ); } END { if ( i % 2 == 1 ) printf( "\n" ); }'
23 function check_dependencies( )
28 deps=`sed 's/\t\+/\t/g' < demo.ini | cut -f 3 | head -n $option | tail -n -1`
35 ls $dep > /dev/null 2>&1
37 [ $val != 0 ] && echo Failed to find $dep >&2 && echo $val
49 cut -f 1 demo.ini | head -n $option | tail -n -1
68 [ "$option" == "0" ] && break
70 export MLT_CONSUMER=`get_consumer $option`
72 while [ "$option" != "0" -a "$MLT_CONSUMER" != "" ]
84 [ "$option" == "" ] && break
86 demo=`get_demo $option`
87 usable=`check_dependencies $option`
89 if [ "$usable" = "0" -a "$demo" != "" ]
91 if [ "$MLT_CONSUMER" == "xml:" ]
92 then export XML_CONSUMER="xml:$demo.mlt"
93 bash $demo -consumer $XML_CONSUMER
94 melt +$demo.txt out=100 $demo.mlt $demo.mlt -filter watermark:watermark1.png composite.fill=1 composite.geometry=85%/5%:10%x10%
95 elif [ "$MLT_CONSUMER" == "xml" ]
96 then bash $demo -consumer $MLT_CONSUMER | less
97 else bash $demo -consumer $MLT_CONSUMER
99 elif [ "$usable" != "" ]
102 echo Unable to locate suitable files for the demo - please provide them.