- Timestamp:
- Mar 17, 2009 4:52:51 AM (16 years ago)
- Location:
- palm/trunk/SCRIPTS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/mrun
r260 r261 175 175 # new variable dvr_server and a configuration file 176 176 # .dvrserver.config, 177 # processing of dvr output files implemented, in order 178 # to make dvr application more user friendly 177 # processing of dvr output files using new script 178 # process_dvr_output implemented, in order to make 179 # dvr application more user friendly 179 180 180 181 … … 2797 2798 then 2798 2799 2799 printf "\n +++ WARNING: A dvr server with id=$running_dvrserver_id is already running!"2800 printf "\n\n +++ WARNING: A dvr server with id=$running_dvrserver_id is already running!" 2800 2801 printf "\n This server is used instead starting a new one!" 2802 printf "\n If required, script \"process_dvr_output\" has to be run manually." 2801 2803 2802 2804 else … … 3253 3255 printf "\n$striche\n *** execution finished \n" 3254 3256 3255 # Stop the dvr streaming server 3257 # Stop the dvr streaming server and process the dvr output in order 3258 # to create dvrs- and html-files containing all streams 3256 3259 if [[ "$dvrserver_id" != "" ]] 3257 3260 then 3258 3261 kill $dvrserver_id 3259 3262 printf "\n *** dvr server with id=$dvrserver_id has been stopped" 3263 3264 # add the current dvr configuration file to the dvr output 3265 # directory 3266 cp .dvrserver.config DATA_DVR 3267 3268 # process the dvr output (option -s for generating sequence mode 3269 # data) 3270 process_dvr_output -d DATA_DVR -f $fname -s 3260 3271 fi 3261 3272 fi -
palm/trunk/SCRIPTS/process_dvr_output
r260 r261 3 3 # $Id$ 4 4 5 # This script determines the number of streams opened by the dvr software 6 # and creates one single dvrs- and html-file which allow the dvr-plugin 7 # to display all streams in one sequence. 8 5 9 # Last changes: 6 10 # 16/03/09 - Siggi - Generating the first version … … 10 14 # variable declarations + default values 11 15 camera=false 16 create_sequence_output=false 17 data_catalog=`pwd` 18 file_identifier=all_streams 12 19 groundplate=false 13 20 topography=false 14 21 15 typeset -i i nstream nscenes22 typeset -i i j nstream nscenes 16 23 17 24 18 25 # read shellscript options 19 while getopts :d:f: option26 while getopts :d:f:s option 20 27 do 21 28 case $option in 22 29 (d) data_catalog=$OPTARG;; 23 30 (f) file_identifier=$OPTARG;; 31 (s) create_sequence_output=true;; 24 32 (\?) printf "\n +++ unknown option $OPTARG \n" 25 33 printf "\n allowed option are -d and -f \n" … … 29 37 30 38 39 # change to the given directory 40 cd $data_catalog 41 42 31 43 # find out the number of streams 32 44 (( i = 0 )) … … 64 76 nscenes=$nstream 65 77 66 echo "*** number of detected streams = $i"67 68 (( i = 0 ))69 while (( i < nstream ))70 do71 72 (( i = i + 1 ))73 echo "*** streamname: \"${streamname[$i]}\" "74 echo " adr = \"${adr[$i]}\" "75 echo " maxbytes = \"${maxbytes[$i]}\" "76 echo " frames = \"${frames[$i]}\" "77 78 done79 78 80 79 # Check, if there are files containing the camera data, the ground plate … … 106 105 107 106 # start with writing the dvrs file for the combined streams 108 dvr_file=${file_identifier} .dvrs107 dvr_file=${file_identifier}_streaming.dvrs 109 108 110 109 echo "SCENES=$nscenes" > $dvr_file … … 159 158 160 159 161 # create the html file for the combined scenes 160 # change path to the current file identifier 161 sed "s/DATA_DVR/${file_identifier}_dvr/g" $dvr_file > tmp_file 162 mv tmp_file $dvr_file 163 164 165 # if there is a dvr configuration file, set the BASEDIR to the parent 166 # directory of the above given path 167 if [[ -f .dvrserver.config ]] 168 then 169 old_path=`grep BASEDIR .dvrserver.config` 170 sed "s&${old_path}&BASEDIR=..&g" .dvrserver.config > .dvrserver.config.new 171 mv .dvrserver.config.new .dvrserver.config 172 fi 173 174 175 # create the html file for the combined streames 162 176 cp 01_*-ge.html tmp.html 163 177 replace=$(echo `grep src= tmp.html`) 164 sed "s&${replace}&src=\"${file_identifier} .dvrs\"&g" tmp.html > ${file_identifier}.html178 sed "s&${replace}&src=\"${file_identifier}_streaming.dvrs\"&g" tmp.html > ${file_identifier}_streaming.html 165 179 rm tmp.html 180 181 182 # informative messages 183 printf "\n\n *** processing local dvr stream output:" 184 printf "\n number of detected streams = $nstream" 185 printf "\n stream names:" 186 187 (( i = 0 )) 188 while (( i < nstream )) 189 do 190 191 (( i = i + 1 )) 192 printf " ${streamname[$i]}" 193 194 done 195 printf "\n" 196 197 198 # create output for viewing dvr data in sequence mode 199 if [[ $create_sequence_output = true ]] 200 then 201 202 mkdir sequence_data 203 204 # first, merge static scenes into one file 205 if [[ $camera = true ]] 206 then 207 cat ${streamname[1]}/camera.dvr >> sequence_data/static_scenes.dvr 208 fi 209 210 if [[ $groundplate = true ]] 211 then 212 cat ${streamname[1]}/groundplate.dvr >> sequence_data/static_scenes.dvr 213 fi 214 215 if [[ $topography = true ]] 216 then 217 cat ${streamname[1]}/topography.dvr >> sequence_data/static_scenes.dvr 218 fi 219 220 221 # now, merge the data, frame by frame 222 (( j = 0 )) 223 while (( j < ${frames[1]} )) 224 do 225 226 nframe=`printf "%05d" $j` 227 228 (( i = 0 )) 229 while (( i < nstream )) 230 do 231 (( i = i + 1 )) 232 cat ${streamname[$i]}/$nframe.dvr >> sequence_data/$nframe.dvr 233 done 234 235 (( j = j + 1 )) 236 237 done 238 239 240 # create the html file to be used for the sequence mode 241 cp ${streamname[1]}.html tmp1.html 242 sed "s/camera.dvr/static_scenes.dvr/g" tmp1.html > tmp2.html 243 sed "s&${streamname[1]}&sequence_data&g" tmp2.html > ${file_identifier}_sequence.html 244 rm tmp1.html tmp2.html 245 246 printf " data for using sequence mode generated" 247 248 fi 249 250 251 252 # change back to directory from where script has been called 253 cd - > /dev/null
Note: See TracChangeset
for help on using the changeset viewer.