Changeset 8c0c8a9b0b39b3ceb42fd0721598b8f6bc4c3175
- Timestamp:
- 11/30/09 14:32:47 (2 years ago)
- Parents:
- a237ba490df98a9f9f2744e4a6f5d384a466cec3
- Children:
- 41dcfc0d39c224f0f2aef6cb2c5fc6541643e4b4
- git-committer:
- Robin Gareus <robin@gareus.org> / 2009-11-30T15:32:47Z+0100
- Files:
-
- 1 added
- 3 modified
-
flex/inout-av/src/main.mxml (modified) (7 diffs)
-
misc/loop.sh (added)
-
misc/red5/myenc.sh (modified) (3 diffs)
-
qio/inout.pro (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
flex/inout-av/src/main.mxml
r90c2f4d r8c0c8a9 1 1 <?xml version="1.0" encoding="iso-8859-1"?> 2 2 <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 3 width=" 400" height="380" creationComplete="onAppInit()" >3 width="600" height="550" creationComplete="onAppInit()" > 4 4 5 <mx:HTTPService id="service" resultFormat="text" 6 url="http://wiki.citu.info/_export/tac/" 7 result="onTacLoad(event)" 8 fault="onTacFault(event)" 9 concurrency="single" 10 method="GET" /> 11 5 12 <mx:Script> 6 13 <![CDATA[ 7 14 import mx.controls.Alert; 15 import mx.rpc.events.ResultEvent; 16 import mx.rpc.events.FaultEvent; 8 17 9 18 private var conn:NetConnection; … … 27 36 password="f78b64c9e0f2ea24fddce2b0d809cb2855fed1a6"; 28 37 38 camsize.selectedIndex=1; 39 tabs.selectedIndex=1; 40 tabs.validateNow(); 41 tabs.selectedIndex=0; 42 tabs.validateNow(); 43 29 44 cam = Camera.getCamera(); 30 45 mic = Microphone.getMicrophone(); … … 32 47 bt.enabled=false; 33 48 tg.enabled=false; 49 ta.enabled=false; 50 tt.enabled=false; 51 td.enabled=false; 52 tu.enabled=false; 53 tp.enabled=false; 54 camsize.enabled=false; 34 55 Alert.show('You do need a camera for live streaming.\nPlease connect one and then reload this Page.', 35 56 'No camera detected', mx.controls.Alert.OK); … … 48 69 , 'Camera Info', mx.controls.Alert.OK); 49 70 */ 50 } 51 71 } 72 73 private function changeSize(event:Event):void { 74 if (event.currentTarget.selectedIndex == 0) 75 cam.setMode(160,120,25); 76 if (event.currentTarget.selectedIndex == 1) 77 cam.setMode(384,288,25); 78 if (event.currentTarget.selectedIndex == 2) 79 cam.setMode(400,300,25); 80 if (event.currentTarget.selectedIndex == 3) 81 cam.setMode(640,480,25); 82 if (event.currentTarget.selectedIndex == 4) 83 cam.setMode(768,576,25); 84 if (event.currentTarget.selectedIndex == 5) 85 cam.setMode(800,600,25); 86 87 Alert.show( 88 'Note that only few webcam models support all sizes.\n'+ 89 'Camera size is now:\n'+ 90 'width:'+cam.width+'\n'+ 91 'height:'+cam.height+'\n'+ 92 'fps:'+cam.fps+'\n' 93 , 'Camera Info', mx.controls.Alert.OK); 94 } 95 52 96 private function securityErrorHandler(event:SecurityErrorEvent):void { 53 97 ; … … 86 130 } 87 131 132 private function onTacFault(event:FaultEvent):void 133 { 134 Alert.show('HTTP error:\n'+event.toString(),'Alert.', mx.controls.Alert.OK); 135 bt.selected=false; 136 } 137 138 private function onTacLoad(event:ResultEvent):void 139 { 140 var rawData:String = String(event.result); 141 if (rawData=="") { 142 Alert.show('invalid project name or password.','Alert.', mx.controls.Alert.OK); 143 bt.selected=false; 144 return; 145 } 146 // Alert.show('wiki:\n'+rawData,'Debug.', mx.controls.Alert.OK); 147 var mp:RegExp = /[^a-zA-Z0-9,;]/g; 148 uploadName = baseName+"-("+rawData.replace(mp,"").replace(" ","_")+")"; 149 // Alert.show('uploadName: '+uploadName,'Debug.', mx.controls.Alert.OK); 150 launchConnection(); 151 } 152 88 153 private function startConnection():void 89 { 154 { 155 if (tabs.selectedIndex ==0 ) 156 { 90 157 /* 91 158 var now:Date = new Date(); … … 93 160 uploadName=now.valueOf().toString()+"-"+rnd.toString(); 94 161 */ 95 uploadName=baseName+"-("+tg.text.replace(" ","_")+")"; 162 uploadName = baseName+"-(" 163 +tg.text.replace(/, /g,",").replace(/ /g,"").replace(/ /g,"_")+';' 164 +tt.text.replace(/ /g,"_")+';' 165 +ta.text.replace(/ /g,"_")+';' 166 +td.text.replace(/ /g,"_") 167 +")"; 168 launchConnection(); 169 } else { 170 service.send({id:"projects/"+tu.text.replace(" ,","_"), password:tp.text}); 171 } 172 } 173 174 private function launchConnection():void 175 { 176 // Alert.show('uploadName: '+uploadName,'Debug.', mx.controls.Alert.OK); 96 177 conn = new NetConnection(); 97 178 conn.client = this; … … 121 202 if(bt.selected) { 122 203 tg.enabled=false; 204 tt.enabled=false; 205 ta.enabled=false; 206 td.enabled=false; 207 tu.enabled=false; 208 tp.enabled=false; 209 camsize.enabled=false; 123 210 startConnection(); 124 211 } else { 125 212 stopRecording(); 126 213 tg.enabled=true; 214 tt.enabled=true; 215 ta.enabled=true; 216 td.enabled=true; 217 tu.enabled=true; 218 camsize.enabled=true; 219 tp.enabled=false; 127 220 } 128 221 } 129 222 ]]> 130 223 </mx:Script> 131 132 <mx:VideoDisplay id="video" width="340" height="280" /> 133 <mx:Box direction="horizontal" > 134 <mx:Label text="Tags:" /> 135 <mx:TextInput id="tg" width="150" text="Live,Camera" restrict="a-zA-Z0-9, " maxChars="64"/> 136 <mx:Button id="bt" toggle="true" change="camBt(event)" label="Start Camera"/> 224 225 <mx:Box direction="horizontal" width="100%"> 226 <mx:Text> 227 <mx:htmlText> 228 <![CDATA[<font size="20px">TheArtCollider</font>]]> 229 </mx:htmlText> 230 </mx:Text> 231 <mx:Spacer width="100%"/> 232 <mx:Text width="207"> 233 <mx:htmlText> 234 <![CDATA[Step 1: Set Meta-Info <b>or</b> specify project ID]]> 235 </mx:htmlText> 236 </mx:Text> 237 </mx:Box> 238 239 <mx:TabNavigator id="tabs" borderStyle="solid" width="100%"> 240 <mx:VBox label="Enter meta-data by hand" 241 width="100%" 242 height="75"> 243 <mx:Box direction="horizontal" > 244 <mx:Label width="40" text="Title:" /> 245 <mx:TextInput id="tt" width="150" text="Title" restrict="a-zA-Z0-9, " maxChars="64"/> 246 <mx:Label width="50" text="Author:" /> 247 <mx:TextInput id="ta" width="150" text="me" restrict="a-zA-Z0-9, " maxChars="64"/> 248 </mx:Box> 249 <mx:Box direction="horizontal" > 250 <mx:Label width="40" text="Desc:" /> 251 <mx:TextInput id="td" width="150" text="My Web Camera" restrict="a-zA-Z0-9, " maxChars="64"/> 252 <mx:Label width="50" text="Tags:" /> 253 <mx:TextInput id="tg" width="150" text="Live, Camera" restrict="a-zA-Z0-9, " maxChars="64"/> 254 </mx:Box> 255 </mx:VBox> 256 <mx:VBox label="Get meta-data from wiki" 257 width="100%" 258 height="75"> 259 <mx:Box direction="horizontal" > 260 <mx:Label width="40" text="ID:" /> 261 <mx:TextInput id="tu" width="150" text="myProject" restrict="a-zA-Z0-9_ " maxChars="64"/> 262 <mx:Label width="70" text="Password:"/> 263 <mx:TextInput id="tp" width="150" text="" displayAsPassword="true" restrict="a-zA-Z0-9_ " enabled="true" maxChars="64"/> 264 265 </mx:Box> 266 <mx:Text width="100%"> 267 <mx:htmlText> 268 <![CDATA[The ID needs to match a project-name created in the <font color="#0000ff"><a href="http://wiki.citu.fr/signup">Wiki</a></font>.<br/>View a list of <font color="#0000ff"><a href="http://wiki.citu.info/projects">registered projects</a></font>.]]> 269 </mx:htmlText> 270 </mx:Text> 271 </mx:VBox> 272 </mx:TabNavigator> 273 274 <mx:Box direction="horizontal" width="100%"> 275 <mx:VideoDisplay id="video" width="340" height="280" /> 276 <mx:VBox width="200" height="280"> 277 <mx:Text width="180"> 278 <mx:htmlText> 279 <![CDATA[Step 2: Set up camera (right click -> settings)]]> 280 </mx:htmlText> 281 </mx:Text> 282 <mx:ComboBox id="camsize" change="changeSize(event)"> 283 <mx:ArrayCollection> 284 <mx:String>160x120</mx:String> 285 <mx:String>384x288</mx:String> 286 <mx:String>400x300</mx:String> 287 <mx:String>640x480</mx:String> 288 <mx:String>768x576</mx:String> 289 <mx:String>800x600</mx:String> 290 </mx:ArrayCollection> 291 </mx:ComboBox> 292 <mx:Spacer height="100%"/> 293 <mx:Label width="180" text="Step 3: Start camera stream" /> 294 <mx:Button id="bt" toggle="true" change="camBt(event)" label="Start Camera"/> 295 </mx:VBox> 137 296 </mx:Box> 138 297 -
misc/red5/myenc.sh
ra237ba4 r8c0c8a9 1 1 #!/bin/sh 2 3 export PATH=/sw/bin:/usr/local/bin:$PATH 4 2 5 ICEHOST=io.citu.info 3 6 ICEPORT=8000 … … 5 8 6 9 RAWNAME=$1 7 FILTERED=$(echo "${RAWNAME}" | awk '/\([a-zA-Z0-9,_;]*\)/{print};' | sed 's/^.*-(\([^)]*\)).*$/\1/')10 FILTERED=$(echo "${RAWNAME}" | gawk '/\([a-zA-Z0-9,_;]*\)/{print};' | sed 's/^.*-(\([^)]*\)).*$/\1/') 8 11 9 TAGS=$(echo "${FILTERED}" | cut -s -d ';' -f 1 | sed 's/_/ / ')10 DESC=$(echo "${FILTERED}" | cut -s -d ';' -f 4 | sed 's/_/ / ')12 TAGS=$(echo "${FILTERED}" | cut -s -d ';' -f 1 | sed 's/_/ /g') 13 DESC=$(echo "${FILTERED}" | cut -s -d ';' -f 4 | sed 's/_/ /g') 11 14 NAME=$(echo "${FILTERED}" | cut -s -d ';' -f 2) 12 TITLE=$(echo "${FILTERED}" | cut -s -d ';' -f 2 | sed 's/_/ / ')15 TITLE=$(echo "${FILTERED}" | cut -s -d ';' -f 2 | sed 's/_/ /g') 13 16 AUTHOR=$(echo "${FILTERED}" | cut -s -d ';' -f 3) 14 17 URL="" 15 18 16 19 test -z "${TAGS}" && TAGS="Camera,Live" 17 20 test -z "${DESC}" && DESC="InOut Camera" 18 21 test -z "${NAME}" && NAME=$(echo "${RAWNAME}" | sed 's/-([^)]*)//' | sed 's/.flv$//') 22 test -n "${AUTHOR}" && URL="http://wiki.citu.info/user/$AUTHOR" 23 test -z "${URL}" && URL="http://theartcollider.org" 19 24 20 URL="http://wiki.citu.info/user/$AUTHOR"21 25 MOUNT=$NAME.ogg 22 26 … … 28 32 THUSNELDAOPTS="$THUSNELDAOPTS --noaudio" 29 33 30 #exec ffmpeg -i - -f mpegvideo -r 15 - 2>>/tmp/ffx.debug \31 # | ffmpeg2theora $THUSNELDAOPTS -o /dev/stdout - 2>>/tmp/ff2t.debug \32 # | oggfwd -p -g "$TAGS" -d "$DESC" -n "$NAME" $ICEHOST $ICEPORT $ICEPASS $MOUNT \33 # >> /tmp/ogg.debug34 35 #exec ffmpeg2theora $THUSNELDAOPTS -o - - 2>>/tmp/ff2t.debug \36 # | oggfwd -p -g "$TAGS" -d "$DESC" -n "$NAME" $ICEHOST $ICEPORT $ICEPASS $MOUNT \37 # >> /tmp/ogg.debug38 39 40 echo oggfwd -p -g "$TAGS" -d "$DESC" -n "$NAME" -u "$URL" $ICEHOST $ICEPORT $ICEPASS $MOUNT;41 42 exit;43 44 34 exec ffmpeg2theora $THUSNELDAOPTS -o - - 2>>/tmp/ff2t.debug \ 45 35 | piperespawn oggfwd -p -g "$TAGS" -d "$DESC" -n "$NAME" -u "$URL" $ICEHOST $ICEPORT $ICEPASS $MOUNT \ -
qio/inout.pro
r1a9e8cb r8c0c8a9 2 2 TARGET = 3 3 DEPENDPATH += . 4 INCLUDEPATH += . 4 INCLUDEPATH += . icecast /usr/include/libxml2/ 5 DEFINES += HAVE_CONFIG_H 5 6 6 HEADERS += inout.h 7 linux:LIBS += -lssl -lcrypto -lcurl -lspeex -ltheora -logg -lvorbis -lxslt -lxml2 8 9 10 #linux:INCLUDEPATH += /usr/include/libxml2/ 11 #win32-x-g++:INCLUDEPATH += /home/rgareus/.wine/drive_c/cygwin/usr/include 12 13 LIBS += -lssl -lcrypto -lcurl -logg -lxml2 -L/home/rgareus/.wine/drive_c/cygwin/lib -lcygwin 14 #win32-x-g++:LIBPATH+=/home/rgareus/.wine/drive_c/cygwin/lib 15 #win32-x-g++:LIBS += -static 16 7 17 FORMS += qinout.ui 8 SOURCES += inout.cpp main.cpp 18 19 HEADERS += inout.h \ 20 \ 21 config.h \ 22 \ 23 icecast/avl/avl.h \ 24 icecast/httpp/httpp.h \ 25 icecast/log/log.h \ 26 icecast/net/resolver.h icecast/net/sock.h \ 27 icecast/thread/thread.h \ 28 icecast/timing/timing.h \ 29 \ 30 icecast/admin.h icecast/cfgfile.h icecast/logging.h icecast/sighandler.h icecast/connection.h \ 31 icecast/global.h icecast/util.h icecast/slave.h icecast/source.h icecast/stats.h icecast/refbuf.h icecast/client.h \ 32 icecast/compat.h icecast/fserve.h icecast/xslt.h icecast/yp.h icecast/event.h icecast/md5.h \ 33 icecast/auth.h icecast/auth_htpasswd.h icecast/auth_url.h \ 34 icecast/format.h icecast/format_ogg.h icecast/format_mp3.h \ 35 icecast/format_vorbis.h icecast/format_theora.h icecast/format_flac.h icecast/format_speex.h icecast/format_midi.h \ 36 icecast/format_kate.h icecast/format_skeleton.h \ 37 38 SOURCES += inout.cpp main.cpp \ 39 \ 40 icecast/avl/avl.c \ 41 icecast/httpp/httpp.c \ 42 icecast/log/log.c \ 43 icecast/net/resolver.c icecast/net/sock.c \ 44 icecast/thread/thread.c \ 45 icecast/timing/timing.c \ 46 \ 47 icecast/cfgfile.c icecast/logging.c icecast/sighandler.c icecast/connection.c icecast/global.c \ 48 icecast/util.c icecast/slave.c icecast/source.c icecast/stats.c icecast/refbuf.c icecast/client.c \ 49 icecast/xslt.c icecast/fserve.c icecast/event.c icecast/admin.c icecast/md5.c \ 50 icecast/format.c icecast/format_ogg.c icecast/format_mp3.c icecast/format_midi.c icecast/format_flac.c \ 51 icecast/auth.c icecast/auth_htpasswd.c icecast/format_kate.c icecast/format_skeleton.c \ 52 icecast/yp.c icecast/auth_url.c icecast/format_vorbis.c icecast/format_theora.c icecast/format_speex.c \ 53 \ 54 9 55 10 56 QT += xml network
