Changeset 8c0c8a9b0b39b3ceb42fd0721598b8f6bc4c3175

Show
Ignore:
Timestamp:
11/30/09 14:32:47 (2 years ago)
Author:
Robin Gareus <robin@…>
Parents:
a237ba490df98a9f9f2744e4a6f5d384a466cec3
Children:
41dcfc0d39c224f0f2aef6cb2c5fc6541643e4b4
git-committer:
Robin Gareus <robin@gareus.org> / 2009-11-30T15:32:47Z+0100
Message:

new encoder script for tags

Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • flex/inout-av/src/main.mxml

    r90c2f4d r8c0c8a9  
    11<?xml version="1.0" encoding="iso-8859-1"?> 
    22<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
    3         width="400" height="380" creationComplete="onAppInit()" > 
     3        width="600" height="550" creationComplete="onAppInit()" > 
    44        
     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 
    512    <mx:Script> 
    613        <![CDATA[ 
    714            import mx.controls.Alert; 
     15            import mx.rpc.events.ResultEvent; 
     16            import mx.rpc.events.FaultEvent; 
    817         
    918            private var conn:NetConnection; 
     
    2736                password="f78b64c9e0f2ea24fddce2b0d809cb2855fed1a6"; 
    2837               
     38                camsize.selectedIndex=1;                         
     39                tabs.selectedIndex=1; 
     40                tabs.validateNow(); 
     41                tabs.selectedIndex=0; 
     42                tabs.validateNow(); 
     43                 
    2944                cam = Camera.getCamera(); 
    3045                mic = Microphone.getMicrophone(); 
     
    3247                        bt.enabled=false; 
    3348                        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; 
    3455                        Alert.show('You do need a camera for live streaming.\nPlease connect one and then reload this Page.', 
    3556                                   'No camera detected', mx.controls.Alert.OK); 
     
    4869                        , 'Camera Info', mx.controls.Alert.OK); 
    4970              */ 
    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             
    5296            private function securityErrorHandler(event:SecurityErrorEvent):void { 
    5397                        ; 
     
    86130                } 
    87131 
     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 
    88153            private function startConnection():void 
    89             {   
     154            { 
     155                if (tabs.selectedIndex ==0 )  
     156                { 
    90157                /* 
    91158                var now:Date = new Date(); 
     
    93160                                uploadName=now.valueOf().toString()+"-"+rnd.toString(); 
    94161                */ 
    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); 
    96177                conn = new NetConnection(); 
    97178                conn.client = this; 
     
    121202                        if(bt.selected) { 
    122203                                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; 
    123210                                startConnection(); 
    124211                        } else { 
    125212                                stopRecording(); 
    126213                            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; 
    127220                        } 
    128221                    } 
    129222        ]]> 
    130223    </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> 
    137296    </mx:Box> 
    138297     
  • misc/red5/myenc.sh

    ra237ba4 r8c0c8a9  
    11#!/bin/sh 
     2 
     3export PATH=/sw/bin:/usr/local/bin:$PATH 
     4 
    25ICEHOST=io.citu.info 
    36ICEPORT=8000 
     
    58 
    69RAWNAME=$1 
    7 FILTERED=$(echo "${RAWNAME}" | awk '/\([a-zA-Z0-9,_;]*\)/{print};' | sed 's/^.*-(\([^)]*\)).*$/\1/') 
     10FILTERED=$(echo "${RAWNAME}" | gawk '/\([a-zA-Z0-9,_;]*\)/{print};' | sed 's/^.*-(\([^)]*\)).*$/\1/') 
    811 
    9 TAGS=$(echo "${FILTERED}" | cut -s -d ';' -f 1 | sed 's/_/ /') 
    10 DESC=$(echo "${FILTERED}" | cut -s -d ';' -f 4 | sed 's/_/ /') 
     12TAGS=$(echo "${FILTERED}" | cut -s -d ';' -f 1 | sed 's/_/ /g') 
     13DESC=$(echo "${FILTERED}" | cut -s -d ';' -f 4 | sed 's/_/ /g') 
    1114NAME=$(echo "${FILTERED}" | cut -s -d ';' -f 2) 
    12 TITLE=$(echo "${FILTERED}" | cut -s -d ';' -f 2 | sed 's/_/ /') 
     15TITLE=$(echo "${FILTERED}" | cut -s -d ';' -f 2 | sed 's/_/ /g') 
    1316AUTHOR=$(echo "${FILTERED}" | cut -s -d ';' -f 3) 
    14  
     17URL="" 
    1518 
    1619test -z "${TAGS}" && TAGS="Camera,Live" 
    1720test -z "${DESC}" && DESC="InOut Camera" 
    1821test -z "${NAME}" && NAME=$(echo "${RAWNAME}" | sed 's/-([^)]*)//' | sed 's/.flv$//') 
     22test -n "${AUTHOR}" && URL="http://wiki.citu.info/user/$AUTHOR" 
     23test -z "${URL}" && URL="http://theartcollider.org" 
    1924 
    20 URL="http://wiki.citu.info/user/$AUTHOR" 
    2125MOUNT=$NAME.ogg 
    2226 
     
    2832THUSNELDAOPTS="$THUSNELDAOPTS --noaudio" 
    2933 
    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.debug 
    34  
    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.debug 
    38  
    39  
    40 echo oggfwd -p -g "$TAGS" -d "$DESC" -n "$NAME" -u "$URL" $ICEHOST $ICEPORT $ICEPASS $MOUNT; 
    41  
    42 exit; 
    43  
    4434exec ffmpeg2theora $THUSNELDAOPTS -o - - 2>>/tmp/ff2t.debug \ 
    4535 | piperespawn oggfwd -p -g "$TAGS" -d "$DESC" -n "$NAME" -u "$URL" $ICEHOST $ICEPORT $ICEPASS $MOUNT \ 
  • qio/inout.pro

    r1a9e8cb r8c0c8a9  
    22TARGET = 
    33DEPENDPATH += . 
    4 INCLUDEPATH += . 
     4INCLUDEPATH += . icecast /usr/include/libxml2/ 
     5DEFINES += HAVE_CONFIG_H 
    56 
    6 HEADERS += inout.h 
     7linux: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 
     13LIBS += -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 
    717FORMS   += qinout.ui 
    8 SOURCES += inout.cpp main.cpp 
     18 
     19HEADERS += 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 
     38SOURCES += 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 
    955 
    1056QT += xml network