Index: /palm/trunk/SCRIPTS/mrun
===================================================================
--- /palm/trunk/SCRIPTS/mrun	(revision 260)
+++ /palm/trunk/SCRIPTS/mrun	(revision 261)
@@ -175,6 +175,7 @@
      #                     new variable dvr_server and a configuration file
      #                     .dvrserver.config,
-     #                     processing of dvr output files implemented, in order
-     #                     to make dvr application more user friendly
+     #                     processing of dvr output files using new script
+     #                     process_dvr_output implemented, in order to make
+     #                     dvr application more user friendly
 
 
@@ -2797,6 +2798,7 @@
           then
 
-             printf "\n  +++ WARNING: A dvr server with id=$running_dvrserver_id is already running!"
+             printf "\n\n  +++ WARNING: A dvr server with id=$running_dvrserver_id is already running!"
              printf "\n      This server is used instead starting a new one!"
+             printf "\n      If required, script \"process_dvr_output\" has to be run manually."
 
           else
@@ -3253,9 +3255,18 @@
        printf "\n$striche\n  *** execution finished \n"
 
-          # Stop the dvr streaming server
+          # Stop the dvr streaming server and process the dvr output in order
+          # to create dvrs- and html-files containing all streams
        if [[ "$dvrserver_id" != "" ]]
        then
           kill $dvrserver_id
           printf "\n  *** dvr server with id=$dvrserver_id has been stopped"
+
+             # add the current dvr configuration file to the dvr output
+             # directory
+          cp  .dvrserver.config  DATA_DVR
+
+             # process the dvr output (option -s for generating sequence mode
+             # data)
+          process_dvr_output  -d DATA_DVR  -f $fname  -s
        fi
     fi
Index: /palm/trunk/SCRIPTS/process_dvr_output
===================================================================
--- /palm/trunk/SCRIPTS/process_dvr_output	(revision 260)
+++ /palm/trunk/SCRIPTS/process_dvr_output	(revision 261)
@@ -3,4 +3,8 @@
 # $Id$
 
+     # This script determines the number of streams opened by the dvr software
+     # and creates one single dvrs- and html-file which allow the dvr-plugin
+     # to display all streams in one sequence.
+
      # Last changes:
      # 16/03/09 - Siggi - Generating the first version
@@ -10,16 +14,20 @@
     # variable declarations + default values
  camera=false
+ create_sequence_output=false
+ data_catalog=`pwd`
+ file_identifier=all_streams
  groundplate=false
  topography=false
 
- typeset  -i  i nstream nscenes
+ typeset  -i  i j nstream nscenes
 
 
     # read shellscript options
- while  getopts  :d:f: option
+ while  getopts  :d:f:s option
  do
    case  $option  in
        (d)   data_catalog=$OPTARG;;
        (f)   file_identifier=$OPTARG;;
+       (s)   create_sequence_output=true;;
        (\?)  printf "\n  +++ unknown option $OPTARG \n"
              printf "\n      allowed option are -d and -f \n"
@@ -29,4 +37,8 @@
 
 
+    # change to the given directory
+ cd $data_catalog
+
+
     # find out the number of streams
  (( i = 0 ))
@@ -64,17 +76,4 @@
  nscenes=$nstream
 
- echo "*** number of detected streams = $i"
-
- (( i = 0 ))
- while (( i < nstream ))
- do
-
-    (( i = i + 1 ))
-    echo "*** streamname: \"${streamname[$i]}\" "
-    echo "    adr = \"${adr[$i]}\" "
-    echo "    maxbytes = \"${maxbytes[$i]}\" "
-    echo "    frames = \"${frames[$i]}\" "
-
- done
 
     # Check, if there are files containing the camera data, the ground plate
@@ -106,5 +105,5 @@
 
     # start with writing the dvrs file for the combined streams
- dvr_file=${file_identifier}.dvrs
+ dvr_file=${file_identifier}_streaming.dvrs
 
  echo  "SCENES=$nscenes"  >  $dvr_file
@@ -159,7 +158,96 @@
 
 
-    # create the html file for the combined scenes
+    # change path to the current file identifier
+ sed  "s/DATA_DVR/${file_identifier}_dvr/g"  $dvr_file > tmp_file
+ mv  tmp_file  $dvr_file
+
+
+    # if there is a dvr configuration file, set the BASEDIR to the parent
+    # directory of the above given path
+ if [[ -f .dvrserver.config ]]
+ then
+    old_path=`grep  BASEDIR  .dvrserver.config`
+    sed  "s&${old_path}&BASEDIR=..&g"  .dvrserver.config  >  .dvrserver.config.new
+    mv  .dvrserver.config.new  .dvrserver.config
+ fi
+
+
+    # create the html file for the combined streames
  cp  01_*-ge.html  tmp.html
  replace=$(echo `grep src= tmp.html`)
- sed "s&${replace}&src=\"${file_identifier}.dvrs\"&g" tmp.html > ${file_identifier}.html
+ sed "s&${replace}&src=\"${file_identifier}_streaming.dvrs\"&g" tmp.html > ${file_identifier}_streaming.html
  rm tmp.html
+
+
+    # informative messages
+ printf "\n\n  *** processing local dvr stream output:"
+ printf "\n      number of detected streams = $nstream"
+ printf "\n      stream names:"
+
+ (( i = 0 ))
+ while (( i < nstream ))
+ do
+
+    (( i = i + 1 ))
+    printf " ${streamname[$i]}"
+
+ done
+ printf "\n"
+
+
+    # create output for viewing dvr data in sequence mode
+ if [[ $create_sequence_output = true ]]
+ then
+
+    mkdir  sequence_data
+
+       # first, merge static scenes into one file
+    if [[ $camera = true ]]
+    then
+       cat  ${streamname[1]}/camera.dvr  >>  sequence_data/static_scenes.dvr
+    fi
+
+    if [[ $groundplate = true ]]
+    then
+       cat  ${streamname[1]}/groundplate.dvr  >>  sequence_data/static_scenes.dvr
+    fi
+
+    if [[ $topography = true ]]
+    then
+       cat  ${streamname[1]}/topography.dvr  >>  sequence_data/static_scenes.dvr
+    fi
+
+
+       # now, merge the data, frame by frame
+    (( j = 0 ))
+    while (( j < ${frames[1]} ))
+    do
+
+       nframe=`printf "%05d" $j`
+
+       (( i = 0 ))
+       while (( i < nstream ))
+       do
+          (( i = i + 1 ))
+          cat  ${streamname[$i]}/$nframe.dvr  >>  sequence_data/$nframe.dvr
+       done
+
+       (( j = j + 1 ))
+
+    done
+
+
+       # create the html file to be used for the sequence mode
+    cp  ${streamname[1]}.html  tmp1.html
+    sed  "s/camera.dvr/static_scenes.dvr/g"  tmp1.html  >  tmp2.html
+    sed  "s&${streamname[1]}&sequence_data&g"  tmp2.html  >  ${file_identifier}_sequence.html
+    rm  tmp1.html  tmp2.html
+
+    printf "      data for using sequence mode generated"
+
+ fi
+
+
+
+    # change back to directory from where script has been called
+ cd - > /dev/null
