Changeset 336 for palm/trunk/SCRIPTS/process_dvr_output
- Timestamp:
- Jun 10, 2009 11:19:35 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/process_dvr_output
r262 r336 14 14 # Variable declarations + default values 15 15 camera=false 16 create_config_file=false 16 17 create_sequence_output=false 17 18 data_catalog=`pwd` … … 19 20 file_identifier=all_streams 20 21 groundplate=false 21 palm_run_identifier=" "22 palm_run_identifier="unknown_run" 22 23 topography=false 23 24 24 typeset -i i j nstream nscenes25 typeset -i a acceleration=1 k i j nstream nscenes 25 26 26 27 27 28 # Read shellscript options 28 while getopts : d:f:ls option29 while getopts :a:cd:f:ls option 29 30 do 30 31 case $option in 32 (a) acceleration=$OPTARG;; 33 (c) create_config_file=true;; 31 34 (d) data_catalog=$OPTARG;; 32 35 (f) file_identifier=$OPTARG;; … … 40 43 41 44 45 # Create the config file for the streaming server; do nothing else 46 if [[ $create_config_file = true ]] 47 then 48 cp ${PALM_BIN}/.dvrserver.config . 49 50 # Entering the BASEDIR, UID and GID into this file 51 user_id=`id -u` 52 group_id=`id -g` 53 54 # data directory is always the current working directory 55 sed "s/<replace by dvr data directory>/./g" .dvrserver.config > .dvrserver.1 56 sed "s/<replace by user id>/$user_id/g" .dvrserver.1 > .dvrserver.2 57 sed "s/<replace by group id>/$group_id/g" .dvrserver.2 > .dvrserver.3 58 mv .dvrserver.3 .dvrserver.config 59 rm .dvrserver.1 .dvrserver.2 60 exit 61 fi 62 63 42 64 # Find out the PALM run identifier 43 65 if [[ -f CPU_MEASURES ]] … … 45 67 palm_run_identifier=`head -1 CPU_MEASURES` 46 68 fi 69 47 70 48 71 # Process the streaming server output … … 172 195 173 196 # Change path to the current file identifier 174 sed "s/DATA_DVR/${file_identifier}_dvr/g" $dvr_file > tmp_file 197 # Remove path because BASEDIR of streaming server is set to "." 198 # sed "s/DATA_DVR/${file_identifier}_dvr/g" $dvr_file > tmp_file 199 sed "s/DATA_DVR\///g" $dvr_file > tmp_file 175 200 mv tmp_file $dvr_file 176 201 177 202 178 203 # If there is a dvr configuration file, set the BASEDIR to the parent 179 # directory of the above given path 204 # directory of the above given path (i.e. ".") 180 205 if [[ -f .dvrserver.config ]] 181 206 then 182 207 old_path=`grep BASEDIR .dvrserver.config` 183 sed "s&${old_path}&BASEDIR=. .&g" .dvrserver.config > .dvrserver.config.new208 sed "s&${old_path}&BASEDIR=.&g" .dvrserver.config > .dvrserver.config.new 184 209 mv .dvrserver.config.new .dvrserver.config 185 210 fi … … 326 351 then 327 352 353 rm -rf sequence_data 328 354 mkdir sequence_data 329 355 … … 347 373 # Now, merge the data, frame by frame 348 374 (( j = 0 )) 375 (( k = 0 )) 376 (( a = 0 )) 349 377 while (( j < ${frames[1]} )) 350 378 do 351 379 352 nframe=`printf "%05d" $j` 353 354 (( i = 0 )) 355 while (( i < nstream )) 356 do 357 (( i = i + 1 )) 358 cat ${streamname[$i]}/$nframe.dvr >> sequence_data/$nframe.dvr 359 done 380 rframe=`printf "%05d" $j` 381 382 if (( a == 0 )) 383 then 384 385 wframe=`printf "%05d" $k` 386 (( k = k + 1 )) 387 388 (( i = 0 )) 389 while (( i < nstream )) 390 do 391 (( i = i + 1 )) 392 cat ${streamname[$i]}/$rframe.dvr >> sequence_data/$wframe.dvr 393 done 394 395 396 fi 397 398 (( a = a + 1 )) 399 if (( a == acceleration )) 400 then 401 (( a = 0 )) 402 fi 360 403 361 404 (( j = j + 1 )) … … 368 411 sed "s/camera.dvr/static_scenes.dvr/g" tmp1.html > tmp2.html 369 412 sed "s&${streamname[1]}&sequence_data&g" tmp2.html > tmp3.html 413 sed "s/;0-0/;0-$wframe/g" tmp3.html > tmp4.html 370 414 if [[ "$palm_run_identifier" = "" ]] 371 415 then 372 cp tmp 3.html ${file_identifier}_sequence.html416 cp tmp4.html ${file_identifier}_sequence.html 373 417 else 374 sed "s&DATA_DVR/sequence_data/\*\*\*\*\*.dvr (DVR 3D Sequence)&DVR 3D sequence generated by $palm_run_identifier&g" tmp 3.html > ${file_identifier}_sequence.html375 fi 376 rm tmp1.html tmp2.html tmp3.html 418 sed "s&DATA_DVR/sequence_data/\*\*\*\*\*.dvr (DVR 3D Sequence)&DVR 3D sequence generated by $palm_run_identifier&g" tmp4.html > ${file_identifier}_sequence.html 419 fi 420 rm tmp1.html tmp2.html tmp3.html tmp4.html 377 421 378 422 printf " data for using sequence mode generated"
Note: See TracChangeset
for help on using the changeset viewer.