Revision 59ff2bd4

View differences:

psnr.sh
28 28

  
29 29
function usage {
30 30
   echo "Usage: $0 init <orig video> <codec settings>";
31
   echo "       $0 chunk <chunksize>";
32
   echo "       $0 calc <chunksize> <file with losses>";
33
   echo "       $0 play <chunksize> <file with losses>";
31
   echo "       $0 chunk <chunkmode> <chunksize>";
32
   echo "       $0 calc <chunkmode>  <chunksize> <file with losses>";
33
   echo "       $0 play <chunkmode>  <chunksize> <file with losses>";
34 34
   echo "examples:";
35 35
   echo " $0 init ~/video/foreman_cif_100GOP.yuv '-f h264 -vcodec libx264 -vpre libx264-default -keyint_min 12  -g 12 -b 0.4M '";
36 36
   echo " $0 calc 0 lost.txt";
......
97 97

  
98 98
  #cut lost chunks
99 99
  rm $RECEIVED_MP4 # FIXME: I have no idea why this was needed, but sometimes cutter wasn't overwriting
100
  if [[ $CHUNK_MODE -eq 1 || $CHUNK_SIZE -eq 3  ]]; then
100
  if [[ $CHUNK_MODE -eq 1 || $CHUNK_MODE -eq 2 || $CHUNK_MODE -eq 3 || $CHUNK_MODE -eq 4  ]]; then
101 101
    $LOSTFRAMES ${PSNR_TMPPREFIX}chunks.txt $LOST_FILE > ${PSNR_TMPPREFIX}lostframes.txt
102
    $CUTTER $ORIG_MP4 $RECEIVED_MP4 ${PSNR_TMPPREFIX}lostframes.txt $CHUNK_SIZE 2> ${PSNR_TMPPREFIX}cutter_log.txt
102
    echo "running: $CUTTER $ORIG_MP4 $RECEIVED_MP4 ${PSNR_TMPPREFIX}lostframes.txt -2"
103
    $CUTTER $ORIG_MP4 $RECEIVED_MP4 ${PSNR_TMPPREFIX}lostframes.txt -2 2> ${PSNR_TMPPREFIX}cutter_log.txt #TODO: we use -2 as chunk size, which instructs chunker to go frame based
103 104
  else
105
    echo "running: $CUTTER $ORIG_MP4 $RECEIVED_MP4 $LOST_FILE $CHUNK_SIZE"
104 106
    $CUTTER $ORIG_MP4 $RECEIVED_MP4 $LOST_FILE $CHUNK_SIZE 2> ${PSNR_TMPPREFIX}cutter_log.txt
105 107
  fi
106 108

  
......
134 136
}
135 137

  
136 138
function play {
137
  [[ $# -eq 2 ]] || usage 1
139
  [[ $# -eq 3 ]] || usage 1
138 140
  [[ $FFPLAY ]] || { echo "\$FFPLAY not defined"; exit 1; }
139 141

  
140 142
  #run all the calculations

Also available in: Unified diff